From 48c8483948d0b523b52f43235cfcb1aed09000c7 Mon Sep 17 00:00:00 2001 From: Benoit Perrot Date: Sat, 23 Oct 2021 17:54:51 +0200 Subject: [PATCH 01/36] Make azblob.BlobClient.downloadBlobToWriterAt public (#15899) * azblob.downloadBlobToWriterAt: initialDownloadResponse: remove as unused * azblob.DownloadBlobToWriterAt: make public --- sdk/storage/azblob/highlevel.go | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/sdk/storage/azblob/highlevel.go b/sdk/storage/azblob/highlevel.go index bdf89cb6c2e0..892f2f6fc174 100644 --- a/sdk/storage/azblob/highlevel.go +++ b/sdk/storage/azblob/highlevel.go @@ -230,24 +230,21 @@ func (o *HighLevelDownloadFromBlobOptions) getDownloadBlobOptions(offSet, count } } -// downloadBlobToWriterAt downloads an Azure blob to a buffer with parallel. -func (b BlobClient) downloadBlobToWriterAt(ctx context.Context, offset int64, count int64, writer io.WriterAt, o HighLevelDownloadFromBlobOptions, initialDownloadResponse *DownloadResponse) error { +// DownloadBlobToWriterAt downloads an Azure blob to a WriterAt with parallel. +// Offset and count are optional, pass 0 for both to download the entire blob. +func (b BlobClient) DownloadBlobToWriterAt(ctx context.Context, offset int64, count int64, writer io.WriterAt, o HighLevelDownloadFromBlobOptions) error { if o.BlockSize == 0 { o.BlockSize = BlobDefaultDownloadBlockSize } if count == CountToEnd { // If size not specified, calculate it - if initialDownloadResponse != nil { - count = *initialDownloadResponse.ContentLength - offset // if we have the length, use it - } else { - // If we don't have the length at all, get it - downloadBlobOptions := o.getDownloadBlobOptions(0, CountToEnd, nil) - dr, err := b.Download(ctx, downloadBlobOptions) - if err != nil { - return err - } - count = *dr.ContentLength - offset + // If we don't have the length at all, get it + downloadBlobOptions := o.getDownloadBlobOptions(0, CountToEnd, nil) + dr, err := b.Download(ctx, downloadBlobOptions) + if err != nil { + return err } + count = *dr.ContentLength - offset } if count <= 0 { @@ -302,7 +299,7 @@ func (b BlobClient) downloadBlobToWriterAt(ctx context.Context, offset int64, co // DownloadBlobToBuffer downloads an Azure blob to a buffer with parallel. // Offset and count are optional, pass 0 for both to download the entire blob. func (b BlobClient) DownloadBlobToBuffer(ctx context.Context, offset int64, count int64, _bytes []byte, o HighLevelDownloadFromBlobOptions) error { - return b.downloadBlobToWriterAt(ctx, offset, count, newBytesWriter(_bytes), o, nil) + return b.DownloadBlobToWriterAt(ctx, offset, count, newBytesWriter(_bytes), o) } // DownloadBlobToFile downloads an Azure blob to a local file. @@ -336,7 +333,7 @@ func (b BlobClient) DownloadBlobToFile(ctx context.Context, offset int64, count } if size > 0 { - return b.downloadBlobToWriterAt(ctx, offset, size, file, o, nil) + return b.DownloadBlobToWriterAt(ctx, offset, size, file, o) } else { // if the blob's size is 0, there is no need in downloading it return nil } From b76e8f674ad2125742c244cfc8faa417202525bf Mon Sep 17 00:00:00 2001 From: adreed-msft <49764384+adreed-msft@users.noreply.github.com> Date: Thu, 2 Dec 2021 22:02:52 -0800 Subject: [PATCH 02/36] Replace the advancer (#16354) --- sdk/storage/azblob/zc_container_client.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azblob/zc_container_client.go b/sdk/storage/azblob/zc_container_client.go index d1852ee541c6..2861cbd889d3 100644 --- a/sdk/storage/azblob/zc_container_client.go +++ b/sdk/storage/azblob/zc_container_client.go @@ -7,6 +7,8 @@ import ( "context" "time" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) @@ -183,6 +185,13 @@ func (c ContainerClient) ListBlobsFlat(listOptions *ContainerListBlobFlatSegment return pager } + // override the advancer + pager.advancer = func(ctx context.Context, response ContainerListBlobFlatSegmentResponse) (*policy.Request, error) { + return c.client.listBlobFlatSegmentCreateRequest(ctx, &ContainerListBlobFlatSegmentOptions{ + Marker: response.NextMarker, + }) + } + // TODO: Come Here //pager.err = func(response *azcore.Response) error { // return handleError(c.client.listBlobFlatSegmentHandleError(response)) @@ -206,8 +215,14 @@ func (c ContainerClient) ListBlobsHierarchy(delimiter string, listOptions *Conta return pager } - // TODO: Come here - //p := pager.(*listBlobsHierarchySegmentResponsePager) + // override the advancer + pager.advancer = func(ctx context.Context, response ContainerListBlobHierarchySegmentResponse) (*policy.Request, error) { + return c.client.listBlobHierarchySegmentCreateRequest(ctx, delimiter, &ContainerListBlobHierarchySegmentOptions{ + Marker: response.NextMarker, + }) + } + + // todo: come here //p.errorer = func(response *azcore.Response) error { // return handleError(c.client.listBlobHierarchySegmentHandleError(response)) //} From a0c5c6208e9234a5ed825d6cc17e10871e0ff104 Mon Sep 17 00:00:00 2001 From: John Stairs Date: Thu, 16 Dec 2021 02:34:18 -0500 Subject: [PATCH 03/36] Handle error response XML with whitespace (#16639) --- sdk/storage/azblob/zc_storage_error.go | 7 +++- sdk/storage/azblob/zc_storage_error_test.go | 36 +++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 sdk/storage/azblob/zc_storage_error_test.go diff --git a/sdk/storage/azblob/zc_storage_error.go b/sdk/storage/azblob/zc_storage_error.go index 58dc7d214353..329f680ed3c0 100644 --- a/sdk/storage/azblob/zc_storage_error.go +++ b/sdk/storage/azblob/zc_storage_error.go @@ -8,10 +8,11 @@ import ( "encoding/xml" "errors" "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "net/http" "sort" "strings" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" ) // InternalError is an internal error type that all errors get wrapped in. @@ -193,8 +194,12 @@ func (e *StorageError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err switch tt := t.(type) { case xml.StartElement: tokName = tt.Name.Local + case xml.EndElement: + tokName = "" case xml.CharData: switch tokName { + case "": + continue case "Message": e.description = string(tt) default: diff --git a/sdk/storage/azblob/zc_storage_error_test.go b/sdk/storage/azblob/zc_storage_error_test.go new file mode 100644 index 000000000000..03d6c6784f9c --- /dev/null +++ b/sdk/storage/azblob/zc_storage_error_test.go @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package azblob + +import ( + "encoding/xml" + "testing" + + "github.com/stretchr/testify/assert" +) + +func (s *azblobUnrecordedTestSuite) TestErrorResponseUnmarshal() { + t := s.T() + + cases := []struct { + name string + input string + }{ + {"singleline", "ContainerAlreadyExistsThe specified container already exists.\nRequestId:73b2473b-c1c8-4162-97bb-dc171bff61c9\nTime:2021-12-13T19:45:40.679Z"}, + {"multiline", "\n\n ContainerAlreadyExists\n The specified container already exists.\nRequestId:73b2473b-c1c8-4162-97bb-dc171bff61c9\nTime:2021-12-13T19:45:40.679Z\n"}, + } + + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + _assert := assert.New(t) + se := StorageError{} + _assert.Nil(xml.Unmarshal([]byte(c.input), &se)) + + _assert.Contains(se.details, "Code") + _assert.Equal("ContainerAlreadyExists", se.details["Code"]) + + _assert.Equal("The specified container already exists.\nRequestId:73b2473b-c1c8-4162-97bb-dc171bff61c9\nTime:2021-12-13T19:45:40.679Z", se.description) + }) + } +} From 0a92a8de87e2b21fe9e625456ddfa087d80cf9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 16 Dec 2021 08:01:51 +0000 Subject: [PATCH 04/36] [chunkwriting] Return original buffer to the pool (#16067) When the buffer isn't filled to capacity a new slice is created that's smaller than the original. In that case the smaller slice is returned to the pool which prevents the rest of the capacity from being used again. The solution is to pass the original slice through and attach the length. This allows the original slice to be returned to the pool once the operation is complete. This change also simplifies the `sendChunk` method, ensuring that the buffer is returned to the TransferManager even when no bytes were read from the reader. --- sdk/storage/azblob/chunkwriting.go | 35 +++++++++++++----------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/sdk/storage/azblob/chunkwriting.go b/sdk/storage/azblob/chunkwriting.go index 2e13640dd5d3..02cd196f8700 100644 --- a/sdk/storage/azblob/chunkwriting.go +++ b/sdk/storage/azblob/chunkwriting.go @@ -112,6 +112,7 @@ type copier struct { type copierChunk struct { buffer []byte id string + length int } // getErr returns an error by priority. First, if a function set an error, it returns that error. Next, if the Context has an error @@ -138,37 +139,31 @@ func (c *copier) sendChunk() error { } n, err := io.ReadFull(c.reader, buffer) - switch { - case err == nil && n == 0: - return nil - case err == nil: + if n > 0 { + // Some data was read, schedule the write. id := c.id.next() c.wg.Add(1) c.o.TransferManager.Run( func() { defer c.wg.Done() - c.write(copierChunk{buffer: buffer[0:n], id: id}) + c.write(copierChunk{buffer: buffer, id: id, length: n}) }, ) - return nil - case err != nil && (err == io.EOF || err == io.ErrUnexpectedEOF) && n == 0: - return io.EOF + } else { + // Return the unused buffer to the manager. + c.o.TransferManager.Put(buffer) } - if err == io.EOF || err == io.ErrUnexpectedEOF { - id := c.id.next() - c.wg.Add(1) - c.o.TransferManager.Run( - func() { - defer c.wg.Done() - c.write(copierChunk{buffer: buffer[0:n], id: id}) - }, - ) + if err == nil { + return nil + } else if err == io.EOF || err == io.ErrUnexpectedEOF { return io.EOF } - if err := c.getErr(); err != nil { - return err + + if cerr := c.getErr(); cerr != nil { + return cerr } + return err } @@ -180,7 +175,7 @@ func (c *copier) write(chunk copierChunk) { return } stageBlockOptions := c.o.getStageBlockOptions() - _, err := c.to.StageBlock(c.ctx, chunk.id, internal.NopCloser(bytes.NewReader(chunk.buffer)), stageBlockOptions) + _, err := c.to.StageBlock(c.ctx, chunk.id, internal.NopCloser(bytes.NewReader(chunk.buffer[:chunk.length])), stageBlockOptions) if err != nil { c.errCh <- fmt.Errorf("write error: %w", err) return From ece5efb4f7c76283da3497d09feaeec615567a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 16 Dec 2021 08:10:27 +0000 Subject: [PATCH 05/36] UploadStreamToBlockBlob: only require body be io.Reader (#15958) This function only takes an io.Reader in azure-storage-blob-go, & wal-g abstracts over multiple upload mechanisms which all operate on io.Reader --- sdk/storage/azblob/chunkwriting.go | 2 +- sdk/storage/azblob/highlevel.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azblob/chunkwriting.go b/sdk/storage/azblob/chunkwriting.go index 02cd196f8700..5f4fc4d89571 100644 --- a/sdk/storage/azblob/chunkwriting.go +++ b/sdk/storage/azblob/chunkwriting.go @@ -33,7 +33,7 @@ type blockWriter interface { // well, 4 MiB or 8 MiB, and auto-scale to as many goroutines within the memory limit. This gives a single dial to tweak and we can // choose a max value for the memory setting based on internal transfers within Azure (which will give us the maximum throughput model). // We can even provide a utility to dial this number in for customer networks to optimize their copies. -func copyFromReader(ctx context.Context, from io.ReadSeekCloser, to blockWriter, o UploadStreamToBlockBlobOptions) (BlockBlobCommitBlockListResponse, error) { +func copyFromReader(ctx context.Context, from io.Reader, to blockWriter, o UploadStreamToBlockBlobOptions) (BlockBlobCommitBlockListResponse, error) { if err := o.defaults(); err != nil { return BlockBlobCommitBlockListResponse{}, err } diff --git a/sdk/storage/azblob/highlevel.go b/sdk/storage/azblob/highlevel.go index 892f2f6fc174..c806815dedbd 100644 --- a/sdk/storage/azblob/highlevel.go +++ b/sdk/storage/azblob/highlevel.go @@ -595,7 +595,7 @@ func (u *UploadStreamToBlockBlobOptions) getCommitBlockListOptions() *CommitBloc // UploadStreamToBlockBlob copies the file held in io.Reader to the Blob at blockBlobClient. // A Context deadline or cancellation will cause this to error. -func (bb BlockBlobClient) UploadStreamToBlockBlob(ctx context.Context, body io.ReadSeekCloser, o UploadStreamToBlockBlobOptions) (BlockBlobCommitBlockListResponse, error) { +func (bb BlockBlobClient) UploadStreamToBlockBlob(ctx context.Context, body io.Reader, o UploadStreamToBlockBlobOptions) (BlockBlobCommitBlockListResponse, error) { if err := o.defaults(); err != nil { return BlockBlobCommitBlockListResponse{}, err } From f94e1831d960bf3b04489fe1d9fbd451ad534265 Mon Sep 17 00:00:00 2001 From: Brandon Kurtz Date: Sun, 2 Jan 2022 23:19:03 -0800 Subject: [PATCH 06/36] uncomment o.Progress(progress) in getDownloadBlobOptions() (#16727) --- sdk/storage/azblob/highlevel.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azblob/highlevel.go b/sdk/storage/azblob/highlevel.go index c806815dedbd..32020716e00d 100644 --- a/sdk/storage/azblob/highlevel.go +++ b/sdk/storage/azblob/highlevel.go @@ -7,13 +7,14 @@ import ( "context" "encoding/base64" "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" - "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" - "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal" "io" "net/http" "sync" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" + "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal" + "bytes" "errors" "os" @@ -278,7 +279,7 @@ func (b BlobClient) DownloadBlobToWriterAt(ctx context.Context, offset int64, co rangeProgress = bytesTransferred progressLock.Lock() progress += diff - //o.Progress(progress) + o.Progress(progress) progressLock.Unlock() }) } From 15ba6aff0ea10dcbf1d25a705b4c5734fa7ab3d6 Mon Sep 17 00:00:00 2001 From: Kim Ying <15070078+kimprice@users.noreply.github.com> Date: Sun, 2 Jan 2022 23:20:32 -0800 Subject: [PATCH 07/36] Updated azblob README sample code (#16721) * Updated README sample code container name should be all lowercase * Fix typo GetAccountSASToken to GetSASToken I believe 'GetAccountSASToken' was written by mistake. It's inconsistent with what is described on line 97 and I don't see this method in the documentation. --- sdk/storage/azblob/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azblob/README.md b/sdk/storage/azblob/README.md index 2828035d17b7..34aedafd1cb3 100644 --- a/sdk/storage/azblob/README.md +++ b/sdk/storage/azblob/README.md @@ -103,7 +103,7 @@ serviceClient, err := azblob.NewServiceClientWithSharedKey(fmt.Sprintf("https:// handle(err) // Provide the convenience function with relevant info (services, resource types, permissions, and duration) // The SAS token will be valid from this moment onwards. -accountSAS, err := serviceClient.GetAccountSASToken(AccountSASResourceTypes{Object: true, Service: true, Container: true}, +accountSAS, err := serviceClient.GetSASToken(AccountSASResourceTypes{Object: true, Service: true, Container: true}, AccountSASPermissions{Read: true, List: true}, AccountSASServices{Blob: true}, time.Now(), time.Now().Add(48*time.Hour)) handle(err) urlToSend := fmt.Sprintf("https://%s.blob.core.windows.net/?%s", accountName, accountSAS) @@ -164,7 +164,7 @@ Three different clients are provided to interact with the various components of // ===== 1. Creating a container ===== // First, branch off of the service client and create a container client. - container := service.NewContainerClient("myContainer") + container := service.NewContainerClient("mycontainer") // Then, fire off a create operation on the container client. // Note that, all service-side requests have an options bag attached, allowing you to specify things like metadata, public access types, etc. // Specifying nil omits all options. From ba0a22fc74d4e5babbc1f82de8e3ecbcab384cf3 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:30:35 -0500 Subject: [PATCH 08/36] [KeyVault] updating examples to use ClientSecretCredential, fix parsing keyID (#16689) * updating examples to use ClientSecretCredential, fix parsing keyID * fixing constructor test URL * adding test for no keyid * key version, not key ID, better error reporting * changes from working with maor and daniel * working for both hsm and non hsm, need to fix up for recorded tests * fixed implementation, i think... * working for hsm too * working challenge policy for hsm and non hsm * new recordings * adding all final recordings * reveerting back to DefaultAzCred * using streaming package from azcore --- sdk/keyvault/azkeys/CHANGELOG.md | 1 + sdk/keyvault/azkeys/README.md | 2 +- sdk/keyvault/azkeys/client_test.go | 5 +- sdk/keyvault/azkeys/crypto/crypto_client.go | 14 +- .../azkeys/crypto/crypto_client_test.go | 20 +- sdk/keyvault/azkeys/crypto/utils_test.go | 50 +- sdk/keyvault/azkeys/go.mod | 2 + sdk/keyvault/azkeys/go.sum | 2 - sdk/keyvault/azkeys/test-resources.json | 2 + .../TestBackupKey/TestBackupKey_HSM.json | 250 +- .../TestBackupKey/TestBackupKey_NON-HSM.json | 418 +- .../recordings/TestClient_Encrypt.json | 181 - ...pt.json => TestClient_EncryptDecrypt.json} | 64 +- .../recordings/TestClient_SignVerify.json | 48 +- .../recordings/TestClient_WrapUnwrap.json | 50 +- .../TestCreateECKey/TestCreateECKey_HSM.json | 116 +- .../TestCreateECKey_NON-HSM.json | 346 +- .../TestCreateKeyRSA_HSM.json | 178 +- .../TestCreateKeyRSA_NON-HSM.json | 236 +- .../TestCreateOCTKey_HSM.json | 63 +- .../TestDeleteKey/TestDeleteKey_HSM.json | 132 +- .../TestDeleteKey/TestDeleteKey_NON-HSM.json | 5002 +---------------- .../TestGetDeletedKey_NON-HSM.json | 81 +- .../recordings/TestGetKey/TestGetKey_HSM.json | 67 +- .../TestGetKey/TestGetKey_NON-HSM.json | 33 +- .../TestGetKeyRotationPolicy_NON-HSM.json | 420 +- .../TestGetRandomBytes_HSM.json | 44 +- .../TestImportKey/TestImportKey_HSM.json | 50 +- .../TestImportKey/TestImportKey_NON-HSM.json | 23 +- .../TestListDeletedKeys_HSM.json | 237 +- .../TestListDeletedKeys_NON-HSM.json | 592 +- .../TestListKeyVersions_HSM.json | 175 +- .../TestListKeyVersions_NON-HSM.json | 378 +- .../TestListKeys/TestListKeys_HSM.json | 287 +- .../TestListKeys/TestListKeys_NON-HSM.json | 1092 +--- .../TestRecoverDeletedKey_HSM.json | 207 +- .../TestRecoverDeletedKey_NON-HSM.json | 1018 +--- .../TestReleaseKey_NON-HSM.json | 213 +- .../TestRotateKey/TestRotateKey_NON-HSM.json | 77 +- .../TestUpdateKeyProperties_HSM.json | 137 +- .../TestUpdateKeyProperties_NON-HSM.json | 122 +- .../TestUpdateKeyRotationPolicy_NON-HSM.json | 658 +-- sdk/keyvault/azkeys/utils_test.go | 4 +- sdk/keyvault/internal/challenge_policy.go | 43 +- 44 files changed, 2811 insertions(+), 10329 deletions(-) delete mode 100644 sdk/keyvault/azkeys/testdata/recordings/TestClient_Encrypt.json rename sdk/keyvault/azkeys/testdata/recordings/{TestClient_Decrypt.json => TestClient_EncryptDecrypt.json} (66%) diff --git a/sdk/keyvault/azkeys/CHANGELOG.md b/sdk/keyvault/azkeys/CHANGELOG.md index fad828a1262b..f466da6f6d91 100644 --- a/sdk/keyvault/azkeys/CHANGELOG.md +++ b/sdk/keyvault/azkeys/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +* Fixes a bug in `crypto.NewClient` where the key version was required in the path, it is no longer required but is recommended. ### Other Changes diff --git a/sdk/keyvault/azkeys/README.md b/sdk/keyvault/azkeys/README.md index 2babee17472b..08c75f570085 100644 --- a/sdk/keyvault/azkeys/README.md +++ b/sdk/keyvault/azkeys/README.md @@ -350,7 +350,7 @@ import ( credential, err := azidentity.NewDefaultAzureCredential(nil) -client, err = crypto.NewClient("https://my-key-vault.vault.azure.net/keys/", credential, nil) +client, err = crypto.NewClient("https://my-key-vault.vault.azure.net/keys//", credential, nil) encryptResponse, err := cryptoClient.Encrypt(ctx, AlgorithmRSAOAEP, []byte("plaintext"), nil) ``` diff --git a/sdk/keyvault/azkeys/client_test.go b/sdk/keyvault/azkeys/client_test.go index c519b0b8b4b4..9ed0275ee9fa 100644 --- a/sdk/keyvault/azkeys/client_test.go +++ b/sdk/keyvault/azkeys/client_test.go @@ -639,8 +639,11 @@ func TestReleaseKey(t *testing.T) { req, err := http.NewRequest("GET", fmt.Sprintf("%s/generate-test-token", attestationURL), nil) require.NoError(t, err) + if recording.GetRecordMode() == recording.PlaybackMode { + t.Skip("Skipping test in playback") + } _, err = http.DefaultClient.Do(req) - require.Error(t, err) + require.NoError(t, err) // require.Equal(t, resp.StatusCode, http.StatusOK) // defer resp.Body.Close() diff --git a/sdk/keyvault/azkeys/crypto/crypto_client.go b/sdk/keyvault/azkeys/crypto/crypto_client.go index 59b517296f5e..7a41f23e29ee 100644 --- a/sdk/keyvault/azkeys/crypto/crypto_client.go +++ b/sdk/keyvault/azkeys/crypto/crypto_client.go @@ -57,17 +57,21 @@ func parseKeyIDAndVersion(id string) (string, string, error) { return "", "", err } - path := strings.Split(parsed.Path, "/") + if !strings.HasPrefix(parsed.Path, "/keys/") { + return "", "", fmt.Errorf("URL is not for a specific key, expect path to start with '/keys/', received %s", id) + } + + path := strings.Split(strings.TrimPrefix(parsed.Path, "/keys/"), "/") - if len(path) < 3 { + if len(path) < 1 { return "", "", fmt.Errorf("could not parse Key ID from %s", id) } - if len(path) == 3 { - return path[2], "", nil + if len(path) == 1 { + return path[0], "", nil } - return path[2], path[3], nil + return path[0], path[1], nil } // Parse vault URL from the key identifier diff --git a/sdk/keyvault/azkeys/crypto/crypto_client_test.go b/sdk/keyvault/azkeys/crypto/crypto_client_test.go index 37985d5bb0c1..fa5bf275f413 100644 --- a/sdk/keyvault/azkeys/crypto/crypto_client_test.go +++ b/sdk/keyvault/azkeys/crypto/crypto_client_test.go @@ -16,7 +16,25 @@ import ( var ctx = context.TODO() -func TestClient_Decrypt(t *testing.T) { +func TestConstructor(t *testing.T) { + client, err := NewClient("https://fakekvurl.vault.azure.net/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7", &FakeCredential{}, nil) + require.NoError(t, err) + require.NotNil(t, client.kvClient) + require.Equal(t, client.keyID, "key89075156") + require.Equal(t, client.keyVersion, "0b29f1d3760f4407aeb996868c9a02a7") + + client, err = NewClient("https://fakekvurl.vault.azure.net/keys/key89075156", &FakeCredential{}, nil) + require.NoError(t, err) + require.NotNil(t, client.kvClient) + require.Equal(t, client.keyID, "key89075156") + require.Equal(t, client.keyVersion, "") + + _, err = NewClient("https://fakekvurl.vault.azure.net/", &FakeCredential{}, nil) + require.Error(t, err) + require.Contains(t, err.Error(), "URL is not for a specific key, expect path to start with '/keys/', received") +} + +func TestClient_EncryptDecrypt(t *testing.T) { stop := startTest(t) defer stop() diff --git a/sdk/keyvault/azkeys/crypto/utils_test.go b/sdk/keyvault/azkeys/crypto/utils_test.go index 5245767f6542..07333d02634a 100644 --- a/sdk/keyvault/azkeys/crypto/utils_test.go +++ b/sdk/keyvault/azkeys/crypto/utils_test.go @@ -26,6 +26,53 @@ const fakeKvURL = "https://fakekvurl.vault.azure.net/" var pathToPackage = "sdk/keyvault/azkeys/testdata" +func TestMain(m *testing.M) { + // Initialize + if recording.GetRecordMode() == "record" { + err := recording.ResetProxy(nil) + if err != nil { + panic(err) + } + + vaultUrl := os.Getenv("AZURE_KEYVAULT_URL") + err = recording.AddURISanitizer(fakeKvURL, vaultUrl, nil) + if err != nil { + panic(err) + } + + err = recording.AddBodyKeySanitizer("$.key.kid", fakeKvURL, vaultUrl, nil) + if err != nil { + panic(err) + } + + err = recording.AddBodyKeySanitizer("$.recoveryId", fakeKvURL, vaultUrl, nil) + if err != nil { + panic(err) + } + + tenantID := os.Getenv("AZKEYS_TENANT_ID") + err = recording.AddHeaderRegexSanitizer("WWW-Authenticate", "00000000-0000-0000-0000-000000000000", tenantID, nil) + if err != nil { + panic(err) + } + + } + + // Run tests + exitVal := m.Run() + + // 3. Reset + if recording.GetRecordMode() != "live" { + err := recording.ResetProxy(nil) + if err != nil { + panic(err) + } + } + + // 4. Error out if applicable + os.Exit(exitVal) +} + func startTest(t *testing.T) func() { err := recording.Start(t, pathToPackage, nil) require.NoError(t, err) @@ -98,7 +145,6 @@ func createRandomName(t *testing.T, prefix string) (string, error) { func createClient(t *testing.T) (*azkeys.Client, error) { vaultUrl := recording.GetEnvVariable("AZURE_KEYVAULT_URL", fakeKvURL) - var credOptions *azidentity.ClientSecretCredentialOptions transport, err := recording.NewRecordingHTTPClient(t, nil) require.NoError(t, err) @@ -114,7 +160,7 @@ func createClient(t *testing.T) (*azkeys.Client, error) { tenantId := lookupEnvVar("AZKEYS_TENANT_ID") clientId := lookupEnvVar("AZKEYS_CLIENT_ID") clientSecret := lookupEnvVar("AZKEYS_CLIENT_SECRET") - cred, err = azidentity.NewClientSecretCredential(tenantId, clientId, clientSecret, credOptions) + cred, err = azidentity.NewClientSecretCredential(tenantId, clientId, clientSecret, nil) require.NoError(t, err) } else { cred = NewFakeCredential("fake", "fake") diff --git a/sdk/keyvault/azkeys/go.mod b/sdk/keyvault/azkeys/go.mod index c9ebbdc1df2d..fef837cbac0e 100644 --- a/sdk/keyvault/azkeys/go.mod +++ b/sdk/keyvault/azkeys/go.mod @@ -2,6 +2,8 @@ module github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys go 1.16 +replace github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal => ../internal + require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 diff --git a/sdk/keyvault/azkeys/go.sum b/sdk/keyvault/azkeys/go.sum index caa59560af2c..dd600c7a5375 100644 --- a/sdk/keyvault/azkeys/go.sum +++ b/sdk/keyvault/azkeys/go.sum @@ -5,8 +5,6 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0/go.mod h1:GJzjM4SR9T0Ky github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.1.0 h1:Xc2XhOPo5WsyBAX+EsMdg1HZQ0oDJ8Lt4jivIjv4Cak= -github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.1.0/go.mod h1:qKJHexVLI0iqKFeV/2WnqbRBQtJTPOMeBdmHOxs+E88= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/sdk/keyvault/azkeys/test-resources.json b/sdk/keyvault/azkeys/test-resources.json index 20f726f33227..2fd30e150a9b 100644 --- a/sdk/keyvault/azkeys/test-resources.json +++ b/sdk/keyvault/azkeys/test-resources.json @@ -137,6 +137,8 @@ "release", "restore", "rotate", + "setrotationpolicy", + "getrotationpolicy", "sign", "unwrapKey", "update", diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_HSM.json index 7dc1ee10e46c..132fde34c344 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "344b4340-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "98a38072-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "1" }, "ResponseBody": null @@ -59,17 +58,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "34699fe8-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "284" + "x-ms-request-id": "98c7f1a0-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "213" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, "key": { "e": "AQAB", @@ -81,9 +80,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" } } }, @@ -105,7 +104,7 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "22010", + "Content-Length": "22066", "Content-Security-Policy": "default-src \u0027self\u0027", "Content-Type": "application/json; charset=utf-8", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", @@ -113,11 +112,11 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "349f79b0-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "180" + "x-ms-request-id": "98f3deaa-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "109" }, "ResponseBody": { - "value": "ZXlKaGJHY2lPaUprYVhJaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJaXdpYTJsa0lqb2lZbUZqYTNWd0xYQnliM1JsWTNScGIyNHRhMlY1SW4wLi5veVNlTzdOeklyRTNsS2R0ZVl2enhRLm92Q1JqX3J3UWVnMVQ2RGhfejFhRXRfRzRkVndaYnZyOUNrMEZfVUs1Qy1RZk4xdEx2TUlQamFhR1p0ak5tYUdPaldwVi1JUlM5bHgwYkRDYWV3b2tGZlhOeVVsLW05UzZYRFNKZnN5cFZ5azRCbXNiWlhhMDl6RUxWbTY4VXhKNm1EUkx2U19fcDZBU1laQTAxS0lMLXp2Ynk1WHotRFZPTFFKZ2dGMHI1ZmZySFVtb1Q1eWhqaWZYTTVmRUdjSGxpc0ZYcVl0SzZLZ0JGbjk3NTF6RENpY2xjeFhYdTVLV3pVbGdGWldsWGlrT0doR290QngwaXhMZFRxTElpdmNxMXZ5U0Vka09JeC1ocUVEaGtIRllJVVVHSV9DdW41bXFxVDhrRzZlNjBwWDZHVHo3cXVqNll4X1hBVEZ1SVpHX2s2SnF5Um9aTXlScFc0VHFaTlpvNXliTk4tTHdRd1g1dlNKRWlIZ1JsQXZMRldQZU8xWEQ5SXJqVVBPbU83LWdiTm1OYldFX1FUSEx5bW0zNlVNNEFweDVPTEliZllUbmVtTm5ObTlqX2FwMC0zeVpGdW1WQlNiY29IMnV6NDBSMnFmOW9JcDdnSUVsdnZXNFh0c0p3WnQtTFJwUk9JVUtsLWZQMk15Nnl2ak9ZZkpWa0h0YXNWZGJ2dFUwOVd2OEpWbnVfU1BIR1dJWjZ6eUtuQmtSSDNwdU5CTFNaM2Rld3BjQ1NfNXI0QjhZU3pVWjJIRExUNGFlWXhpZG9DZjNwRlpyT0hyNzR1dTJ6dVRiUmFsSC12N1lPOFN5TlhxcW1tRjkyb3FvQUo2QldjOXRYQXlITTlUYjh2ODNKanhoc203T1FxUkhkSXBxTE91RERTak0zeWFqX1BzR0RLeVo4eWJ1MWZ2LVlfb0NMNTBocWZWdERLT0xKNkFwZWR1X0lhbld4cFRKbDdCQ1hKLW80M2tRT21pTGJiTEJ3X3YtY2M0a2E0YUFsQlhCdG5PUFh0SVVjZlhranhhbVZGSjhKSUpmSHRibjkyUFFRUDBTekNmVWdwMUZ3dk9xX3NNUF9lUldpSDd1ckpyQUh3TTFnSmhXNlBOU1lBd0RGSFltc3cxalg5MnJrNVBEYlhidzhmVU9mdi1aT3Jva2pIRjZRaW5fZkRHbm9nZExJM2RzZVpVU0dETVN1WUh3dm1hZmRDM1FUcGVCTFduc1FRUTFiSVhlSVQ2MmFLR3hlYTZTLTFnYlQ3VE9GZjh6V2hFVlV1NlcxcDVqYU9JQnh5STlVb0o1Z0c1amhJYjZNS2dqMkl1TlRHVGZjclNoSU9rdmx5TWRVX3hBUDlHS3FkSWxwNEFfeFpRYzBSbzN4SUlvcmNlejR6Z1NCeUVDaExQUkgyNTNXbUxsZjlBaFVacVdWUmNicWFzTTB6blRYR1FyRnI2akxTUmEtZm91UFpyWHJkSWRGRnFwQVNYejJlLWhfQUxUa2ExY3pBMjNXM2RQMkFRSVVfZkdUZk44WjhfazNxbXRocEM4X01jZHdPMVlVTDFBOGVtRHowSVVRN1hKeG11S1NtOGF0bjd3VzF0eWRjM3BPTjN5UFJTa2l1TXZSMklqRzhMMl81cFZ4WEFJQVl2aGRKd1lCWHlyWk9QV2lVekxtajlSa0hOZ2J3Z0xGY3llNFlzaGo1cW5haTEzZGRGTmJEYkZBQXZ4aF9ZOWFTRE9kaXRLZm9zcVBFMXVhdWdUbjVSVHFnbXpKeHNlcV9rVFFZVG1PX0wxZXFwd2tfY2VocXhFT2ptRVBiUlZCVWtERlBzazhjTERlT2VEN1VPanp6TmNiUlhmY1VrSXpBbDVlWTd0SVpIU0d6TGNMTUFzLXRld3JCVUM0RjJoRlRzLXRpMGViQkZVN0M0SkJKQlNKTkpmWHZ0cHY0SXE2dEZxamN6dUh6dFM5RGhQS1pGZmd6bEpQOTRwcGk4RDJQWXVaLWVtYlFfc2wxU2FPU2thcEFtOVh6UkdVYkpQeVlTMWJnV2thZjA2dlhXbXJ1WnR0T2tDRkNxYkVmNmZZY1NKU3JTcjhzOGJKb0lwbWVhWHJ4RFVPZ245ekh2MktnSEVWNHhyejJ6SU9QZ3F6V2JqX0VmZWZ0M0ZhYU9rWDM1Q2tlRks2T1JhczZreXJOaGNjN3h2Zzl1S1V5Vjh6cHRHUjdfVkpwYUtDVUMzUzRoOFJ1aDVjWVRieTZYbWJQNkFEYWJHRVlVVTlxNUVNSGVTT2VaMEthejRVR0h3TFV0UXpBMURaM0g4UzBSRkF4aXZsZXBJNk54STVYUFBKVDAwNEtvbGNRcGt6NXI3ZWk1VFVkMno1cldqRHo0dTdQYkR5eUxxV2gxNmlQMTFwM2RuQmRLSWVUYVdGSHJ3WWhEdm5FTjdGNzBXdG0tTWs1Y0tOY21oUW1OVkJpZGJtaXhIWXhaTFh1X3NaVl9mS0RmMkZ3V2tTZmY2dWlvN0t0eW1ua3ZZakw5cVc3MkdaTVNESkY3R3dOY1k1OWtEYmlxZWVhNFFiQVFVWm4ya2l2MGlKM2FTS2JSR0s0cmpvYjdmX29JS3Q3R2NjX0p4R2RsRk5KWDA5ck9EYjl3aGJwMy1QM0R3LS15WUtGUms4d1h2Xy1PQWNpcHQ5WFdocC1TMldwT1BnMlRpdDllSWlRZW0tOVdrVl9jczF0UGhCdkJoU08zV1ItWHo4ZFBTTG9malY2MDc4NzdaSmpDZVk3VEJTd1p0VFpncERITjQ0VmRFLXkxZXFWS2ZuZVQtY2VZdUJPbXJEMFhMbTFLbDh6VmM2a1J0LUJNZTM3RDltRFlnWTkxa04tUDFtOXBFRWNlY3VZQ21wOTBfaXdocEQ0c2o5WlM5UVJJUGUzMWl3NVpNM2ZCalJtUlZtdUF5MmJKWFM3d09ZSXl6VXJLUFZfclc0SUQ4VmdJRlpOTFl4LVlFUUt1Q3BDWDJUMl9wYUdwa3ZjMzVKaXB6aFlSSXJTWGVaUWFoZXFXdG9rck0xTzJ3Tk1vS1FwV0VZbS11MHRxVG5jRXNwVDBwQm5Ja1pRdkJmbXZoeVdhd2ZudmY2Nm5MOTJ4WnBndzRRVzhfd1FseUl0RzhsT0NYb2tJTlg3eVh3UGs3QTNMVm0wTnZPT3lPbERvY3l3b05wNjRiaHVYZE5BS3NtRnNGZHFfWGZfMUM5bXV2c2ZFR05nM0t1ZjNfNXJHNG1yQUZuR29sRGRXakRfQW5BSkxYYmQ1OFh5SUdOTGhINU9IOVZfM0w1amhleV9rb1lnd0xTb1l0QVZ5NmRMckVCYmpoRE5Gcm5RcVEyNWYyNUxTcWhUWlRVZ1R6UjB3UzlZR2hDWkhRN3FtRnNPZUdwTU9ySUZvNzZOMXBvckVlYzlzaTQ5S3VNNkg3YlJUbXZTWklRXzAxUERaZE1mWXlwZkhHeGNEQnlYOXRLbGlkNWh3SWp2WFIwYlhRWDdSRVNZZmdXeFhhaGs2MjRRcE01LUdYVHY1eGJUWlcwVmZ3cVRGTS1GTFJJbXgyc2xhMEJ4ZG5FdnIzTFNxVVFUaEZDRWhlQl92WTJUZ2tmRDhYMlRUdWNJOS1EcG5OUWhBVjNuMElZR2JnZ3pRTEF1UFhMT0dLRkRCSUNRY1Nnamc0OHk4SmlaRXJaalJMcVdCUGpMU0k0cHBuaXlES3NOc2o4eGdIWTh2aUR2alRpZlRqV2RmUGNZR3BJak91TVhUaVhkNEtoMktaNGFocFBfcHE1UTlHQXd3MndGYmk5eWZKRDdQNTc1b0lyY3pQTjJBZUJFNkV6dURTakkyQWY0MUZGaTZ5WW43WGZRcmV2MDRsZFNlSTJCc3pXeUZrQ01INVZBYy1sUC1fZnVNUjlFRnVOQS1SSG9RTVJtTzMweFZITzZqNzltVzRldVg2cVk0eVU4QXdMU3YtdHRnLW9RWkRKX1NMQ3dzTVB2elVXaGpFVUVlWUJWVkVDRkdCaWFYZ2xWQzZ2cTVOWlA5ekZCeEh3R1h4NndlVmZoN0J6ZUE1YkxvWTBXMk9oQ1AzbUo0cEZ5ZjJRXzRFSXZOalNicGo2WGRYZGZQV1g5amRfamNrSWRtWmhLeHhCVDdDRnRaT29ZN05kUVFxOFRkZWNyNzA5SEZMX2hpUzFJZGVTc0lFME9KbnJnVDY1MFYzN1k0ZnlYb01YMHJCcEtlRnloUzlCZnBXRkRfRUVMc05qT01rUXVocS1KVU41WjQ5MWlGbWt6SnNmckszM2JzUnA3eVBhZzlKUk9NanVsVW5IVWdIVlduVDg1MGhQQTYxc05XWmRZb2xzbUdFQWN6RU1hUnZ2NDJkekVyeS1HSDhXenc5MFE5ay1WOHFBbUxQLWZqQ2I4RFA0ZlhoakJ5Y0F1S3ZSRFFMWDh6aDI2dXEwTGRYTmxFUG1NUnlxZnlBeGhOS3FvZy1LaGQwWFlXYkR6eXlnR2JteGNwem1qN1pvc0VUdURMNUZib0NOQUpXSklmTFgtTXpWRUdJVGFTdVNnSm9wVGpEYjdhZUJfQVNqZWg5aURmenFSOTN5R1BjVllSVXZZc19zXzVYQWRqNzRMS3VjbnhIckMwcXdySnhjdEJ2VUVhcDJnSkpRUHBfQkpBSVZyODg3UEM2b2lqdUlQcFpQb1YwZVpQQkhfWFpDR1BwZ1ItZVl6ZE93a1N6NjNZdUpKQTROVE1KdWtCOXNRSUQzNFN1RGRrbW9iNFVRZlo4aXN6UVU1MUF6SllJdlAyVTFVQkRhQjBweFZoNVQ5T0pGX0l2bFRHSmp3djlTT3M5SzM3alJLN3JmVERCU0lnQUxYZG1NU1BLaWI3LXZoUUt5M1FxOE9oaXFHX2l4Z0JGVVowanVCbzZuYmFUUjJERWYwNS1sV1RkWkJxWEs5ZWFyczJYeXQ4V0VnTlpHTFY3N0E3MmtUV1hxQl9zVFhrTk1yQlNJdWg2SmdMaXRtNXpmUk5xSlVJV1ZOUDI4M0E5czdxRTFKYUlGcTBGbTZpdDZPaXFHV1gtTEZqbE9LYV9mTkZBOC1FdHB3QndHU25tTUVaYmpESXRONDYxUEs5MUJBZml0VWRPX3lpZGRua2kzR3hySWY0RTZpLWhGMUZmUlV6ZkwzMGRiN2FtOUU2djI0ZkpMZGJzdjZ0OVRlbHJrUzRNOGxQM1pjclZpaUxteUVLUk9rV0QwUU9zMWVjZWNOVXpVTG13WHRrY281bDVKSVJ1cEpEY1dxNjZKUHJ0YVY4QVptVkoydTRhcUUxM2hEbWVyVzFkWUt5QjZmTV9ldkhJVmJfcXhoVjFqMHRMNTZvM0pvcFhEUXRjU3g4c3VEVzlmTC1QWnZXcmx6ZEN1aWR5a09mdkRwZTZ1NWQ2U203cHhIN3VhejVrTkRvblN3Z25wRDhnenF2VDFSTUlJNUxpR1lLQll6SjFwV1lwY2U1eUhHUlhYeEtGYzJLa0FRMmlTSl9KS2VDVEpqdUJnVlFaa0tXNzNfM1kwUlpVVkVqWkRVajV3S1NUeDZ4SFYtTENtVUlvenZsWVRCLVpZbDF3RHJNUDdsclJrNV9sU2UtbVF4Yy1Rd1l5bjNsSFc1eWhXT0lkZjF5c3JJV2dKeWFHWnBqNUp5R19YcTRacmo4LW81ZUR4VGYxc1hLSWJBNGliQkxZSExOSV9JLUdVX1U2blZzN1pMUWtaZGVNX2x3N0toNElSRTFLRml0VmM2eThsU3NpVFhXOHFqckxaRDR0ZlFYXzhYenZhS09OMVYyT296dkhQTlJ3b09qMmcyNW9tMWd0WWk2R1V1SzlnS0dPeUdfNUhKaElORFhFYlQ3bDdrcnFZLW5BcjFqeDVCcFdwMW1nTTlpTWRxQWVEZVJxZzJLZTI3VWFmdTN2eS1XbUJGeHhsSm1iZGI1WlhrOHlCbUdtMnMzUkNtQUk5MEVhQlF1VHYwX1pDQmFteWtRTEtQaUYzUTNNNnduZllzSXljamxaT1NzNDFocjJ2bDVxQVdvUWx5cklLMGszWFlUeExrOWZvMHhWVk5pdklaOHpaa2V2U29QaEl4ckVsS0FUdXA4UFYxNllwMTR2ZTlUN1pwZ3FISFdwbHcwWUVYamo4R1MwclNDcUN6aG9OWmZycDdaWFVERjhTZHAyWWFYMExUbDdxTUZiLWo2VXZHZmlLVnk2ODY1cWV5YXJTSnMtSmVscUwtTGZVUmo1Tktody04MjM2eHRRWVhIZ2J1TWZPeldxdkxHVGJmWGk3YUNrOXRCMkRqT3N1cG1HVkxuZW42cDlaZERsQXlMTWhISUMzQnhxSk1nYk1uZ29kT0FXa05LMmtzRmJKbE9Kby1hd0huU1VtU0pEaTF6MUI0RV9lQ21ra25lTEdaTFQ3TWlISHdOaTlhODdZVFU0ekZrRlR0Q2FERkE2RlRrQlpsOWNfTjVuYWtadDJiRW1tY1lYNWZJQzBJRkJQRVF5V254RFhVcHJFenN4ZEhiRjBEQVVaUV9pV0dRYjZhWFNGcmdtN0JlM2lnTnZNR3F1N0gyS21uTmd4S2V0NE9rNUt2UllzcXctSllPLUFXVWFLSV9TaktYQlNnS0c1dDg3SEVMMDNLa3dJbGVpb1l0bFhob0s0QXRyekpYcEppanpSS0ljZDNBZ2xMYkxfQjJ0XzVjTzY3clMyV0dUZmtSR3RabGFOTG4yZWV0X0J3Y0ozcS0taGd3eDhFOW90Vml2WlZ0SkN1Q2pIb2FOaEtFWXpMcTdJTngwemI3QWlmcGwwaU40RGlabFNHYTRVOHNVUHVnaDc5bzh4WThYMXBodDd4ZzdzeEZkcVJiTktQZFU0bDBKaVU3TkU0U016enVLUjFhR0YtZzdJM2J0czBuRUNYYkcybVd1d2psQkZXRmRNcXp6cVVnSlJFUkxzcG5kTUNaRHNYRUpaTUI0S0xVdW95YzRybkQxbnVZRkozQ2NjMXkzSF9sSXBuU09Pa3o2RE1JcV9jMWZOMkREZ2VmaVNOUmNQbGZ3dHlLVjZ4LUhLSkt1SDFBWlE0bmI0cjRWZGQ4Z0xJZmpjaGVVdzh1UlFMVGhPZURWdTJCUVhJcDM4V1JuaGJiRUszVm8yMkFqUTJlSXJOMGhVdkRqSXFwS0NnNWxBQzNMMzNYc1ZYbkg4RXZGT1hpNzdyNjM1VXFnWDZOc2ZiaXlRNXpyWmd0Z1B3TFdHUUN5MXgzRVMxWlY4VjlhMlU2SFBWclNmbEpTaGRvZHpQMnRweGptR1Fmdy1tbFJxUDRHR0thMjU1RS12TTk1Q3lvaUtXeldhbXBNXzl6Z05tWFpxaEVGWXpTSjFVamszNTdZenJMQjZvaXhtS3JXSVdWS1hPM0R4SnpqR1YyNm1wYVB5WHhCcFVqWWxaT0ZvcDVPVzlEWWRocTk3ZXMyVTNlM0xPLTlweGV5RVN2dHZEUnZybnJNSWtTT3FTQmo2WUI5S1Zqai1RV3Btak9hb1N5WDJSZURwaEwwS256QTdIbTJVRGlkenZHZ18wRUxDaDNURFE2OHRwS21xRXhiaFlCd0o3SjJhZEVoaFE3RVdiaGZRc0w2V3lMTUNEY1FEOWZ1OFFlcEV0bFVPd0NZTXJKTy0ydEZvNWFEVUtSVFlzeXRRcnlWRzhvOTRmOGhtdDFRNUhaTjhWQXZGTk5lRzNOWExmbXEyRHdhNmVQNWxFY2FDRE5UUW02emRwWTU0TmZ4enQzQk05TElrajh6R1hfaW04ZlBfQ0ZNcnlqV3Y4SW03NVVkaEdVdUMyQzRiNXVVVVd6TGJiUXdOQlNrdFRQZ2R4NGZ5LUxlakdhb2hJVnNmeERSZktLTDJmUVVhWWNqc0JjYlB5Q1k4dWo2c0U3VldqVXJ2Vlo0aVItbnRIOWNXTnhKQWpEV3VJZ3ZGMHhRNkkyNFQwbV9YSkEwa1J3eGhSUmIxNzNxSnp2NHFtSUhCWUd3OUxXOWlpd09udGotUWNocEtfakVWV3hoX2steFMzdWlCWDJZblIxTnp3X1RpdVRCTklfeVNyU1lNRHNlZ1E5bVROaDZWeS1LUUs3SUZGbEdSblNEUTRDbngwa1gzNG1LMEVWelpwRkVodmptTVF3RG4waXpaRnozeGRmN1VwNUZ2Y0F0M0p5WW4wdUJIeXVzTHY1dXlZRVA0TE1yOGdwTFQ2ODRGVkxoS19FSHUtSVQ5VWtJakZYdEltaVFTNnBjVGNkc2c4OEg1cVVmSFVzSnZjM1BQQ1VaOE90RHpfVWlWbEdONVEyVUlQMEs1a0ZWR2FGRjZmUjJIaHlPQS1RVDJ2dlZKTkhoaUl2MnVCTTNyMXhoTEY0dzFJNWwteUFJM0pSZEZkMlB0VTRoTS16MnZNajREM1BjTkZxR2szZWd5MDZFQjJBWkVSMDY5QXZfOUFVMElpMUxvd1lkRENUYUJMc0F1bEw4X2x5Q0pKZGpfNHVJNnkxamk0STEwWFJMWUJEWVoxOUpmVFBJLXF3Q0ExM0JPQ0FqLXF6N2dtUWYzWlVjamtDZjZfQUVlTGduamxjdnVjZjRrM0lkamNMeDNWUnJtZ3JBSkp0MVhobGt3bFotNnlEVUM1dDFyMnYtSnYya0FpMDBYUWROZ29xbE5XaHdRZ3E0SFFXT3FkODUzMXB1Zkt2Z1M3RjZaRlhtWXNZVzNjZnI4azRUQWpzVlhZVFUweEVPajQtYzhYeVlhTHJMZTh0OG1lYU9IbDEtc00xNEYzN1VPOGVGOW8wcGVEN010akF2WTkycnMzSkM2VnZMNEdhM0FvMzA1SmEtT0M4dEFXWXlUQkxhTHY4cmNXQ3pIYTNyN21SbV9RZmxmWTh0eHJlTUh5eE9CSXFLMnU3eER2U3NzSGpqN1NsREYzeWlhWjlGV1VNZlQ5ZkVpalQzdDFublluT01Fa3RXYUJnRTdxWnYxWmhlZ0NoYnRCUHZlX0JHY0UxVnNJU0ZRRG1hcV9CN0M2MGFISXQ5WDVWX05JT2N6SC1rN215ZEwyRldVQzRiRWE4RVhkVktWTnFjMHlsdzQ2dHc0Nk9ITEY4V2ViNFRvVWNsdXkwbS1JSERHaExpOFhQeXBoaG1aT1ByazBXMVE2aVFNREtRaVZhOUsxX1RMVmFTREhEbFB3eTIyZFFwRjBiYl9pX1BhTXNhZkplcGUyendLWWJOdTNlV243d2l5Z2NUd1ZRdmVuTnVhQ2pxVXlXZ2ZQTXUwWDREMWVkSFJibm9NYi10SmhWYmlWY1ZNYjVWcmduSmxLb0tNdWNSWTRzU0lMVTdpVWpFM1hXV0hBTDVBTkhlcUhSRVFsSUIxNUhtaG14a2tWU1BuTm41RmpraHowdnVJM1o0MTlxUncyVVNmNjNqT196NjQ0UnMyUzdpTDM3Mkl2dl9saFVoUTVfSnRMYjN0UFZsN0xBVThMbm1WMS13UGR5OWUwYTluSkxEMDVJTzVLQkRlOUJQd0E1YzJwMy1Tc0pVR2QxVEVSQnR1bkU1V2hVU21pZFNsZWpaWHY2ZzNGOFMwbEg5Z3lsZFdSTzVBRG9FUWs2LVhmcTVPZm0zTFNlSFk0d2tjVnVPS3F1OElfRDVVa1M3WVQ0ZF9pSXpSX1pmV0V6Mk9XTGZWYi1fYWZic2RINS16eEl4T0lUbHVrMkpyMlVLMWhWblRBRGVyTkRfVjRoNVI3Y3RYVnVIU1BxdV94QkZRRXZ6eGN0Y1lLdGVFVDFMbXBOeld4eV82aFdJTFJNS0VUUGNIeWFlVFMyYjViSG9WMVdGTndzSlBfN2NzY1YySHN4d3RWdDcwdGxxWmFuY1VWVnlRUFN6RGZPM0tZd3c3M2ViOHY5dzZNN3hEUjNLMVhadWNnMEFoLS1nM0pZeW9LYU50QzZfZDFUVFB1Mzl0bzhsdDRKQnk5bmwyam5TS0hYWk5CWHdQOFFnNXNDM0NUb0dxbkdGd1VjS1JaYnc5OW52OXhLYzR2SGF0b24wcEc0MVF1UGdvM0Z0R0F1WnQxLUdublF0YkNDX0RYME1ndUdVNmNQR0NxVGFPOEJQNEI4TWJ0VVlZZmVqamcyNV9hY1NoNjdyWExJenZSVVMyR3BIbjNCV1Y3VkxQSk5hR2dvblNzQnR0eGtKZkxSNzVOM0VUUGNQNkY1cWt3cVFIUXpYenpVVXdsZTk4cjYtOW9RZkRrTDh4TGsweGxMT050LTN0THpwSmFWLWpuVjBUUG1fMXg4MWZYSUV4cFljN1VYZmxoZkVzakpiTWttRVNNX1ozMVpxYXIzbVFxMmJVT2YxcEk2YkFhalhhTVhlSmREM1pTcnJyWkFSZGZsWkFXNXJRV2ZMTGlVNV83SzdzTm1Fck9fTEl4NnJVdmFmYzlFajdBVUtpMmxBT1pBOURmcklZc3RkVXhWYkQ3cldiMUhXNjFYR0tobDlhWjE5WTJQclNtU1FJYzNCNjdPNWhKRTctWl9aa1dSWHJfTTdXdmFKbG0xUlhZNVMySUNWWE1SV2pOdUpfOEcwOEV5aDM0dEwzaTA2V2J0cE9jUkdvWVBnLXMtX2l4Y3ZCU21DcmNmU2U5LWhVajZIMngxV2puUFFlT1lMY1FXWUZwTmR2eXdnMjh3Wk5vOEJPNUt4amt4dlBMWklvZVVpVU5ZaHBnSVdjQk1fZWpGdmRDTUtCWWloanYtWDNJS3FfUGtZcDBMR0RGUEU2aHV6UlRnbERsa0hFcENYOHhOYW8xUmRkWng1UFVoakNDQ1BOYmR1elEydk50QlFaSTdmeTBxY2J5dlRhQ2c5SGNsanBQbEJyTTliZ1FTSGdWRUpVQ2hXNUJqSHVhQVN2dUFMMHpNZWxCV2hzblFHQjRhX0ZpOFFld3lNQXVEUXlHOU16WjVyRzlmVDFHUDBqMUJuRk15WXJObnpWZDRJZlNteXl2RTZzSC1DbmJuZXprWURmNGVzWGpTTi1hMlozMFVybHc2OWxKRXNRUk1RUHJhQ3ExVno0TFlETjJBM296NGsza2NEbE9YQXMyVDB4eXJiWXMwdDdrenNHQlNqT3hBUldNU01ZRml1WmxOZlhpUWJ0V3AxWXlXcEhNRzV6NkJ3Z2JSYTA0VV9ibGI2OXhuNk0wMWM2dTV1U1l4OGQxVG5rU0NGUklYX0VfZXJuRGRyWEtvU2lsclNZdUsyNXVSU3NxREJlQVdmVmY3QVc4VlgwM0I1X1hQa0xqY2UwNXc2aFd4MlhWNTJ5WmhpMTFQaXVaWGZlXzczZjVYc3hMdk9OVm1PeXZLNWF4cmdwejFTVkJJR0JhWkQ0R2RSaE5DUG40OG5FWU9LM29rX0FiVjNCcTNkNVRXSzJxZDQ5elBDYmE2U0p0UUgtU2JqcnBHT2NMcE9RMTBfMm9vVHoyV3lWbF9BWHhDTnBqbGI3RC1SZ01RTEM3TWY5S1Z1cGpNSVMyTUUxY3ZPN3E4TUFoSHVuRThTc1dXWGNLc09YekNpVHNtV002WnJFUS00bEUxalZ3UWZDSVczLTh6RmlhbnZ1Sm5QOEFYZWhuU3JRMkhwWjNCbFdaYjJiOUliejBsaFU1MlEza0RvLVlZak92WGNRbUxtZGVXTkN5QzJyN2I4c0E5OWZBeHlHSGNpQ0M0T2RtU1QwX05yekVwc2VBc2dqTDdGZm43Zld5aGtjN0ZhdzZ5c295SDhPMzVNamRRNHZXN0RZaXJ1djk1N2VpcWxqX2hqanFNRmRZVm1TZlVwMVhCeG1ncUxWbXU5ZGZWcEFTNExsVlJ1b1g0NTY5eW9SNzJ1X1BpMzdZbDUyYV9pXzlWTjV3MkJneURjNFRuM2d0YlI3Y1lRZGN4WDFqNUk2N1ZpV204aXk0Z25zRlczTGhWTVBsOFlRbTBub09Ob3loc2hzYUFGbW5mcXNnekdkUzRoaUNUQktCRWJoaWZXcFJjVVppX0VieHRCbjA1ODBXVkJBM3JuZEg2TExGa0VMWFpGYTNmaVNSWWFVT2RmbUZibU1WNU9adVYtekkwTU1kMjRYbEtEMFcxWXh6NXJUd3FoU21KZDRrcjk0Q2tDbXRKT29XbFVVbWZWc3pnNVBubWhwQXAwRG1qTTRGYXhnWVJSbWRlc3I4Ym8zaHZpOHBuQVFFaVYxVy1DN1Q2aEdSZDFDTnVFcWpqdVJUbUx4UDFvV0JQNndURHpTNmt5TXZSX01hbENXREM1amJDSkJPQjdGc2prZ3V4akxmZkFEak1NQ0hwWXhhdWYwcDhMSWFaLThaNGczZDNtTklCSTBYNEM5NjdkX3RvcXBuYjF5d2d2UC1CamJYdDAzb2dYMUsxNmdkSnQ1VVh1dHA2Z3ZycWtLWTExejlJYnViSW5SUm9raVdOYVZLSVBYWXlYZTk0ckd0WVM0RGs4dVRjU1U5X1pOcjI4S1pabTRKUFFHQUxMVkxXeTNpdlRLY3QxLVl0RGRRb2lkWU5lNlQ2a2FEcDVJQm5iN2FzWm0tYWZtcjYxdnRMSkVXVi1Bdk5rZ0pfMEF0ZlhFTE9IcXkyTzd2VWtKTDV4YnBNX1ZHQ1VRR3F3WG1yUGsxc2hsUFJ0UWtqemZ2TlNDQ3dxcEdibENPV2xDSDVsdUdfY2haV0NXTDBfMTJEV29yNTJtcWNTTzVCNXFnNkJIOXVTaDJmQnNQbG14TjJMbVZRY3MzanNiTjR5UnNVTlFXTGtxQkhkR0lJN0o4dW1rVWd3dy15QTJJN2c0WUFBYlV3WjdmcGVJWFZRbzJKZGdFTHpoWWZoeTVISC1KT2lMbVIwdmp4V3o2bExrRk1JN1pPaWU0ZDlfQTlzZUZDYWtjMFUyT3NBbHhMLW9DLU9Rczk4QXAxRHFPTjY2R05ocFBMajQwZ0xFdkJid29SNUFYMEUzN1p1WHJuWHRyY2NITnYzN05CZmdJa2tpYkMtaEptZGs1a0gyOHB3c1pXT2dEdjJ1MzZXTktvWlE1SjhnaEFtR3J2RE9sdl9aTGlaUXJQSktFc1NzZ2RxbmJfRk1YUFNBamd3ZXBOSWpGU1A2bC1zeDN6ZklHYndJYkJqNTV4dEtVZElGMktObTY2NVlJYUt0MEZ1NGo2d3M0S2pxRVpWQ0x3WjZoTGk5OFFTSHRxS0pEWXNNTDhrUXRQMHVTdThRSmJSZG9YWGl2Z2RMM2Fvd3M2WVNPS1dqQnRTQWFCYlBfQkZfX3ZGd0pYbmM3Y29taGZTbGk2anhmMGpJMHYwcE9NVlBPYThiU2g3ZFNCSDZsRnhGeGhyLU9qUlNiWHhNSjhmZ1FRNzF1VGx5RGRiT3pMY1lIY3R4RWh5bzk0NUJUZUVqenpBNkxRNl9wblN6S1N2N3BSNWFtbk05bHpoUEJscEEtbGVFc0RCZU1takpOZy1QNW5BRTA5a09vY0lVbW1NdjVlMXI5dHBiNEU1ZnpPYW1GSWpjVmJJSHhrSVpwTVdLY3JNUzl5aTEzSnBZY0k5ZnlJT0ZQa1BOUVZ3Q2pvSmVxQ18tSzZmSzdEMGNiU3dRVVNRMFhqVEZRS19fNmNyMzc0UlFSZGxCb29TN2tQLWt1a0xQSi1oZmdzMlEtamxTOVBBWm9CSW52RHVFdGpfTXNpeFFHOTEtSnMzVUhHNFlLS2w0bEtCdG0zVXJYejhZZjFWRmpqa0hkTDU2bmc1R3VPTEhMd1lnbU1oSjhJSDhDQ2FmN3p3MGpuWGx2dENoMUw0OUxpUFg2MHFTeWRlSUxCd2lfTG5VQ0pnb3lXbmdDNzJsTWZmTUhkajhsNk5pVHhjWWFnbEpLQTd6NjkzSmUyU0JBUTR1SVNidGR2TFJpVmQ1VWktMEhpVW1BVHhqX3VFNFJaakh3RldCdFhJbE1odzVwMXBmcW1iX0g0Vjh4Q2JRMmptTnBZaURYTURuNDJtX09TTzVVTzJWV0RyMjFDTXpueDQyS1V2NTZrVHMtakwzcDVBN28yZHpzRVhpdVZPRUpoc1d0M3FPaVFvY0RqSG1XdFRCOFJnaTBJbDFiMHdQeUV0cXl5U2JoWS1XZ2drbDd4R2huTG5na2hrLWxQZzFkaThhOWNOWVctSkZaYWJuMHJEWUE1QWd6MzBSLUkwc3lqZy10QmJyUkZZcGFnaWhNOTVuWWQtTlMtQlkzZnktY1ZsSzNGUkFYVzBnMjRFOElPbjRKWXdONGY3dmVkTXpWTTBva2hXbTRQYWhZWDVuY29ySTBteUQ1WWY4QTE5WXpWcmxFOW9KUThIUWRmb2o1ekZvclN2WW1nVnViSW1KeFQwYUMzTUxzV0F4dnpsbzBYMF9OLXV0M1RMWlBtWDducmJNdkg3MDVwVjdtaFpsdEdNcXNEc1FQcjhtTU4zVlBxVVNGZkhTT3NtMWpodnp1WFJHSU14eThoVzdaLWl2MU80TktUVXdTb2M4cjhYUFhleC0tajFxb0cyYWo4bkZrMGx0MDhEUENVNWVQVldOUnk3b0FQTXlidGdOY3pXcWlONk9Md2ZPT0dxZk8tZU1GanV4RVZUMG1ObGpIYkUxbnhPWGNLd3RHdzJaMGp0Y2Q4TmZqYXJJcll0ZWlfS3FPUlZvU01XRWd6dkYzbzV6OXprYlZkSHcwVlFJa1cxRFF0OWpJWDdfVk52eThJQWpDRzF5NHZfUkFFRUVVOXNZMlVhNGFfdlpvRlJ6UXBBZm5CUFVtQl9kVDVYT0pqYk9MN2pyYjNGWnBKSXozSVZkSGM2UnYyZ1lzTmp1MXpHZzdybXBrYXJJaVMzZnJTeEt2UHp1enVyTnJ5RFdTQlVtUkdaX3piYjNqUXNpUUhaSGRtN25iOXF1N0dKRkxmTVZlR1JUdml6OWVpeWd2aVRQSXBBOFpHaTJzLUQ3cjFUakd4OGFKd3RjajV3TEZKMjExRmhCVHVndUV5NjJYUE9kTEdwM0lHNjVmSWt5Nm91QWgySEN6QzYzMnI5UEpDVHVRWHc5cXJkMFpOaF9ieVpIZUd1cWg1MVAxMVZfOGpyS0tjeml3TzlqQWVKbDdIMV9FU1JZS0dDeG5QX2xyWjdocHVKbUdubThjQWFBMVRBVzJPcTdxdVF5X1RCRVdMTURGcVhBVG9rUy02ckV3bG0zSW03UldQYTEtSnJlR3pSUW9ydUVCNmNkQ3hGNVNSaEZEcWZCMndSTGlzRXZSUHYwNzZZRk1LRWpjZ0FQb1RRVF9EQ21JaE43QXZaclJ2cDZuQVNUZ2VWNVBjV3F6RFcya2tlTHhpM2VTVDNReFFBcnI2R0hUWXpncEJJVWxFdG5lakcza05DQUlteFpQSjJEZFUxVkdCd0E4ZkhWRElhLWFhT2J0WjlFaFl4cjJsbzZCQkcyOW11RmRSOFNNSVhkMTZiQVdMQUtGWVNCb0xpLVM3VHVvU0FqV29RSjNiQTFZOWRrUjdZQXJQYnBvcFJCODRuaC0ySzhoOG1zVHZKbUtOMXF0eGgzUDRpZmxRNXpHd0g4OXdia3dRbDR1MXhwb2J6REk0aFp1akRpTWl3aURweFktNGk1dTBQSWs1N2RwazhtRFZHQThTendPemNOVnNjTnlfOG9rMnVDdVNBMWpNUC1hM3ZPcktSS29VcGRKTDJVOVV6NjJ6OG5mYVZZRTNzSWV4czlleXN3QWNxaVo4T3VrcHRYLUZtOTRWakRSWlp3WWkyZmR1ZUxGc1pnRnBmS2lZOEk3MGJLODRxeEhrWXdVUEZ4NGdqY3BNbVp2OS01VVBBWGpudkhucXpmYmRiNkhLWjY5bC1tZDNBRl83X0tQSlM5UG93YUtMVnlXLTZoU1VqWGR1VXI5alB4bGpYUG5EdURjYndpdVRZUTg3VE1YdVhJdHZ6amlLT1l5RVdTSXhJd05hSlV4WHRNRnFMT0xwZWhhdnFaenFoMjVSR1ZLaUw2YldiajktTzZya19EUWEwdkk2eWhraWNXYWhHMFNNaG5jZXZUX3JRUG41X0ttLUs4emthMUUxUjhjWElMR084cEs0RHRXYjZ2a0Y3N3Bic05URXBUU2VsbFRWYkFMNlFEZ0NtaVcyeTF1ajVRTXFNLWtOaDB1Mnlxa1ZpN09LSVZaSnBJWm9ibnBRNmZJb3F2VGtrUFFpQTNYbkFpMVk1WE1VcVVfdXQ4dnRtWEpmcVBYSHlqRmJmRXUyREV5NE01cFplSzh3MjhKaTl5VWdKLTNBTXBjZTUyVGVBUUpGR0pCRzJyTGI4Qy01TGUzQ3Z5OWtlYVdkd0VJcXVCVmxFNWJPVFJ3RjVwWEE4WWMwNkUxUnIzZFI3eUg3OWtjX3AtY3g4eEMyNkg0VWJZaDRZYU5xYWFBaDI5bjhXbDJZS09yVnFKQTJ4TXJ3dHV2eG12SGtPbFBudWV5UEZndjF0cmNLQUNlLU5Jc3BaRVZPNVhIYlpQSGRnVWpmam9ZbUg1S2xtZmhsb0lJSk5QZ0hRTjFJQ3l0akJQdnJwcl9NMkVtRFo3U3pnRUdEbnRoNUh4czZHNjhYNXF6V0pDNFZSWXJqLWpqeVhBNGpmQmpJTnA1NWltenpfUURrd3hHTFE5c2NKOTNBaHpBUHpQS20xMzVUc3NqMXBiQzFoSUNCeW95NWZJcDczbHp2VjB2dHFENjBLckNKVEgxQkRYdkZiRjRycGlyNVpzOExUTE54UWdwM3NjRXVnNUtxaTI5b1ROc2FCeUs4VUNrNGx0ZkVuVTRna2ZDSWp6b1JPNHBqT1k5MFpSU2dyQzVINGV2aVdNLVpiTFFQVWhfdXdhNmpETG11SWRMZE9nY1pfelJYeHhVZE1NS2JVTndUQnZXY1NkaExxT204dWhUNzZFQ2Z6dzJpUUlYRFlCaENfbzUzbEEzT1FlVHE5MEZacDdhb3lGTkw3UGZiazV1RWxoaTV6YTA0WDZvcWZTVWxEckR5ZmwtNVJYVG9vNS01NU9NdndjUWJSRzI0WkI5UVh3YlMwMGtub1NOU2hMUzhhaVNxaTYyMXJoQUNXQlRHNkJibTltODduVk1uYnNLdWdQb3RJNnhtQkNVT3BMNjJwek9BS1pXQkVHdE1JZlU5NVI2TjFnYkhFMFEwT3pXSnN5aUtfazJzdVh2dmZOLWNERC1lYXVtR21FR0w5MUhKQUgtWWV1U0VtZ0xHMDRsZXVLbkUtTm56dmxsVmoxYlotVHJiclljUUVWQWo3M0VqWXpoMWV4cWYya0R4eTJCRFdjaGdjM2hyZXcyTm5Kdl9iUlFhNm83WGZ2aTB0cy1tWVFfd2xMNmVnQjZvR1V1cUJaTjZxVjVXSVpSb2JzOEExeUFCZHlyOUYzTWhxMW0zc2phSkVnUk92UjU1WFBTT3J6UmtpU3RNVENhc2hzTi1VSVRkeUowVmtvUW9yZGxHeHRZSFlRNk5qam1XQ0lJUFNPUGxTcTN1N3ptZjh4NXJxcXI5RVBPdmNVLVJaLVBxbXA2aVN0X2pJWFY4ZUpQTXAyUkloX0I3Y0FKaVI0NmRJZUNVY0ZqTXk3WGx5dVprWldfQlZpd2FsSTJZLWYxRDNDNHRNUzVLaTdWSlZFUy1zMEk0VURtMXdUejF2S0ZBUU5jUUNHVDV6MHlFN3dvOTBmanRNN0hubERXMEl5ejJwZTA4aXowZWpzU0N6TFFfU2xiek1XVmFkTGxGclBWWThRMFQ5ZVJXWFNiXzVOc2RaTFdoZklpSmRPZ2pCS0hMRHVNLURhQkFhX0JKUkNFVEJtakFrWWZKXzBOOS1wNXVoQldGWmtuYXlPWnNiSUdPS3hablhNQXVCajVCX2F6TWVieklkcktCSllYRWE1aU1rS2hUNDlTQjUzaXJqeDA0NjBieW0tSnFUN3AzZWpNc2NSdEpRT00xeUhNel9kLXgwbUh4LXVKekc1cngweUN6NVZKdVRkOHBldFhOVGVBTjBKbjlFN0ZtTzZpcGotM1lEVGVNM0xtLUV5NlNFalVrQ0IxQnlvMWtzUGN2VFlxTlcycHY0QWJ6T0hCYjNucHlvQ1NxbFNCVXU3VGJrbjloRnZDMk8tQjg1NTRjSFZ5S3JmYy10dWh3b0RzTGxpSFM3ekdrMTlpN2ItLWMzTDZLMWNuYTNqSU9VSE5USi04NGhrVDV6T2JVUVRhQUo4WVJnMDVRVTd6OHF0RXB3alJ2b3ZxMjFtU3cyZWRsSmxhVkZhaUxpS3B2Y014c0VnclBja1l4aGdFMjVneS1oNFBGRS1DVll6TDM5NXBTRHpGSzk3dTYwQ1NVcFRWNWZ3ekdxZU5CTDdlMnh5TzBQczQ4cEFhSUJBU21adnhudWRPR2w1dkxsVVBaWmJMeU1HZ1BtX1lZSzdmcTZ6aFJSSHVWQVlJa3o1b2lmSjN6U0Z3c0szc0tGTVBSLTBTUWl2RElsZEo4eDQ2cXdFemxiRm93ZDVDM1hVcjBtZS1wNTFSMGt2QlZ1MW54NVhUSW93R1NfOFQ2Zjh4cV93b2VNYVVUS21VQ2RVRHBYMjd3Sy1tT0xrV0tGUGxkSDlMMUlBMTFwR1pWVUxKc1ZFdlpkLV9ydzliTjNZNDZWbUpyeV96Wl9vdW9DVGhGWFVrSFVQM09BNFIyM3ZlWlR6N3Q1NGh1SmxJcWNFUGw4dGlSWC1YdklvWjhPZkFvTlNfSHV4YmhVVXkxVWI3dGJsTWFxZTN6ckUwbVdaSFh2UDVTMEJVY1A5S3o5anhNakhTeGxsZUhTUG56QW5CcjhvZVcteWMwQk0tQUo5bUVSVnJyT3ZaUnpIdDduVy1Qek1CaHZia1pjVDA4dkpES25UWk1hV1hBQm9TeG5hUDVoc3lwa1FMbHlzaVowWWpsSVFYQzlnc1g5Z2pKaXFBWm1zWVJWT3dFUFBOejRkWnlGNWl1RW1CWGNpeTZIVUpxQUlZQUo2TEFEOTB0RG5zZlM0dnhjUU1tR09pVURHVW9wU0hjbWxyZlcwZUJxejlDcXJrVVFHc2lOMnctbkhQbU5GMnZ6TktrbGVDajNJYlpaaE51SnFrRHJreXVWVlR1NHFMS0pIcFRvYU43aHgwc21iMy1HQkhRZEo2N25iNS1PckViR3VBYkw0UC1XT294OXRmekM4Mk1WRUNWZFhKa0tPS29lR0szV083S2plbkp0WGJrd1ZzX08yQTRUUmJCbS1PV2tEOWZBMjVlRHlWMzBCcE5QN05IR3JqVDNWa244U2tCMXlPZ0J3NVZFdWVkZWNmeGZMSEtLb2xHSVRrQzFST0VsOHdLNjNidUF1M0xKZVF0NVBSSHJNNDE4NW1lekJFQURacDNKSW40R19KLVVoM0tibmNhXzVVcHNJUEJ1Tnk4ZWhmX1g1NGI4Q1FraU82YlFsTVBuOGx1ampXa0lXb243RnZQazZtekl6UXhBbjJZOWR6Z2RrNHFQS0FaZGdIZnNteDc3X0NuNUotWS1zVU81Snc3UnpJdmhDeU5Yc0I3cFgwT0tXa3VsZVRTTWhRRFVnNFZ2NE5scEQ0UWZpaXlFZm9ybjZCM0czWlNQZUZWOGtXYklXZ0JscFJCZnBXS1dXc1dRc3pwckx4Y0Z5WlBmd1lRcmNVcHJjbXZkQ0VkQjhETjlGZGRfZk1WVElRYWdVcHBmV25XaV9nVlkwUlhya1NQckpFd20yTEQ1VlFTbnZTNXBwV1BMWWEyWXI0bkg0V3lVbjYtLWFyV2lZWXRoRF9DVWV1a0FHa210NDg5blo4NW5xLVhQN0oyTXE4N3ZFemlaenl3NXUwQVc2MHQyNm1Ia2kxNzJDX1Z5UHpmbi0wQnMtZFlnRTlUenFIRG5ud1hyT1E5dzdwdm5meUtRbFZZZXdNazN5N3RDa0lzN0VTYmR4Q0RvZ29TQ1hfTVVRTmRiWDVMMFZxeVUzaWptUVJTeHlZUmZQcWJKdGp5cjFqOVZQeExnRGhlV2pUOVVYVmlJaHhUSTdLTXI0c0F2elpVZ1hEYlhLWHZMRnYwd19KU1BqSy05c3ZVZVFLeGdyWm9IYm1SeXU1MGZLbFozdEVhb2NaX0RXNkgzcmk0UFZVSlNaMEFiZEEzaUVCX0RrcW8wTmp1THhGSUd6NlQ4c2tveXVSX3dKSGozaHdQQzJHYmN4QUxRNzJwRTZ0MTRWMUlRX3M0MVptaXFvWE9LaTJMNXFLNHdkYXlELUV3X0NFLVNCeDQ4bk1kWVpqNzZEbW1pYWtiVUpDb2xjaFBQQ1JEUjBnWjM0VTFPTEF2dGpVc1JhYzRCXzdmamhQb3U4clF3Y3RMeU56S0Y1WGVmQXU3TlNnTmZyb2ZMNEJqNDJvR2dPa3dOV080ZDhiT2FZT3JyTVlDaG1tNlBvUFR4OWxiN1NoSXREZ0hldDBnNjYwSjZwa1dpdTMxQ1FwLTlQY3NsS09NRElvWERlMjI0cmxLSXZRT1ZlTTA1UXg5ZjJpRWRFbmdFUi11N2xlLTA4YkcxLTJCeHlvbzUyTFQ4N1BKUWRPbnJ0enl6WUFhTW5ZaEt5MWdYNk5QMTN0YVdwejF0bGs0Yy12eFN0RUJUZkpjTmZ0RUthUzJKYWt2SXNLcm9sRHBlTFBiTjQ4SEJGQmdGWEVZMmtRaks4V180MGxUaUdTUGxCWm5QUmUtNDk3MXh2SElvZkl5MEhWd29nRVRPQllYQTFhLXJKZmZ6amZ4dmRMV3lmQnV6TDNZb1ZrbDg3dFpUNTlva3dEV192WUUzNDdLOWRDUWZhSzYzb01yOXdsdlJzcGFkMElPb2hlOEtJNGkwbDRZbHdzV3dJS1FwTkJhQXZfejFhbXdEeWktSEtDVnRQSUdYenhpSjlKaUY3ajlnMERFdHJIa2QtYUxNcWpRejZ6NGtvM1J6V08zd3ZMNElHWWZ3QjUzbjlvTE5WSEx4WGg4Z21KLVdGOWtKSHBqZl83anlGYnRBR3hTdDBGazNrS3Q2bG1NWjhEUmRuOFVVVVZqSVZDZjQ1RGUxTHhLcWE2Q2QxS0dET2dRdmlnNG0wMThfUFBwemM0amQ4RlpkdGdpYWtRdzBRSFpYdko1NDRDbHZVN2laWUV6eVJoMjAzQkVOR05JaXUtNzdEeHA1Y2JZc3YyRzJLVkY0V3BEa3lrTGplOVREeC1RMHVCdlFUMWc1ZlgyRlVFemFWSzRfNmFIaVlDZDl0SU1ubG1YdWM0dlZEaWx1WFljdkhqcGw5QTNCeXZJWDVZaEhaRFFaSzNpcmMyNEVPTmE3VXVWSklIZFcxejExRDlUbGtuX0dtanFLWXAwMWxaNFh3ZG55S28zZ2NYVlpZZkRvMDhhaXFuOW1TaXBSTmkzcjk4MFNjZ0RKejZoSFFNT016dGVjUjFXNzBDNFpVbVJHWGVOdjZJSm1PV0taVWtONVVwLXkxYVBTQW54ZllBX3dxLUpMWDVpaE02SU1Va1p4QURSYUNPRnJEYkN1eXZyak43N0JUc1lFdkNGbXAxb0JkVDFVWF9ESFl0R0FuMkpBM3c5cFVsWFk2V0tsR1N3YW1KYlpTRENxdGhDYjZzcTduVzdjNlBwTnBaN0FXTG80T1c0MnBvcVNWMzY2VVROcWRiRjVha3ZheTFwRE9VZ0R3Mk55Y0N1endoZXRlSkFCU3VlaHhNSm5veXZjbnFEWEpkVkRlM0E0WXVLWGl6RzBuZElOZi1ZVVUtTUhYb3ZCSWpEZGVxYlFwZUtvTHJla1VEY3BWRWpabGpGMjhqRmhzbjRnN3gxQjZqV2pDTlVRY1YzZERuMVduREdaYjNxUkR0YTdWSDlkVWl3NTVCamt1dldjVFMtck10TjNrT21DNXRGT1M3NDRob3JRaWlWUmtIa1hnTEdXT3FrQ0kxZUpGZG1zcHNNTDRpbzVIY09GcEFIN3cuTXhLeUxlNjRHa3dhWDBkMWRubS1EVmZqUjNJM3EyS2xKYlBvNjJBVVJkbw" + "value": "ZXlKaGJHY2lPaUprYVhJaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJaXdpYTJsa0lqb2lZbUZqYTNWd0xYQnliM1JsWTNScGIyNHRhMlY1SW4wLi5pT2gyV2drNktEUjllRDU4Nk0wVTJ3LnBxdVUzYVMtcmJJNTh4anl0VnVWX2JCM1FyOS1GUnRUcHdqTEJiMXE1OVE5S2dCNEhhZlh1enB5Sl9Ha1JScmRkNjRLZG0tdlhxT1dKX0wzZkROejIxWmlKLVRGUzhlcWJDblE2SmJubmRqOGY4RXFQT3A4V0loZnhnRFZ6QWZxR3R5UUFEaHpadEpKX0xlOUJkV1pXMUhrbEFOT1NNN3EtQ2dDakVuclI1Z3FwU1l6Z2k5QmFCMnhQZEt3Q2U2NDBFaWk3RTljbU5XcEtOc0FxMXdRVUhPZDQtak5ESUV2aTBQdXA1QTlZa252NE9LaXRGVlJnZzRtVEU2aUZUeXA4a0J2XzJlVVcxa0c4U19Sd3pHOHM4M0NxTGZpWHlPaVlici14TXpmalc0R2J4MFNEVTNWblFXRk13cDg0MHh2eGxaRDBiYXRtRTBqQzVvdXlSemo5SVdfdVB3UU5TUE9oUFJQdDcxZEJFNk5sbjhiOU1kM3hMUldpc3haMlI4R0t5cV9nN3gxWHl3eXZXdDQyVmgzeG5JZkFXWElXWGR3Q1VMeEFacmdjb2EwQzhKU3diMHpzdDhMV1kweF9XZjRGSDRibnBWcHJQcXN6N2xVYkpQRkpSSVN5NEdEbi1WQ3I4b29qOXBoSmRkdHh5eUY1b3Jqdmt1Nnp1WmRWNWVzMm14YUNEY183YjZvMGhURVR6YmNGV3NVSklLOXBGMUw1dFV4MDRLRVo1MlRxMk1NZ0tnZXJSUkNWSWxQaW9kdVVpOXZpOXdYZXVtYjh2emo1Yk9vQ1lvbDNvTnBIdzVxLXRJbWVXWDJuYS13eEV1NDM1elBKZVp3LWZsSmdiRWpoeG95N0RRbm9tLVNWUTlBUjZUSkNXWjUyVjNaaWswdjNjRldUUWtDbUVPcDZnQU83TUQtZnB0b01pdFhXSzhKWjNCcE8tcWZvLXcwdU9yajVLVGFQOHlLN2VhR2hlYm93akhSYTJnSDZDUWdrUm4weFgxU2gwRFJ5U1ZTYzZxUUxkWTJiTGlFNEt2ZThybVhOWmNzVnpDaHhXYlhaYmxCaDVxdTljLUp3ZG5qekNWdWFyUFppNWNIM3ZtbEpvN1BZRXg1bzktVUE2ZFNycWZBbHp0SEdXc0ZuTVRSRUFRWGZtcjZRbFJHaHpTSDJ4NGdsaEFsRlFhU2pFWWpDcDd4OFJ1b2tiS1JTYm1HUDd6Y053aWEzTjZtTVF3SGtPWnM1cDhHa3VUbldsTU1lcWNYM1dNS282ajZLeU4zNi1PZENpYUNDSVM5UWpFNU1td3d0NEdvbFc1T1Z0N2R0dmNaSEpfS3dkaXBhWDgxUzZNb0syYXhxcnpEYmNTUkw2aGhlTVdUSWJxczhPeWw4RVNrWVF5UVVHckRtRFh5cERJT1lRQWdtSGVTRU1IbFpvdHhLWmdfb09ObjhrWWV3RWJkdmRvUmU5UjRtYk0xZkpkMEtpUy1mOGdHcC1WU0hPb3MyZDNBMGFRa3BHcjFUYk9IS0tZVFoycUdJcUY3SDVOZEdEdk1aanY4bGFETUQ1eFROZlVWc01FR1QzdTVnRGM5YW56SEJYb2RjaktlR0RUcE9nd1pXbzRhSGIySWVfSjZQTGpyYnFrbHhtUkxESUlmRzJwdEc4eUVpR2tVMDFINHJMbThDWmhJZmpNczhQUnRNYU5rYzk2SHhVNDNUSXVMUFQtU2FNVThzRC1mSjRrLW00c1dNMGl5VjVDM2NjeWQxeDQyUkJjNHF5eDZyNWhHQ09kckxuMTFjakRxSzRaT1lmV1FjbkhyWl9lektCSmRQNk1mcUtqdE1ucDRlQWxzUDU0amZianlJS3c1UGRaRVcyYS1qOW9lYnJ6eEphMXhTOWVOWFAyQno5enYweDRDN0gxUWVHcVU2QTJQWV8zRVpfWVF3RGJMaUxXSFppQlJVYm5ocnJwVzRwa0N3aFdYSXhBS0NkdXVFZWhIeFVOLTBDSkVKeVJ2b0FwTkR3ekRiY2haazd6RWdFQ0RndzBhbXVUUzNZS1JuT0VFdm5RejRRdlltN21hRDgxUFRNbGU1ZW9oN1R0eFNNZ1hjSHJFMUctTkxnYm44T1ZrRE5QZ002TjlRa3dKczd0aFlVcTk2MnpEUmt4c1NFUGozTTFxaENtcERDdzVZb1RoOF83R214dkI1bzJHMlVHTGc3eHJtb0hMXzRORjFYaUd3U1JWOVI4T2xDdXRzN054dFNTSWNxV1M3MWNVMTFMc2tONUpxUWZ3a21yWXRLSThTWGs2Njk5YzFTN0NHMHQyNHBBci1IZUxPZDUtWEpCT0hXMHFlUVlrYWpReGZFQnoxeG55SHkwS3A2N1ZBQmY5SzBzMFFpV29OSXplMzVLc2hmT0FlR2hDMUpoV09Nb3piU01raF8yOFlPQ1BUM1I4anpSWndUY19IZ2VlNVlkblFORzJBU3pzaFN1RWpzTWhXMkZfbnZ4dkVRZzZDRVBwRkY4bXZNelJyUDVTQldoSEZhRnl6Si1hTUlON1QtVlVjYUY1RS0tVFAxMERJeFBJZDRla2ZpZGZSczZydDZubVl0SjlEQjdrU2xKeE5yT3NWRFNFT0x4dnRueFA4MmpCSVNhOGJHZ3BVZ2dxSlVSTVIwdlJqdXhyS0trQzQ0N0FNb0Z1QTZkZXZZcjBhZ0wtMUdqalMzVEdMUUQ4R21iNVBVaFpfWi03ZmxFc1N5TFNfeVNuR3BMSGJTdUp5TDZyY3l1Z3JxX19mNTZHZzVSZ2VVVllpWjYwZGtWTUFZT3ZrWkVMU3hHLVNQNGJ5OGRUVEtxZkQwYUZuaDg0RU1mRnBzUWRtLVFXam5rZHNjR0JNbUJsaWtxY0RiT2d2TDk4ajZuUk5JRUF5TWhVN0Y5a2hRV2VudXV1djBRcXVtZXhOOE9lVml1Tk5PaVBObGRwdTRJRV9Ebms5SUFkTWZKRzJmcm94ZFBEcmd4R3NCazFVM1pOeDRZc3ZmQy1jY0VVZXFacGpJVU9Lck44dzFLLWxhME0xZERpOERNVW9QdUNsX1doeU12bEhPWk03TWp3YWJYcXBxVFFTZ2xwSjU3ZU9EdVZBai0yb0ctdlVIMkxEOXl6RjFrQUFrb0lVYWpzZkRQWV8xc3lpbEo5V255cFBjU3FfOXU3MElSczg3a05nMGV1b0hHS2I0QzhhN2hfWVhYSnNrNjFGcEZ6eWVQN2FMVjJiRF9SVWJMNG1mWExhcDZPY2ZGWmhtUE5Lc2ZNRGdIdkFDc2Rmd0s3R1JsUmZvTURIb0ljcXlsX09WYzNwbi14YXFYLXMzeHNyemJ3LUdCMXo2X285MWQtY2NQMkFXcmE3MVl1U1RTWmlnUFI4QjIzSlZBajNXS3VMNlNQdDRPNmdGa1NsaGJIdWVlZ0hxUzFXT29EUjQ1WU1Ic0RBUVE4dWo4US1weU9qWEJ1VWdRd3Zidmd5UTlvWk1Tbzl5dXBrNlZGMkZJaDgxWldCd0U4NGpTUWgxNUZNVzItSkZubXoyazJmaGVpN2ZKNTd1akpGRDdwNVFNeXBKZ3RWczJpSUI5Qm9XNGdxblNuS0RNNDZpMEJxc2YwWElVSlJDWE5CVThmRDJ2Vmg2dXJlRzV0TUsxQTVTS24zczBibzFzZVdTWkhWa3JXTWNfWmEzSnhvRndxd1lZbnZMV0laVmRDS2hhV3VfRWNRUlkzQ1JxbnBkcnB1Y2ZYNDI2MUlWNldtTGYzOUNnVkVZTThic0t4b1duUjZQNXIwV0tsM1h4YmFVZ2xEYjZxM2UyZVZvdnF6NHdVRjFCdU5OeFNicW4xWGIyUjBfcHNFTTdTOUVhVTRCbzdycjNaQkNxV0pLTGJ6d0FnWGt3UTBVNk5CUHl0aUlDTnpSZHhONi1LNXZ6a09LcHFOTlZzX0FScm04MUxHc0gweVAwTDF0anFPdlhvWXl3amxFdkVSWWZsdENVWHVpSExoV0xTWTYzU3c4MkZIbmhJZnRhbzV2XzhKa2JjcG5CbTBlWXVDN0JJWXBYWVVUaE5kaUNGUXpyTkxFd3NxVGlyTnlIb1JQdHZYbHhjUVV4N1BwajU4bVkyZUhTNzZJck1ncEpCWEdyVVdJUFp3M1pBWVNhT091TmFLWVQ2eV92U3VZRTVEa1d2dndvSFZkRVdQSW9xQ2toRzdIazhDeFZORVdWUDU3NkhGTUdyU0VlTmVabkxDWHNKbWlMQU5mU3JEYXFzMEdkYnBCU2FBODBNSHZPTi1tRmdsNDdBcm1rcWpLYXhlU09jZm0yb0h5QnZaRDBJdnZIUk10RkhTdGZ6RzdVRE9tR0hxQ1pLV2F1dkRVUDl4b0E5WDlTTVA4eEFreFJkU0dkNVo2VDZCN0tqOFMtelVJYkRlRWRrR1k0TzNUYmpFUFZyYTAwaFFYV1FReDJYcGNhM3BVUEI1eHdGbzhwNVRva1R3NFlHbVhvWVl3X0VvekZsVkVGVUdaTktMNkVtekJsVThCZllJQnZ2NkRCSnB1UlBZWWZaZzRRWTVBZlZrQXJ4dTczc2ZIaDVHdW54VkcxRUtWNlRvQlBoMkp5VVVWV3E4VllUTmhOeXhyTm5yRGtSMkdqTXVhZ2gzQVJUbWxHbk5SNzVKUHFoWHpBS09oNmgxTWR1Qm5scTk2OV9iUjZGSU9TQmYycFM5ODFKMHlKbkpkMzRrWWMwcDhhazFwc2Rqa0k5U3ZwbExLQ2otamJaa0pVR1lNY3R6RjBrMGljVXlCcVZaTHFaV1Bvc3RqQ0pqNjJfQThuRDE5Zmx5WVJiWDk2ZVo1VmNQaFdqQ21HZXFrMWZJVFgwZVlCWTRIVW1Dbk5IakFDT0QwMXdxak90RG5ENVBPR2lyaHlyZ05Wb1V0MnpMaTBmRmtlOU8xOWY4VmdxaTR3TmtwVWxWaDg3bkFvZFZ3UnVrN21VOWtTQktCUDh4bVgwTnJvTk1qVENPZ2haVmZaNzJsV0dkWGdXVWU5OFFYTzZLX2ZCc2tRbzY5VGxzYUNzdUVzbG5RTzlZNUVLRkd4MGo4blhoa1J5Y1BBOUpiX2dSUEg1Zk5ELVBnTk03Y2o1N0E1VFNfYmZGMTVTY1dvelVuYk44LVNCS3NLdEQzQi0wdk1Wd3FWcHFzVWNkTml0U1EwazZ3Ykk5WVhhd0R3SnptWkctTTRiZFhYcXJWZ2tmZGdjTmNJT2ZnQ0NTeW9jYTRIVWFXQVZUQmtfNGJueTRmYzB0R0taZ1IzM2sxc3NMT3U3QUowYTIyd0l2NHE1MGFyYVZtN2tVdlo0eklsdWpkYVBJeWo1NmJtUGJNcGRlZEI4Mzh6LWNCTzRPMXE0Rk5kWV9DVDBIVGpoTzEyVHRkejdaVXoyXzZsUkVvTDZ0UDFsem5XQVlKTHRqWkY4OGRFakwxS21BUGFRdTVLRnlaRTEtQWNDeGVFekJYVUR3UEVHbnduaEJrOGFDaWhOOS1YR1dTcjJrUjk0amcwY3lKV25lY0tNRG5QWWllVE8yS2xiZmpNcFhNc2FvSUQ5WkRJSk5DZ2w5QW0wWWN4cWx0d19RN2dVdjFqaXV3bVliRnI4QTgtMml1S3FiTFoyRzN2cGhVZ2cyYzhBQjVCUy1HU2hldGhuWEtPTHdkeEFVbm1OS1VNdUY0X1Q5UHJLa1hmdnBRZFN6MWJldHJrSDB4NmMzbjQ3d2V4M2x5U1UtUEEtUkRUZHc3Z0xmRHp1OXlDVDk5cXoxQmlDZ1kwYjJJdjRMb0lsN0x2djA0SU9SR3d1MDdoMXo2aHhkREh1M1BOaUlydFZvaXU0TGZqUVBjY2J1MzZiWDUxVjh3d3YwZDFweF9hVm9ubEhSd2R5NkpNQTU3VGRHT281QUNOdXBhMWlkaEQ0SFhHU1oyLWtlR0Mxc1VRd0JIbjktT0tRUUloWmhpUWotTF9VRDg2S2YyQWc1N2VIblAyb3RteFk3RHlXeE5Nd1pPZ09mY1BVRlVQZVRaTFNGb2s2QVI0WGN2U3FuLXJGaFVDNGpiVXpMTVEtVlg2TTN3R2NFZDFZY0VOZklsOWZvSHYwVzBOLTdsbS0tMjQxM3g0c3VpaEV3a3VHY2VnTmJjSUNZak1zRVdCYzFDSjFGUkVJS3hha3k3am9pMkNjeTcxRXlmenUzYTBNMkV0Zy13Z2t2UzVHdWpBcnFPM3hKbmV2emJISmcxYjNINDREeG9FWld6bXN0Ty1DSlFVaktpWUhnek8wamVYdU45OF9hTEJXc2xwN2M0RnRWVEpXclRvYW54WFpWVVl2V0d3SVNweW03TFEwSEpVa29LQ3FQLUhNZF9DUWxTRDJtSVRBSFdBN3lZT1dYM3ppMVJ2VUxOUFJnZTZJZ21vQzZ6alJnTUstRnB5YlpXVVoydDFFVER4TzAwcFFqekVBaGt3NHh3YWk3VVB3eU9qcUdFLTJGMjlfSksxNWVNRDVkRlR0X1Q3SEQ2bGJFQXFUak92TVpkb0xOS0tfQmdRa0I0Sjk4UGpheGdxcVhRTS1KSjZoYzM1WGpUcVBhckRwdnoyNVNBSTFrYzR3SUoycDNLb1dMZXRtUWlxQzhSTGtsZjhHc3MtR25YTjhDa282S2pUM3ZTdUZNWlNSSHdNeVQ4T2ZVdWYzcnczZ2Rsc0MyeUZXbTgzRlZRd0tNTFBPTTBsRm1SdkxIOHFpSWNUM2tTbGhXRmtsdThub1VOYXd5dkZsdkhOcHBSdGNSWFFKVFNWTkNvV3ZSZlVwZ2xwd3FmcVJxNDUwaWc1dFRFcFVGQTZ1RnI1cGM1NUF4UW5JSTVnaE9ma3Y4cG1XX3JEUFdGYnROY3VXUEM3NG1TOHNfQno4dUlNNWxKMHJQbWJkZDMteW9nU0xweERkSzlWMWh3LXpscnZnRldkU3FwVnJ1TTFMbkI0elk3NE0tVGd0Nlk1MUp5R3FGblMzZDExb2lyT045OW1BN254cEVHaGp1clk1U1RyRzdEWWJHUGJTQThHODk4Sm5OM25QUkJGNmdHUjNxVTZwRHRFUS1ZUV9SWDlDRTZRemZXRVEtcS1haXBoaGhOTkU2SGtuUE1HR0RJOF81ZVFGMGl4UEVJNjVfWE9rTFZjbnAwRE5vWi1pUnJhSGJCUFk1eWpueFFNR3preWpROW5iNnVkWVQ5N2RGTVNXaVRaMmpRWnMyXzhOQTZIS2VHdWNnalFGMERhdmdDbFo4cWxTZlhseW9rM0JKMjJweFA0bERaWUxIeFNhV2ZFREg4cTdfY0EyVHZ5NUJ3UkRzZ1RJS0R5S2g3NVltTUlZdXFnRGFIVnhxM0doNnJUUEp1M2J5U1hzMVpZSEplQjdfdkJkelJNZTJXUy1MNmJWVkEweG5Ic1F0R0xyTWM0UmNnZG1kZmhickFIc0xZRUc0QVlnNEJhdjh5cklySF85bE9xZXlJaVpmMWQ3T1dhY3ZWejFna0JJZzE0TmFYWnljTG9yazN0M3R4R0pwSVFrM1Y3dXJiSnlhNVhjNTdsb21oRHRxTVRZZkMxMmp2TlllOFI0MzZ5X0kyTlQ4UjdMQTVCRWt2T3BTVTdhajR1TUhwVk9kdzZSNUxGaWhKSk9NT0kzVm1FMUtkSElhQVl1VVEtMkROcnVTNnhfbDJuRWpfTFZ5YWp6aFlyUzc2ZE50UUtlOUE2RjV1VlF0ampEUDF6cGY4Zmg2MDBsWXRTMHUxeF81aEFwRzdCWllqRk9KbjNaNEd0TDJsOXRUaHhqOGt1X3VDbkhJeHg5UzBlUVlNQmQwUzhzbWFWaDF0c0E1a2VsNmR2djlFWFZ2TUlOS2NEZ0g4N1FDMnFvRmJWWERGVHNDX0VzSFVkVEZ4M3VhbkJ3ajI0WmU3UjJVX2E4VVEydVNOaWNvOWJkNnJZNU5uTUl6V2VEdHZqdzdHXzV1SjU3VDNraTRFQ2ZQazFBRGZDY05TeTRsNHlsQU5CMG1iLWV0M3dISExXZVBsLVRJYWJyWnhmaVhYWVVRTGxKSVVBNkpGTk0zMW5CUzF6a2JOS3N0N2t4SVZGb2ctbHcwbFQ4bnk5TXNLTERvcGh0SnM3c2JER0RMY1AzN3BKOEc4Ry1NLVI3VXgxbFpUY3h0dDlxUzBMNU5wcWJzM2RFM1ZVSEFBWjNoNnE3dnFyQ21DNzVkWllEb3NJelgxYUk3MUtfNE1pdjl5UkF1ZFY5V3UwWjNuODBjcTBfMTkyVTk2cUR0MzNFY3hFbHZ2d1REMVNqc0N4cTlSaXo1X2VLbzlZMTB0UXVwTHFNNGkxVnZYOHZSMlpQUzZfZWo3d0U2MXJ6QjJXSmcyemFyRTlnSnBNNlg0SjlYZ3kxTHRHa3JZY0NENDhMTGlzN3hCak5DbmkzTjI4blhaUllWTFlvcU4zZ3VkR2FzOE5kWENVdDhkLWRKSXdaZ0d2WEhlek5wVHptWUd0ZmNYb0ZJXzhvbVJYcURRWXlxclpRZ1BVT1N0SUQzVEpwYWlKRnRBTFNPbmxSSzg2aGtuQVhwRzhoeG1rRnRGTjlBdGMyRDVObnE1NERqVk9Bb2VtRlRSSlZuVGUyS1hTUUtwNG5UemZySUVnYi0zX05QTXVPWktoelRxQnM2TE01aDdVUXVLZzNIX0YwVXhXRXRFVHJQVjRmQ201T056d0tKTW1yOWRYb281dnBTN0REU2hHMXNFcTk4X0xYUnRiQjBubVU3bU5jM3BFRkZZcTZoMngwX2dIY1hNLXZJQV9Jczh0UzRLc1RIUkd3ZTdTQkhxTm5oVy1xQ1YxeGw3T3RCNWs1SlZoaklBNDJZbC00elBWS1lzXzZobGhNOThRNF9iS0VNRDh4RklMWnFPOXQyaXQzNURNN2VJZkd5ZmxQQjV5VVNEdjBacGRfb3lIVmxxWXJUUHRNMVZzQ0VrbHQwekctSXBLNlVZbTlvLWpBZV94R1NHQjNNeG5SREhyb0Mwa3QyZk5MSWV2S1h4dlNyeTJqYlRFcWR6alFtZDNaMEhsTFBrcE5oUUpERGxOUElPeGRORVE5M29PSGkydV9ETGtydG9BNi1XNFJzYk14UHRvRlVJTlZVVlF3SFR6aW9STU5CWTlpT2gzWEVXbFFMWXEwa1R6c1Z3N3FtOFJ2VDFBQmloVHlvNkxzVG5LaW41QWZleWxmbEt1VF9zOGUtenlfZXU1NzBOaEs0S0dFOFk1OS03TGJHV0toR0dIbG4wQlBaLXk5WHVBdmNncUJKRkppWEJubHhjS3Ricm44U3JlR3pDOEEtMllWbEpkYVl6TzN1VXVlZHZMRGJ2WXBCcjZZODhnTXgyemFxUUVULURleUk4Y3NTNmQ0RFppcEpuUlNfN1ZhSXJsX0hyRXFUVVN3aUFJeDNIYkdUOGlKb1k0QzVPRFRQWVpVWFJibHo5N1Bxa0R6ZzQ2WHhKWWFDZ3h3bUY3R3F4RXNzQnRTNG8xdEdKb29lcHBZT2pwbjBXWmdCU1F2eDhZUzBfSFRMMjRLQ01jaE04cTU3bmx2ZWxZbUdlcVBNOFg0cWx0cnFEUG9way10d1E1amowZnpKOFdxZWZJVlpUMUR0ZEpkT2xzS2E0blhueWNNd0tFM0ZMZklUaXVCUFp4eHdPYU5GLWxUQi0ybkxOTkpWazJNMjBpeEtrYVZ3b1Nia2J0dW8wZFR4X05qZHFGQVNXTTJSY3NYWkV6aDU1NWJnVGVFVThKay1zaXZTdmVUaGp0NGdfMTBmUFRhWEFJalRrSmZKaEZ6OTRIQmdOd2lOSU1pbkFHN2V6bkgyUm5pRkNjYmREOUVkSllRbUxXcExmREd2OHFHQ0xPbk9sb3BCMV9Odkg2bklScmlCNzRJamdyN2hwbkwxN2RORkwzRWpnelo4UlltWUxzby03UnVXSGlLRmpkZGZzOW53SExkY3ZrS1RJRU40LW5yYXZfY0VzekppczEtQ1B1a3VkN1g5ZE1GRVBscjlseUNEZmwybmVUUk5tQmx3MkEzQmZDOVBaOWpEUmxTRGhUNTJhSWxrc3NPcE8zdXJoSnlVbTRJLVhnV2pMLXFHY3pzd2trR1llRWJ2WlpYSllIMnVhNVR3cl9vbU1oOVZGNUdVTXBmZjV6SlVlYUd5cVc2ZVR6dUJTcDU4Qm9NODBnVHRsN3FaZ0NKX1ZNOHlPcTV2UWFraV9BN1lucnZQTDBnQ0tLZ1YxWUNVdmNjNHRvMV80MTM0dGxXRjEwS1hnWE90aEVKVU5sT1JuOFVHUnNadHRkSlBwVGtQWVVjY1dEeWVIanE4YjNTMHRwQVlROFhPQjBaX0tzNUtrT292d3UxTE1pbmxCYnpCb2plZmJhZTc2R0swX0o5amV5UFhLbGtIRllYQ245dmFVXzJBSVpHU29rdk8yMDVWNGIzVmYxay1IVkxuSUFRRGR3MXBucU1kU3YwaEdqa0diNjNvSEZkN2FoWmRNNUVMNDhhVVhTdXJ6R3FubEdMakZZWkREWlVJdzZTeTZ2SEFTNUhfNV9OM1VMdExiMUUzNTZjTlpHYmFJNWZhTERneFExRUw4OTgxWkZ1X3VKNC0yQWlDM1Zsc1JPanNpc1JaeGpHOUJfMlJ3Q1NLd3dneTFLUjdPbXBYZl9WMmVBdFEzV1U4VnVwalZZU1hDWVhUcWwxSUFVYUpmZUJOcDVwdHM0OTNuQXVvNzBlQ0h5YS1rT2FhRHZ0Z2k2WExJWEtYc1BJRHQ5am00WDN2My1aTm0yeUJ6b0RwdFhuN1lEeUxSa2VLaGZVOXNSeEVZTmhUbU9VRlhsQXdvTnJqeldla2gzX2tzM0dWQWFqUjhaZTQ0V21lMy1RbkU3OHBSMDFXSWd1cWVzNmdialBHNmxnQkxrQXVUbllzci1QZlpJcWd1aDV5ZC1EVm1mN1ZSWldDOEUza2VpaURYaWRHZVRRcm5Qb2hrZEVwX0pzY21PdGprb1JibS1xclRYWFBjZXdBY1ZGaW1VNnJHV3hSUmI0cklwZG1ReTJOQkItaGxLUmNFNjE0cDdHUHF2bWZLcDJPYUFxUjd4R2wxRUk5WkdsbUdkZzFtd250aFBWZ0t2M2dQLURRNDM0RFhocnNkLUNDaG1ENmpraGdwSVd3Rm85YmlZMDVmM3REWmlQVkk3ZlhTMkVfb0FweGxtMzdIWl9iOHROY2xUSWdSdTZBaXlhb3RTNURDNXFnRVhfQTB0TGtMT3YzdjIwZTRjbUNnZW1IdHc2U3o5dGliV3Z5T0NXcHVuRWl6WkRERHlKMUFFb2h1SHp4LUNLVEdKUkctWHlrQk5EZ01Mb1kzaXVuQlpYeFdTQlk1MDN5Y2RiUERYNUVJbnNJRC1BY2NwdHM5bWxHejRkOTQ4dHlQMlhveTZRMHVfT3RyblpsWFJMdU1MaU5EVmt1RUFTczJ0RkZHZEg2cXRfWVF0c1BJN0hpWWZCSTFUQUVudUZVQ20wX1dRNXdKNlBxczVSLUJjeFJEcnRCY29UTERkNzVhcWVrTXNwUnFsSlZZZ0FpQ0Q0M3FHMEpOYXp5LWRMLUdNOElGbFZVWnRqSlQ1TWh3MHNub0JLNjJwcTBEM0VMTEVMOUFfTTdtU1VYOVVFcGhSVDhJdGNxRmlkVnpISDJqb2RfZFEwRlhDM3BhandPLVNpd0pvSzNHN3Q0UTJDRjFJOWJibkJiLTZjektabFBMenU4cWhsWGU1SldUTjhOVm51Y05jUUh5cmJIMGd3MEMtOV81TkZvUlhicHZ5OXhFZVUzdzFqbUQtWldiTkhmMnFsbGtxZjFleEdScEFXeFZQeWx3clkyM25hYzJpUnFZMFZUcGNsdmt6VVNaZDlnbjdVVjdhcE42eVdrTkNBNTdpbGJlWWlaZVBMdVZTLWgyTDRycjhYbE0tOEQxeDcwSm9JUXE5MWNWOW4wdFVVc3NHTDZOWkItZVdQSXJBQnpqb1ZfU0FfNkh3RkQ2Tl9DSmVGZF8zZGdGLVV2VF9xMkVBU2JEeWFnOEplUDJoVzNBNlo0NlRhOHo0RWdmalZDQldEWGd5Y2o5bUlFUnd4UWFpYXpvS3NZcW5fSjZNY1RtaW05OTZwTUhxVUFKY3dPa3d2ZURyakZZQ2MwSnRFeVd1ckJIMVlYeVVaT2JHNVlENjg3RU9CTkxzNHpzY1diTENzcUNaN3BWNG5hVE9vekVqdWhWVXZGZmR0cVppdkpQT01PS0NSQUNjM2htOUhHSTdmMEdBOGdibGpHVnQzZGpRR2NMTmk1d1V3Q0ZJVFl6RE5SM05fZ2wtNjY5Y3lYejN2NklfMngtOTN5M2Jzcno5T3pwUnU3bTNsNzhOV2ZGbVgyQ1lZc3B1T3hoVUVLUUwzdTAzWlRvajQwVUExeG1hUWFraXBUd0huczV4TmpRNVduMzRjdEdWbFdWSlRHV1kwYU5COTlzSk9CV1RwNDZFVGFvWEJ1QVNvdjFaSjBrOTdvSEZhT3piOEtyWTVnWWExRy1ubWM3c0tHa0x2ZS03REh3aFNkRjlLeTgwTTE3c2JRVjVPck5ZdkZhem91OEZFUFlGY20xZWxZT0VhcHBwbExsYjhIZUNFajF1Umh0aWprZklLTUhzU3d3bjZmeElaMjBhYU53al8zQXdSNjBjX0VuTk1zQUZxdkloMHZUYUdMZUROX1V5dVpBOTEyTHZld3EzM0lzSGNwOXVfbGxIQ1BzTm1HRVlxNlBvbG9oLVY5OHRQQmFjekNmUkw1QnFzM2IxNy0zRzNnbHBUZkNycjhzTDBINW5JcTZQRzd6SmtuelREMjYxT0w5NlhKelpNY0RyWmxGVDZzVjA5c05DUW8tRTFSaGh4S1ZzMnoxZWllM2ItMm9Hd2V1ZThlQ29kam82OUw3a3o0YUhBUHJVNWlPWjc2ZzA4WF9GNzVmVUtpNDhzY1BMRWJ3WkxMMVBrX08yc0RHdzhtYy1pWDlzeGdtM3pJYVlBSGk1LWlmdGl0c3pNVExWYS1LS3EwbzFKS24wLXBVbHhhdGo4RGxqMFZNWUJjV3dzZVQyUDZYSEVUTkFZN0hHd2gwZWZQU3FTbHNmNXdHTk5BRmZvNFJ1WWJqU2YzUGE4b2VNZmdsbWF4WUlpSHp6b3ZWNnlyUnpST3pYOUVVSFl3c0twaHhRR0NFbVNOanBGaVpXUm5BU0hvMUZmRWw1akNlVmZzRWF1VWxlbTdSdzdRbmJMbXJBZG9rOXVwVy1vbGtHUzhYMW9MM09Wa2p5amVDcnctV09pTGtHbTltZlBmZ2NITzVQWmV0OFUyRS1ETlZHM3ZKVml3WmJBQ25YYmhKekdXY0RwbHdOUm1xVFJkYWxwNTFER3Q5Y3J3enAwN05wdkFZS0RCTk4xazRnWjk0SU9Cdm1yaFRza29rZW5XdVdraURvQkRkNnZ1cjZUWThUZXI4eVhkLUJxZllBRVlSbzl3SUM4dU90M1hfMjgya0dQTTVLZHdPNS15aldCcHZWS1FKb056RzhuYVoxQXR2S2FKV1h3amNTS1VlQTJCQzNac2M4THQyMll6NFktb2NnQWVGQUVRQTJMQ2pFa05JLUFSWWxZSDU4Z29RbDZfZ0ZKOXJIN29HR0pCNmxlS3FKRU95OHc1S2loZlZIZm5fNHdRMm1HNGVkd3h6emVYOTFyRE9qdjQ0NkgwWjVGQlFic2ttOFhHTmRkVV91TERmTnVPbU5XMmpKTDhzWmN0RFVVZmhhMmhwQkJOajk5RmVHcWNZZEN5QlBhNTVkOGh6SFpSSFc0cDdxMENZQWFuS09oQlE1Z1lWYjE3RDNTeE9WTmZrcjlHVk5xZkpMYW5memZKU2lPN19jRFRlbFZUdUhKT3ZFSml4MmtIcTk4V2NENmVxRUtjMHZ4NndXMnlLNEF2dWRjSERTNjVPb0gxMjJqSTZkdmpoR1hXZnZRc1VGUDlBbGVGbE1oVGpybVY5d29UMnZXMW5RUHA2QjdNZnFOSVFBMEZESHlNM3lJdE1vUlkxT2dhX3hzd0xFZWtTWE1PWkNKbXYzVEV3NjNQQVoxdlU1VnJBMDZBUnd3cE1weGNram5OaFozWmZxZ0FtZTBlY1NMZGRQVkd5WGdEQnZDSnlfaWZNLV9ESi1xTm5jd1pjRW8tdnZmbTNDMzExZm1XcFFXSkV6S0t6ZHhRWEQ0WVowZ2FORUsxWE1zRXJ6eDFrMWswVng1RmNUOVM1SllVV1V1djBJWEVzamlncVVxTEo3dHFjRkpLa2tNNlAxV0ZnU3BnRV9JNk14YWN4QjFQSmZncGUxRHRwaGIxVHI2aDhiSi1zOTNLejNxanBNWnh5ZzU2Y2oyZUQ1SVd1MngzbUhNRzViSnhPVUJxbkJWeTEwN1NvdGx0bUpRZDJJWHFtNy1Vd0lIdHFDVm4ydXNRbWZyOTl6MUR0QTRRRDRyc0t5bzkzT0JpVklVQ2xMMVU4aFVBX0YtZWctaVh4UXl4OWZlLV83QlVhYUFhWGpVZncwX19KeklyOFV4V0NCS1k2ZEJLeWVUaEdKVWtpUDVUMkYxSFloNXc1UHRXVlljM3dxNzNjYUdXMVNDVzdRLUpIRXJSOXFuc3AtenBnMDNHeWxSRmFOaWlSMWQ1bFEtUjRNM1ZKalFvYVhWWmVBRlFZalpGakxYUjBMX1dOcFVkRHZ0aDZNMER5S1FwVllDWnV2MzhwdGREY2VxRUxiZTFsQm9wUGQ3YmlEbEVoVUZveHEwU3B1LVBYNEpGN25oendjaXh5YzktMnEwTk96WURnWDNXYnhLWGt0X1Jfak5FWndDSGZUYVlaUnRnUHZlemlDWHRfNUVUTlI4QzVpTm5EQ0V5X0NROFdvVUpDMzd0QlVqWmtpcE01U0VqQlZ2OVItb0ZmM1FGVkpiTkk5WVNtQ2pKWVV1Z3h2ODN0Vk9FVWhHdkxaem5hTjlWWVhXdGpQSXNzbEJ3V0hfMVBBN3F3cGlhc0VKd09keFI3RDlZdEdBWmFLdkNZaWZsc3BGQlBMNXFid05iSnQ4VFlZRHVHNzdUTFAwYVN1Rm50QVhKcU16RlhlbWR1eG9FZ2dUWUh3clNnbXNBb2d4UVg3UHEyYWhDb2I1cnFFTjFJcVlxandPTkw4eXFsS21CZ1Y2YVhjZ2dRUDREa3h1OVh0R3JBOGViaTlhMEFrdlNHb2g4RTRXdXg1OTRuaEVMdks5RjdqRGZ5NW9nZzFKNHItMm9mUjRPaFBDQXJtMC04b3JtenktbXYtdkZsa2ZEbkpKLWI2Q1VGOWdNbzEwaVNld1NualBBdWNGNUlQSEhkUHhtUkJMWi1lb2V2elBvUUJiZXF2RUdLbjlFSmIyUVpzeExJVXhpTkJuOUh1V1FtemhZQzVhZGJYdVFpNWxXUDJCXy1tUW5HejdPTkdOWFZpTl9xaFJIbDRsTXVuZXh2VVFMQzhxLXBQU3dTcGM1NmJRR2ljMnBQamJYRzVUWlFYeS02QVNqaG50TDViM0VwWkZQZjZ6cG9ydmxISm8xamR0SXAyaDd4WTVxVDU3S3pLZGxpc1NfUFhHMEFYTWVXd1RRY0lvVXVJSmowUmdHSUtJb2VXVHNHZklveE1vYWJ6OGdnQV9DSTRncmVmci1tb0k3TG8tang1OUl2OGtlNXl0S0lSODJHcWg5dkZROHJtRWdVeF9Ia1hnUDduVVdKaWNaTENjejA3aVlmVXRzT3RkMDlEaEZ3M0E0UFlmRzdLaFFoay01OXRjaFk4M1QyLUJ6UndyQ0RXRlB4Y3lSVlpLZnpMTjJIdmVMMUVweC00UWIwNWhFWTcxcGhISTlSZkg3T1lrc0ZFWjdMdVNUZ0ZFLWIzNlJXdVpyTWw1NjVxZ1hDSDdUVFlYa2NpQUFLOTRnd2dyWTJtSW9wX2FETjd2RWJHU2tsSjlmQVl1Q0VtVTBBc2IxVXJIYmxsUzhJWFprenlCRkNfY25UbHRGZHM2eDBYa3FCc3MxTl9lYzlNeHVnd3VkMEdoQWlyZDJoRnRjWXhHYUptX1F0dW5ORWhETDdwcE9FXzQ3ek5FWGVXUmlmSVVfandjdXllek1yZGxkVWxmcnJoUFVVY2RLMWZnSzdmRzFJOGJEWk5TRzgxWGdKdkhveXlCSC1OYVVXWjhhZDJoRjc5dlF1WHo2bnkzb056Ml9MMVpuY01KQ1dJZFBFTlM2S1BSbXl3QWNDWWs3SEFWN3Z5R243Q2w5ZURJZzE0MFlWaEtQcGZTRG42dGY0bnhmb3dkZTNiSVRUQ202Y0FWZE1Tbk4yWEozc1h4dGVTLUNHTGJaLXppVlFLV0hISVJzZVZGOU1yTkxFQmpaWkNTbV81MXBLc3duUTFHTmwwSEZVdmJaM3lRNlBUZldjX2tXbGtoVURoQzByRXNjQmZxbmdMc0I5dU1SQ05QZEtYYldxOVZMbU1rVWg3djZLTlZNM2JjYlV3WENNM3pvMUtRX0JndGdUMzdVUERTR3hwN2tvdVhlaVpHV3pBM1ZGU3N4RmtycWNjZ2VqM3ZjdDE0Uzl4QTVUUlk2RE5hUjk1ckpXU0dVRnF1Unpiek91WjNhek1tdFJwTV9vaUVHWS1Zbmo0MjRha0E5TmFDQnczWGVHVFl2ME1iWGVnYVdJYnFyclBxUGNJMjVDOVdONUYtRTlIZ0J4THJxcXdmMjdaRTRmSlNFc1dGM1ByN0k1MHZscXNLZ1JwMUp6QjVnUXVQWklzOXFZOWZsUjNjUHhhaGNTaFdIZnRkaVZQd3dFZXJIbk54UjRkNm0zamVhd2NjNXNPX09NR1BaeEU3OU9peE05R0tEY0pyR0c3UEhHNzNOUlBHR2pLa29NenI2RndTVG1ST3VBQmdvOXdXZUo3Tkw0YURIMkI2a0hYWUpOUDBHMU52S0FtcFdUN21SR3pPY0x6Y01JQTVXQVZRZ2RNNjFxS0pGOU1iMGd6WW9Oc0d3YldiTUtwMVdfc0xuSktDVGhHMk1jWFlPeWZJelNRUUhOVTdQWDkwRDVtSjc4V1hhdG5ZeXpmdE4zeDczbGhyN1g1UjY3NmZuY0F5N2VDb21OMW5FR041QVVqVktTM2FhN29qQ0FIbVlxc1dOZ2pQeVdYT2NJamhsQUtNdXdhMF80X2ZZOHR1MnI2V0dLb3F0dWUwTWJHNUpqUTdnZ1JBcmk2dENWcVNObXU4YXRGSmQ5ai1WSzVrNVBWbUdBNG1kSEo2bUh3Y0NvMWhaR0RFUFhYQndzY1hQZ3ZsQkhqUC1XNmI5aDR2ZU44b1JMTkxZWEFzOFJqUFNKc3AzVEg1b1V5NGg5Y1JMRDFxSm9Na0ptNWdVNEN0UXpTdWNYQVI3RGJfbnRoNnplWG5PUTFrZl9McDhHV25GZVNlc1RsWUZmaFFTZEh0NzUwNE5fRjJSZWx5SGtOcWxJaVk5OUZoTE0xTnFIcktvLWpiWW1MZ3RHME9HYjhrRTFfX1NnUGNFWmExQzhYTC1lbE1QTVBoNjhHTVFORnM4UlktdnFnT2lpMW9NY3dVV3UybFcxN3FIN20xeEFrOHRmZm56eWxOMU5WbkRkVUhSVTQyWndVZ3FscjhtMTBEUG1aVFJtaEdwVmVJalhEbC1KNF9nT2h3bWNzdzJSWDhndWlLdWRNdk9WYVRkOW1HWkREVThHX1dPb1ZSbzlES0VObklLc1FUR2JKb0t6RXVTOXpqMU03eUhBT3c0NVdjajNuNVFNREpLNnVZVURLczlLa1owNzlvR0I2NXpQRjBwX3Z6Z0otUWtSQ19adEJRX1hfamZzaUNncXdBUE1tbGhpaVNkS2E4T1hqNkRjdnhERGVSeXptWmN3RXowbDFWN0RTZzZ3YVZ5X1FEc19keVNyZmVwc3pMd1ZxVmlDZkJKM0M2YlJmNlZDWE10dUZRWTlPRzFBQkNyRlRTMW11VlM1NnVBRjktSnRxM09LZFVHZ1J4dVBZdERWc2xqS3lKQnZ1RHEtd3BYNXZXYmwwVHpkOTZjZ3RLTm1lVngycndBMEJGYTZPN0h2Nl9abjk1ZUlRN1Y0R0Z5NkI1eVZYTGFPYVB0MzFfellkdDhUSUJPVmhKTVpqYkVUU2tZaTRLaEVhLXlMemdPSk03TF84SVg2Q3dvMWZCZ3NMeEpnRW9Yd0pXRjNvWk90LW9GOTlHMXhFRWRSbVBPSlJjODd0WmdjM0QwMGZ1WHpPRWo2RUwzNi1RVTRVVUk4WUlaX3Q0bWttLTE0Z0FQZ2V3WlFVWjhCRXVmUGJ5YVBxLU53YXJ4Z1hFS1BtNG5PSWsxeDRLZXR2R3drdlBOTnBrQU01UTBWWWZETVc1cHNGMTlYMG9xTVAydlo1dDRUbTJtRzFleENVYmZWNUZBOURvb3JxUUZNZjNrRW41VzFSbmNyd0pxR2NrTERSOHVfT0c1YUczeWZ0QW9ZbVJHQW94YnBoMGRUN3lrUTVmSm9OS01Fa21XcllGM2k5Vm1CMkdXc0lIWTh5OXlSWlpiVEVtUHdOSW5xWlJhdXlYUHloS0ozSEdmSXJzeF84eVczU3hHWWpVb21UeHN1c2JmT3FFZnlkYUNJVkRHcENCZ0RaNkc1S3lZeHZfWndBcHpRLWJpUGNFSWw5aFpMSV9rM0lJQ2dMVUxEOS12YlNGQWR1cDRfd2plS3dyVTFLcWlwcVVrbFRNeU54dm4tRDVscWVoUXZ3cG14SmI3NHlsdzhvR2RlMlFlWFFwWGxucjNXUHozLVNlZk5zT1NTSkw2ZXFmaXZJbGloODgwYWtwU3lhRjdjc3hQc24yc1pfQnVWcVVrdmVIUUNFelJIWi1LOW5Yb2VQWS1fUF85YnJ4TDVXOGw3RnJ6U25UaUp2akp5LUVIZnNuaTRKVWRTUXRreUNWM1RXV1ExM0dDb3hGODVrYWJJUDBla1NSNXhQMVhDM1hxY2FQdU5QNzNBLVlBLVh4dEFnX2ZYMjVGcTBRazVXeEVjMEN2NE5VVzdiS003QWd5SUxxNlFXd2xOUTNNZl9PM3Y0Q3gyN3BfMzV1djFkSVRLamRvNUJsZFFlRlhlQkt2QzNacXVIaFM0YUNnb0dUdGU0Z3BUM2xmRlpZSVZLZlNpT0RJTDFybU02NV92RHBjNGRWbF9aRkxNczJqejZWajQ1bUMzZVBpTDNPekJBN3ZzWEN3dnZaVFdGbWR0SlpmNGdkWksxRWRtOFA4SXZIRkpJc1JDV0cyZThyd3hjb09DV0tXdFZCc19wODZRRXJIdDlLeDRaQ0lnUVpFR1Z5eUNERkxmbENqeHhPakhvdXlKTGxfYU9hUUNQc1N1WExaVWktNlZOdTA3Wk10U2FLU1BHbk9VVmE1aUsyMF9iaXFFbVVXSnlHMWtLQ2pvNzJPR0RjVGQ3aDYyYW9ZdVotZi05VW1mOXc4TVBwRlJ4NWpuRWJaX0VtazUzS2k1U0VvbGNzaFJDR3Q1MzktdEZvby1kYXY3MnVKbHR6LWtNVWh2dG90dG5Dc19fdGdtbTRIeTUwWDlUb2N6d1hBODV5Y1hNUmdUT1pVRnlOUFN3aDcwa3dvYlBoSEdSS0hVcXpQSXozcmZGcVRyN0hwY3Jqb1F1V1o3QW13OXAxUXBrTEpGMzRpcHRvZEF4dmw4ZkRkb1JGMGZ0MzRIMXJTUk5VX2c0RlhOTC14amJVVUlmNWt3RURXclFRLVl0Q2gtMXlHSnNiZ3ZqdmlPRktLNVJob0hjY2JXbkNnX2M5OUdwV2ZoQXNySGE3Vi1kT05ndEN5SzVoYmdFa2p1X0E5b2VLZHNHOW1wQTFsdU90TVJmZlRmbmN5Z09hVm9kT0d4cHQyUzBJN09kYVZfX1NwRlVvQ183N2Q0MndyM0NRUnlub3YzbkEzblpqYUdNSUVkTjl4b3VNRTZSaXdyUDF3VFJoTXZyX25RZDI4a2p5bFktUkFyU3pVd2hDcFc3M1dRQVd4dDBlUkxCUFRXYmNrQVVtdnp2Nld2S3B5SDJsZkNmLUtsX01tWGVveTNlOGRSSXQ1Y3dBdFBKa0RYTFEtWnRHdTBiREd1cG9HZW1MOHcxcUp0Z3NFTzRMTFkxdVFKM3hiR2Jfd093cWlPZEdpeFVna3RKOVJGUmppWVVyYzVINE5hakFNRkFCQnRaZktTZF80TkE1dTl5Wm8zTE9lSTNxMjlUVnNpaTZQS2VQZzZMN3MyVTBsZFBnU0Jud0xta1FfWjJoeWtsTzJyUWY2MVhsd3Y4QlFRekRQZGtxY3VhMV9YNDlOXy1QbzBYM0tqSWhLNWdwdlNHVlN1Ynd5VjNzbXJqNm15dEdWVWE4WEFxaVJSZ3VaU09scG40QzEyNlZ1MVR0NkJod0xhWThpUWhab2dabnhXVkNQZVBHVTgydnA5cXkzcFFGZmo4SFVOVkZyMTRjNUc0aU1xLWxNc2E2SFlHVlFrTHRoSXkyNFBTeTNfVzhTOUx4M2s5LXgzR0t2c05MQkE3Rkg2UmptSlRXX21STGhYLUt1SDZNTExvLVB2RHNWYjlBclp4NW5uVEtUQVBzaG5XSTZNck9nOUJ2WkdVVHh6ODlwV0JnRGRDUFRiQmFVQUYyRE1kRWh4eFFHLWFzT0t3Q0QxYlY5M2xGbWN0dFBObW85cFc5WU16VjEtdnVQMUkxbXpyY1FXRERDTTI2NmRDWUREbVctcHZzTHh3T0xaZ3pReVc1dXpMenZrVVFLc1U3WDhONXIzZVJLMTlld2Z1T0N3RnJvVld0WkdqLUxiSjFSX3RQSDYzbmJmbm9LdWRITlZWMmtMMTJvWlZBVmxjeG1XR1B5Wnp3LUpqSUdGREI5VGtfSEtaenBQQ1RFeS1fMHFEUzFWTG9vcE8ydE1JcUh6RFhqbGRJLVFSUUhSSy10VTlIM0x6eUFhR0dHc2RlbWc4UG1DM3RNTHAyZWNVbjFNRkZuS3o2WThuSThVbVFJeXVFN0NzSmM3aHJlM1Vzejk0alVyRHAxTDFLQlB6WHFvN093UzFkTXBSdFNXMmtfLS1fZ3dMOWxOWUFIQ1luTlB5VWgwYkU5cmxsbktzaVZMOFd3dWdNWmZTdF9jVTRuQnhhVVhXZVpmc2RDSHQ2NFdtdGtCT01ZdWU3SHVzRE41enQ2UnJTa3ZSRjNuNTJsSUJkVlE2cHo0ZkM5T0ZJTmtlNnppV1VNRmdJdVlJOUxETHhnbjBmR29YamJLYUJlT3NPUWV1YWJoX3JpV2FuWmwtOEtYS202djhVZzJPRlp4MFFDZ3M0cU1OOUIyNXZDQVhZc3I5X0o2enRLUnhpamswX3pMSDlldnBNY1NsZ0JmZ3RKaXRQT2RSUWo1TnBDMmIzUUtXNTZ5cDIxS05ZVE1JaXdveTUta2ktVFRfU2FRbW9UYUU0SVlPcjZoODZZNU1ZS1hPazZMSUIzdExlaFhSUXhNZzdXSWpzWDZOVS1tNlBsQjVtdEo2bWt4SHlyNmszcnFBUmNhcXJsSkQ4RDE4MFJwa3BtbVlQWGFWWEpnQkN5ZGE4Z2Z1aEVaelY5TWFUVmFOeHJnV1pwbUpjTE9zcXYzTVBnR2JhcXN3OWtyQ1Q5dGZadURfT0hWek15MzkxVzh2NmdTR0NRU3EtbkNBLUhDU3A1S1VMR1pmZ1hRSm5fVFlZVFVETkxLQS15enItQmM0SXpzUkl5WjhuV00zZnZFVXcxSEdOUlJOZ0IwMTRoeGhzT3NzSmNvaDBaOHBTRjJsNVUyaS1SbjRjZENlTllXS3MyTFNENGM5VWtnSnlpU2Rra1hudmlzQjZzaF9TQmszLV91Vk5rQXFuTDVielhTVnMwSEFiTG1EVnFyVHExVzlnWHA5N3d3UE40QnJXOVdaaGpaYVFaZ0Z4NUh1VnZGTjVUUGd4bDl5bHBnbHguY2hVZVAzMjhCY1ZrSkxyaVluTjMtOEZ4cEVUX2pZMmpYOThLdlVDMVljOA" } }, { @@ -145,19 +144,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "34cfa248-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "92" + "x-ms-request-id": "9924de10-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "80" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, - "deletedDate": 1637185325, + "deletedDate": 1640018453, "key": { "e": "AQAB", "key_ops": [ @@ -168,12 +167,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295", - "scheduledPurgeDate": 1637790125 + "scheduledPurgeDate": 1640623253 } }, { @@ -199,22 +198,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "34e82df4-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "36" + "x-ms-request-id": "993b5c08-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "39" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, - "deletedDate": 1637185325, + "deletedDate": 1640018453, "key": { "e": "AQAB", "key_ops": [ @@ -225,12 +224,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295", - "scheduledPurgeDate": 1637790125 + "scheduledPurgeDate": 1640623253 } }, { @@ -256,22 +255,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "34f838a2-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "30" + "x-ms-request-id": "994ba554-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "41" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, - "deletedDate": 1637185325, + "deletedDate": 1640018453, "key": { "e": "AQAB", "key_ops": [ @@ -282,12 +281,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295", - "scheduledPurgeDate": 1637790125 + "scheduledPurgeDate": 1640623253 } }, { @@ -315,8 +314,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "350727fe-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "97" + "x-ms-request-id": "995d75f4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "111" }, "ResponseBody": null }, @@ -343,14 +342,14 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", - "x-ms-request-id": "3520452c-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "17" + "x-ms-build-version": "1.0.20211206-1-be739728-develop", + "x-ms-request-id": "99791a5c-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "15" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295 (Activity ID: 3520452c-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295 (Activity ID: 99791a5c-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -377,14 +376,14 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", - "x-ms-request-id": "352d2c9c-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "30" + "x-ms-build-version": "1.0.20211206-1-be739728-develop", + "x-ms-request-id": "998589f4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "31" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295 (Activity ID: 352d2c9c-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295 (Activity ID: 998589f4-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -399,12 +398,12 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "Content-Length": "22010", + "Content-Length": "22066", "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": { - "value": "ZXlKaGJHY2lPaUprYVhJaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJaXdpYTJsa0lqb2lZbUZqYTNWd0xYQnliM1JsWTNScGIyNHRhMlY1SW4wLi5veVNlTzdOeklyRTNsS2R0ZVl2enhRLm92Q1JqX3J3UWVnMVQ2RGhfejFhRXRfRzRkVndaYnZyOUNrMEZfVUs1Qy1RZk4xdEx2TUlQamFhR1p0ak5tYUdPaldwVi1JUlM5bHgwYkRDYWV3b2tGZlhOeVVsLW05UzZYRFNKZnN5cFZ5azRCbXNiWlhhMDl6RUxWbTY4VXhKNm1EUkx2U19fcDZBU1laQTAxS0lMLXp2Ynk1WHotRFZPTFFKZ2dGMHI1ZmZySFVtb1Q1eWhqaWZYTTVmRUdjSGxpc0ZYcVl0SzZLZ0JGbjk3NTF6RENpY2xjeFhYdTVLV3pVbGdGWldsWGlrT0doR290QngwaXhMZFRxTElpdmNxMXZ5U0Vka09JeC1ocUVEaGtIRllJVVVHSV9DdW41bXFxVDhrRzZlNjBwWDZHVHo3cXVqNll4X1hBVEZ1SVpHX2s2SnF5Um9aTXlScFc0VHFaTlpvNXliTk4tTHdRd1g1dlNKRWlIZ1JsQXZMRldQZU8xWEQ5SXJqVVBPbU83LWdiTm1OYldFX1FUSEx5bW0zNlVNNEFweDVPTEliZllUbmVtTm5ObTlqX2FwMC0zeVpGdW1WQlNiY29IMnV6NDBSMnFmOW9JcDdnSUVsdnZXNFh0c0p3WnQtTFJwUk9JVUtsLWZQMk15Nnl2ak9ZZkpWa0h0YXNWZGJ2dFUwOVd2OEpWbnVfU1BIR1dJWjZ6eUtuQmtSSDNwdU5CTFNaM2Rld3BjQ1NfNXI0QjhZU3pVWjJIRExUNGFlWXhpZG9DZjNwRlpyT0hyNzR1dTJ6dVRiUmFsSC12N1lPOFN5TlhxcW1tRjkyb3FvQUo2QldjOXRYQXlITTlUYjh2ODNKanhoc203T1FxUkhkSXBxTE91RERTak0zeWFqX1BzR0RLeVo4eWJ1MWZ2LVlfb0NMNTBocWZWdERLT0xKNkFwZWR1X0lhbld4cFRKbDdCQ1hKLW80M2tRT21pTGJiTEJ3X3YtY2M0a2E0YUFsQlhCdG5PUFh0SVVjZlhranhhbVZGSjhKSUpmSHRibjkyUFFRUDBTekNmVWdwMUZ3dk9xX3NNUF9lUldpSDd1ckpyQUh3TTFnSmhXNlBOU1lBd0RGSFltc3cxalg5MnJrNVBEYlhidzhmVU9mdi1aT3Jva2pIRjZRaW5fZkRHbm9nZExJM2RzZVpVU0dETVN1WUh3dm1hZmRDM1FUcGVCTFduc1FRUTFiSVhlSVQ2MmFLR3hlYTZTLTFnYlQ3VE9GZjh6V2hFVlV1NlcxcDVqYU9JQnh5STlVb0o1Z0c1amhJYjZNS2dqMkl1TlRHVGZjclNoSU9rdmx5TWRVX3hBUDlHS3FkSWxwNEFfeFpRYzBSbzN4SUlvcmNlejR6Z1NCeUVDaExQUkgyNTNXbUxsZjlBaFVacVdWUmNicWFzTTB6blRYR1FyRnI2akxTUmEtZm91UFpyWHJkSWRGRnFwQVNYejJlLWhfQUxUa2ExY3pBMjNXM2RQMkFRSVVfZkdUZk44WjhfazNxbXRocEM4X01jZHdPMVlVTDFBOGVtRHowSVVRN1hKeG11S1NtOGF0bjd3VzF0eWRjM3BPTjN5UFJTa2l1TXZSMklqRzhMMl81cFZ4WEFJQVl2aGRKd1lCWHlyWk9QV2lVekxtajlSa0hOZ2J3Z0xGY3llNFlzaGo1cW5haTEzZGRGTmJEYkZBQXZ4aF9ZOWFTRE9kaXRLZm9zcVBFMXVhdWdUbjVSVHFnbXpKeHNlcV9rVFFZVG1PX0wxZXFwd2tfY2VocXhFT2ptRVBiUlZCVWtERlBzazhjTERlT2VEN1VPanp6TmNiUlhmY1VrSXpBbDVlWTd0SVpIU0d6TGNMTUFzLXRld3JCVUM0RjJoRlRzLXRpMGViQkZVN0M0SkJKQlNKTkpmWHZ0cHY0SXE2dEZxamN6dUh6dFM5RGhQS1pGZmd6bEpQOTRwcGk4RDJQWXVaLWVtYlFfc2wxU2FPU2thcEFtOVh6UkdVYkpQeVlTMWJnV2thZjA2dlhXbXJ1WnR0T2tDRkNxYkVmNmZZY1NKU3JTcjhzOGJKb0lwbWVhWHJ4RFVPZ245ekh2MktnSEVWNHhyejJ6SU9QZ3F6V2JqX0VmZWZ0M0ZhYU9rWDM1Q2tlRks2T1JhczZreXJOaGNjN3h2Zzl1S1V5Vjh6cHRHUjdfVkpwYUtDVUMzUzRoOFJ1aDVjWVRieTZYbWJQNkFEYWJHRVlVVTlxNUVNSGVTT2VaMEthejRVR0h3TFV0UXpBMURaM0g4UzBSRkF4aXZsZXBJNk54STVYUFBKVDAwNEtvbGNRcGt6NXI3ZWk1VFVkMno1cldqRHo0dTdQYkR5eUxxV2gxNmlQMTFwM2RuQmRLSWVUYVdGSHJ3WWhEdm5FTjdGNzBXdG0tTWs1Y0tOY21oUW1OVkJpZGJtaXhIWXhaTFh1X3NaVl9mS0RmMkZ3V2tTZmY2dWlvN0t0eW1ua3ZZakw5cVc3MkdaTVNESkY3R3dOY1k1OWtEYmlxZWVhNFFiQVFVWm4ya2l2MGlKM2FTS2JSR0s0cmpvYjdmX29JS3Q3R2NjX0p4R2RsRk5KWDA5ck9EYjl3aGJwMy1QM0R3LS15WUtGUms4d1h2Xy1PQWNpcHQ5WFdocC1TMldwT1BnMlRpdDllSWlRZW0tOVdrVl9jczF0UGhCdkJoU08zV1ItWHo4ZFBTTG9malY2MDc4NzdaSmpDZVk3VEJTd1p0VFpncERITjQ0VmRFLXkxZXFWS2ZuZVQtY2VZdUJPbXJEMFhMbTFLbDh6VmM2a1J0LUJNZTM3RDltRFlnWTkxa04tUDFtOXBFRWNlY3VZQ21wOTBfaXdocEQ0c2o5WlM5UVJJUGUzMWl3NVpNM2ZCalJtUlZtdUF5MmJKWFM3d09ZSXl6VXJLUFZfclc0SUQ4VmdJRlpOTFl4LVlFUUt1Q3BDWDJUMl9wYUdwa3ZjMzVKaXB6aFlSSXJTWGVaUWFoZXFXdG9rck0xTzJ3Tk1vS1FwV0VZbS11MHRxVG5jRXNwVDBwQm5Ja1pRdkJmbXZoeVdhd2ZudmY2Nm5MOTJ4WnBndzRRVzhfd1FseUl0RzhsT0NYb2tJTlg3eVh3UGs3QTNMVm0wTnZPT3lPbERvY3l3b05wNjRiaHVYZE5BS3NtRnNGZHFfWGZfMUM5bXV2c2ZFR05nM0t1ZjNfNXJHNG1yQUZuR29sRGRXakRfQW5BSkxYYmQ1OFh5SUdOTGhINU9IOVZfM0w1amhleV9rb1lnd0xTb1l0QVZ5NmRMckVCYmpoRE5Gcm5RcVEyNWYyNUxTcWhUWlRVZ1R6UjB3UzlZR2hDWkhRN3FtRnNPZUdwTU9ySUZvNzZOMXBvckVlYzlzaTQ5S3VNNkg3YlJUbXZTWklRXzAxUERaZE1mWXlwZkhHeGNEQnlYOXRLbGlkNWh3SWp2WFIwYlhRWDdSRVNZZmdXeFhhaGs2MjRRcE01LUdYVHY1eGJUWlcwVmZ3cVRGTS1GTFJJbXgyc2xhMEJ4ZG5FdnIzTFNxVVFUaEZDRWhlQl92WTJUZ2tmRDhYMlRUdWNJOS1EcG5OUWhBVjNuMElZR2JnZ3pRTEF1UFhMT0dLRkRCSUNRY1Nnamc0OHk4SmlaRXJaalJMcVdCUGpMU0k0cHBuaXlES3NOc2o4eGdIWTh2aUR2alRpZlRqV2RmUGNZR3BJak91TVhUaVhkNEtoMktaNGFocFBfcHE1UTlHQXd3MndGYmk5eWZKRDdQNTc1b0lyY3pQTjJBZUJFNkV6dURTakkyQWY0MUZGaTZ5WW43WGZRcmV2MDRsZFNlSTJCc3pXeUZrQ01INVZBYy1sUC1fZnVNUjlFRnVOQS1SSG9RTVJtTzMweFZITzZqNzltVzRldVg2cVk0eVU4QXdMU3YtdHRnLW9RWkRKX1NMQ3dzTVB2elVXaGpFVUVlWUJWVkVDRkdCaWFYZ2xWQzZ2cTVOWlA5ekZCeEh3R1h4NndlVmZoN0J6ZUE1YkxvWTBXMk9oQ1AzbUo0cEZ5ZjJRXzRFSXZOalNicGo2WGRYZGZQV1g5amRfamNrSWRtWmhLeHhCVDdDRnRaT29ZN05kUVFxOFRkZWNyNzA5SEZMX2hpUzFJZGVTc0lFME9KbnJnVDY1MFYzN1k0ZnlYb01YMHJCcEtlRnloUzlCZnBXRkRfRUVMc05qT01rUXVocS1KVU41WjQ5MWlGbWt6SnNmckszM2JzUnA3eVBhZzlKUk9NanVsVW5IVWdIVlduVDg1MGhQQTYxc05XWmRZb2xzbUdFQWN6RU1hUnZ2NDJkekVyeS1HSDhXenc5MFE5ay1WOHFBbUxQLWZqQ2I4RFA0ZlhoakJ5Y0F1S3ZSRFFMWDh6aDI2dXEwTGRYTmxFUG1NUnlxZnlBeGhOS3FvZy1LaGQwWFlXYkR6eXlnR2JteGNwem1qN1pvc0VUdURMNUZib0NOQUpXSklmTFgtTXpWRUdJVGFTdVNnSm9wVGpEYjdhZUJfQVNqZWg5aURmenFSOTN5R1BjVllSVXZZc19zXzVYQWRqNzRMS3VjbnhIckMwcXdySnhjdEJ2VUVhcDJnSkpRUHBfQkpBSVZyODg3UEM2b2lqdUlQcFpQb1YwZVpQQkhfWFpDR1BwZ1ItZVl6ZE93a1N6NjNZdUpKQTROVE1KdWtCOXNRSUQzNFN1RGRrbW9iNFVRZlo4aXN6UVU1MUF6SllJdlAyVTFVQkRhQjBweFZoNVQ5T0pGX0l2bFRHSmp3djlTT3M5SzM3alJLN3JmVERCU0lnQUxYZG1NU1BLaWI3LXZoUUt5M1FxOE9oaXFHX2l4Z0JGVVowanVCbzZuYmFUUjJERWYwNS1sV1RkWkJxWEs5ZWFyczJYeXQ4V0VnTlpHTFY3N0E3MmtUV1hxQl9zVFhrTk1yQlNJdWg2SmdMaXRtNXpmUk5xSlVJV1ZOUDI4M0E5czdxRTFKYUlGcTBGbTZpdDZPaXFHV1gtTEZqbE9LYV9mTkZBOC1FdHB3QndHU25tTUVaYmpESXRONDYxUEs5MUJBZml0VWRPX3lpZGRua2kzR3hySWY0RTZpLWhGMUZmUlV6ZkwzMGRiN2FtOUU2djI0ZkpMZGJzdjZ0OVRlbHJrUzRNOGxQM1pjclZpaUxteUVLUk9rV0QwUU9zMWVjZWNOVXpVTG13WHRrY281bDVKSVJ1cEpEY1dxNjZKUHJ0YVY4QVptVkoydTRhcUUxM2hEbWVyVzFkWUt5QjZmTV9ldkhJVmJfcXhoVjFqMHRMNTZvM0pvcFhEUXRjU3g4c3VEVzlmTC1QWnZXcmx6ZEN1aWR5a09mdkRwZTZ1NWQ2U203cHhIN3VhejVrTkRvblN3Z25wRDhnenF2VDFSTUlJNUxpR1lLQll6SjFwV1lwY2U1eUhHUlhYeEtGYzJLa0FRMmlTSl9KS2VDVEpqdUJnVlFaa0tXNzNfM1kwUlpVVkVqWkRVajV3S1NUeDZ4SFYtTENtVUlvenZsWVRCLVpZbDF3RHJNUDdsclJrNV9sU2UtbVF4Yy1Rd1l5bjNsSFc1eWhXT0lkZjF5c3JJV2dKeWFHWnBqNUp5R19YcTRacmo4LW81ZUR4VGYxc1hLSWJBNGliQkxZSExOSV9JLUdVX1U2blZzN1pMUWtaZGVNX2x3N0toNElSRTFLRml0VmM2eThsU3NpVFhXOHFqckxaRDR0ZlFYXzhYenZhS09OMVYyT296dkhQTlJ3b09qMmcyNW9tMWd0WWk2R1V1SzlnS0dPeUdfNUhKaElORFhFYlQ3bDdrcnFZLW5BcjFqeDVCcFdwMW1nTTlpTWRxQWVEZVJxZzJLZTI3VWFmdTN2eS1XbUJGeHhsSm1iZGI1WlhrOHlCbUdtMnMzUkNtQUk5MEVhQlF1VHYwX1pDQmFteWtRTEtQaUYzUTNNNnduZllzSXljamxaT1NzNDFocjJ2bDVxQVdvUWx5cklLMGszWFlUeExrOWZvMHhWVk5pdklaOHpaa2V2U29QaEl4ckVsS0FUdXA4UFYxNllwMTR2ZTlUN1pwZ3FISFdwbHcwWUVYamo4R1MwclNDcUN6aG9OWmZycDdaWFVERjhTZHAyWWFYMExUbDdxTUZiLWo2VXZHZmlLVnk2ODY1cWV5YXJTSnMtSmVscUwtTGZVUmo1Tktody04MjM2eHRRWVhIZ2J1TWZPeldxdkxHVGJmWGk3YUNrOXRCMkRqT3N1cG1HVkxuZW42cDlaZERsQXlMTWhISUMzQnhxSk1nYk1uZ29kT0FXa05LMmtzRmJKbE9Kby1hd0huU1VtU0pEaTF6MUI0RV9lQ21ra25lTEdaTFQ3TWlISHdOaTlhODdZVFU0ekZrRlR0Q2FERkE2RlRrQlpsOWNfTjVuYWtadDJiRW1tY1lYNWZJQzBJRkJQRVF5V254RFhVcHJFenN4ZEhiRjBEQVVaUV9pV0dRYjZhWFNGcmdtN0JlM2lnTnZNR3F1N0gyS21uTmd4S2V0NE9rNUt2UllzcXctSllPLUFXVWFLSV9TaktYQlNnS0c1dDg3SEVMMDNLa3dJbGVpb1l0bFhob0s0QXRyekpYcEppanpSS0ljZDNBZ2xMYkxfQjJ0XzVjTzY3clMyV0dUZmtSR3RabGFOTG4yZWV0X0J3Y0ozcS0taGd3eDhFOW90Vml2WlZ0SkN1Q2pIb2FOaEtFWXpMcTdJTngwemI3QWlmcGwwaU40RGlabFNHYTRVOHNVUHVnaDc5bzh4WThYMXBodDd4ZzdzeEZkcVJiTktQZFU0bDBKaVU3TkU0U016enVLUjFhR0YtZzdJM2J0czBuRUNYYkcybVd1d2psQkZXRmRNcXp6cVVnSlJFUkxzcG5kTUNaRHNYRUpaTUI0S0xVdW95YzRybkQxbnVZRkozQ2NjMXkzSF9sSXBuU09Pa3o2RE1JcV9jMWZOMkREZ2VmaVNOUmNQbGZ3dHlLVjZ4LUhLSkt1SDFBWlE0bmI0cjRWZGQ4Z0xJZmpjaGVVdzh1UlFMVGhPZURWdTJCUVhJcDM4V1JuaGJiRUszVm8yMkFqUTJlSXJOMGhVdkRqSXFwS0NnNWxBQzNMMzNYc1ZYbkg4RXZGT1hpNzdyNjM1VXFnWDZOc2ZiaXlRNXpyWmd0Z1B3TFdHUUN5MXgzRVMxWlY4VjlhMlU2SFBWclNmbEpTaGRvZHpQMnRweGptR1Fmdy1tbFJxUDRHR0thMjU1RS12TTk1Q3lvaUtXeldhbXBNXzl6Z05tWFpxaEVGWXpTSjFVamszNTdZenJMQjZvaXhtS3JXSVdWS1hPM0R4SnpqR1YyNm1wYVB5WHhCcFVqWWxaT0ZvcDVPVzlEWWRocTk3ZXMyVTNlM0xPLTlweGV5RVN2dHZEUnZybnJNSWtTT3FTQmo2WUI5S1Zqai1RV3Btak9hb1N5WDJSZURwaEwwS256QTdIbTJVRGlkenZHZ18wRUxDaDNURFE2OHRwS21xRXhiaFlCd0o3SjJhZEVoaFE3RVdiaGZRc0w2V3lMTUNEY1FEOWZ1OFFlcEV0bFVPd0NZTXJKTy0ydEZvNWFEVUtSVFlzeXRRcnlWRzhvOTRmOGhtdDFRNUhaTjhWQXZGTk5lRzNOWExmbXEyRHdhNmVQNWxFY2FDRE5UUW02emRwWTU0TmZ4enQzQk05TElrajh6R1hfaW04ZlBfQ0ZNcnlqV3Y4SW03NVVkaEdVdUMyQzRiNXVVVVd6TGJiUXdOQlNrdFRQZ2R4NGZ5LUxlakdhb2hJVnNmeERSZktLTDJmUVVhWWNqc0JjYlB5Q1k4dWo2c0U3VldqVXJ2Vlo0aVItbnRIOWNXTnhKQWpEV3VJZ3ZGMHhRNkkyNFQwbV9YSkEwa1J3eGhSUmIxNzNxSnp2NHFtSUhCWUd3OUxXOWlpd09udGotUWNocEtfakVWV3hoX2steFMzdWlCWDJZblIxTnp3X1RpdVRCTklfeVNyU1lNRHNlZ1E5bVROaDZWeS1LUUs3SUZGbEdSblNEUTRDbngwa1gzNG1LMEVWelpwRkVodmptTVF3RG4waXpaRnozeGRmN1VwNUZ2Y0F0M0p5WW4wdUJIeXVzTHY1dXlZRVA0TE1yOGdwTFQ2ODRGVkxoS19FSHUtSVQ5VWtJakZYdEltaVFTNnBjVGNkc2c4OEg1cVVmSFVzSnZjM1BQQ1VaOE90RHpfVWlWbEdONVEyVUlQMEs1a0ZWR2FGRjZmUjJIaHlPQS1RVDJ2dlZKTkhoaUl2MnVCTTNyMXhoTEY0dzFJNWwteUFJM0pSZEZkMlB0VTRoTS16MnZNajREM1BjTkZxR2szZWd5MDZFQjJBWkVSMDY5QXZfOUFVMElpMUxvd1lkRENUYUJMc0F1bEw4X2x5Q0pKZGpfNHVJNnkxamk0STEwWFJMWUJEWVoxOUpmVFBJLXF3Q0ExM0JPQ0FqLXF6N2dtUWYzWlVjamtDZjZfQUVlTGduamxjdnVjZjRrM0lkamNMeDNWUnJtZ3JBSkp0MVhobGt3bFotNnlEVUM1dDFyMnYtSnYya0FpMDBYUWROZ29xbE5XaHdRZ3E0SFFXT3FkODUzMXB1Zkt2Z1M3RjZaRlhtWXNZVzNjZnI4azRUQWpzVlhZVFUweEVPajQtYzhYeVlhTHJMZTh0OG1lYU9IbDEtc00xNEYzN1VPOGVGOW8wcGVEN010akF2WTkycnMzSkM2VnZMNEdhM0FvMzA1SmEtT0M4dEFXWXlUQkxhTHY4cmNXQ3pIYTNyN21SbV9RZmxmWTh0eHJlTUh5eE9CSXFLMnU3eER2U3NzSGpqN1NsREYzeWlhWjlGV1VNZlQ5ZkVpalQzdDFublluT01Fa3RXYUJnRTdxWnYxWmhlZ0NoYnRCUHZlX0JHY0UxVnNJU0ZRRG1hcV9CN0M2MGFISXQ5WDVWX05JT2N6SC1rN215ZEwyRldVQzRiRWE4RVhkVktWTnFjMHlsdzQ2dHc0Nk9ITEY4V2ViNFRvVWNsdXkwbS1JSERHaExpOFhQeXBoaG1aT1ByazBXMVE2aVFNREtRaVZhOUsxX1RMVmFTREhEbFB3eTIyZFFwRjBiYl9pX1BhTXNhZkplcGUyendLWWJOdTNlV243d2l5Z2NUd1ZRdmVuTnVhQ2pxVXlXZ2ZQTXUwWDREMWVkSFJibm9NYi10SmhWYmlWY1ZNYjVWcmduSmxLb0tNdWNSWTRzU0lMVTdpVWpFM1hXV0hBTDVBTkhlcUhSRVFsSUIxNUhtaG14a2tWU1BuTm41RmpraHowdnVJM1o0MTlxUncyVVNmNjNqT196NjQ0UnMyUzdpTDM3Mkl2dl9saFVoUTVfSnRMYjN0UFZsN0xBVThMbm1WMS13UGR5OWUwYTluSkxEMDVJTzVLQkRlOUJQd0E1YzJwMy1Tc0pVR2QxVEVSQnR1bkU1V2hVU21pZFNsZWpaWHY2ZzNGOFMwbEg5Z3lsZFdSTzVBRG9FUWs2LVhmcTVPZm0zTFNlSFk0d2tjVnVPS3F1OElfRDVVa1M3WVQ0ZF9pSXpSX1pmV0V6Mk9XTGZWYi1fYWZic2RINS16eEl4T0lUbHVrMkpyMlVLMWhWblRBRGVyTkRfVjRoNVI3Y3RYVnVIU1BxdV94QkZRRXZ6eGN0Y1lLdGVFVDFMbXBOeld4eV82aFdJTFJNS0VUUGNIeWFlVFMyYjViSG9WMVdGTndzSlBfN2NzY1YySHN4d3RWdDcwdGxxWmFuY1VWVnlRUFN6RGZPM0tZd3c3M2ViOHY5dzZNN3hEUjNLMVhadWNnMEFoLS1nM0pZeW9LYU50QzZfZDFUVFB1Mzl0bzhsdDRKQnk5bmwyam5TS0hYWk5CWHdQOFFnNXNDM0NUb0dxbkdGd1VjS1JaYnc5OW52OXhLYzR2SGF0b24wcEc0MVF1UGdvM0Z0R0F1WnQxLUdublF0YkNDX0RYME1ndUdVNmNQR0NxVGFPOEJQNEI4TWJ0VVlZZmVqamcyNV9hY1NoNjdyWExJenZSVVMyR3BIbjNCV1Y3VkxQSk5hR2dvblNzQnR0eGtKZkxSNzVOM0VUUGNQNkY1cWt3cVFIUXpYenpVVXdsZTk4cjYtOW9RZkRrTDh4TGsweGxMT050LTN0THpwSmFWLWpuVjBUUG1fMXg4MWZYSUV4cFljN1VYZmxoZkVzakpiTWttRVNNX1ozMVpxYXIzbVFxMmJVT2YxcEk2YkFhalhhTVhlSmREM1pTcnJyWkFSZGZsWkFXNXJRV2ZMTGlVNV83SzdzTm1Fck9fTEl4NnJVdmFmYzlFajdBVUtpMmxBT1pBOURmcklZc3RkVXhWYkQ3cldiMUhXNjFYR0tobDlhWjE5WTJQclNtU1FJYzNCNjdPNWhKRTctWl9aa1dSWHJfTTdXdmFKbG0xUlhZNVMySUNWWE1SV2pOdUpfOEcwOEV5aDM0dEwzaTA2V2J0cE9jUkdvWVBnLXMtX2l4Y3ZCU21DcmNmU2U5LWhVajZIMngxV2puUFFlT1lMY1FXWUZwTmR2eXdnMjh3Wk5vOEJPNUt4amt4dlBMWklvZVVpVU5ZaHBnSVdjQk1fZWpGdmRDTUtCWWloanYtWDNJS3FfUGtZcDBMR0RGUEU2aHV6UlRnbERsa0hFcENYOHhOYW8xUmRkWng1UFVoakNDQ1BOYmR1elEydk50QlFaSTdmeTBxY2J5dlRhQ2c5SGNsanBQbEJyTTliZ1FTSGdWRUpVQ2hXNUJqSHVhQVN2dUFMMHpNZWxCV2hzblFHQjRhX0ZpOFFld3lNQXVEUXlHOU16WjVyRzlmVDFHUDBqMUJuRk15WXJObnpWZDRJZlNteXl2RTZzSC1DbmJuZXprWURmNGVzWGpTTi1hMlozMFVybHc2OWxKRXNRUk1RUHJhQ3ExVno0TFlETjJBM296NGsza2NEbE9YQXMyVDB4eXJiWXMwdDdrenNHQlNqT3hBUldNU01ZRml1WmxOZlhpUWJ0V3AxWXlXcEhNRzV6NkJ3Z2JSYTA0VV9ibGI2OXhuNk0wMWM2dTV1U1l4OGQxVG5rU0NGUklYX0VfZXJuRGRyWEtvU2lsclNZdUsyNXVSU3NxREJlQVdmVmY3QVc4VlgwM0I1X1hQa0xqY2UwNXc2aFd4MlhWNTJ5WmhpMTFQaXVaWGZlXzczZjVYc3hMdk9OVm1PeXZLNWF4cmdwejFTVkJJR0JhWkQ0R2RSaE5DUG40OG5FWU9LM29rX0FiVjNCcTNkNVRXSzJxZDQ5elBDYmE2U0p0UUgtU2JqcnBHT2NMcE9RMTBfMm9vVHoyV3lWbF9BWHhDTnBqbGI3RC1SZ01RTEM3TWY5S1Z1cGpNSVMyTUUxY3ZPN3E4TUFoSHVuRThTc1dXWGNLc09YekNpVHNtV002WnJFUS00bEUxalZ3UWZDSVczLTh6RmlhbnZ1Sm5QOEFYZWhuU3JRMkhwWjNCbFdaYjJiOUliejBsaFU1MlEza0RvLVlZak92WGNRbUxtZGVXTkN5QzJyN2I4c0E5OWZBeHlHSGNpQ0M0T2RtU1QwX05yekVwc2VBc2dqTDdGZm43Zld5aGtjN0ZhdzZ5c295SDhPMzVNamRRNHZXN0RZaXJ1djk1N2VpcWxqX2hqanFNRmRZVm1TZlVwMVhCeG1ncUxWbXU5ZGZWcEFTNExsVlJ1b1g0NTY5eW9SNzJ1X1BpMzdZbDUyYV9pXzlWTjV3MkJneURjNFRuM2d0YlI3Y1lRZGN4WDFqNUk2N1ZpV204aXk0Z25zRlczTGhWTVBsOFlRbTBub09Ob3loc2hzYUFGbW5mcXNnekdkUzRoaUNUQktCRWJoaWZXcFJjVVppX0VieHRCbjA1ODBXVkJBM3JuZEg2TExGa0VMWFpGYTNmaVNSWWFVT2RmbUZibU1WNU9adVYtekkwTU1kMjRYbEtEMFcxWXh6NXJUd3FoU21KZDRrcjk0Q2tDbXRKT29XbFVVbWZWc3pnNVBubWhwQXAwRG1qTTRGYXhnWVJSbWRlc3I4Ym8zaHZpOHBuQVFFaVYxVy1DN1Q2aEdSZDFDTnVFcWpqdVJUbUx4UDFvV0JQNndURHpTNmt5TXZSX01hbENXREM1amJDSkJPQjdGc2prZ3V4akxmZkFEak1NQ0hwWXhhdWYwcDhMSWFaLThaNGczZDNtTklCSTBYNEM5NjdkX3RvcXBuYjF5d2d2UC1CamJYdDAzb2dYMUsxNmdkSnQ1VVh1dHA2Z3ZycWtLWTExejlJYnViSW5SUm9raVdOYVZLSVBYWXlYZTk0ckd0WVM0RGs4dVRjU1U5X1pOcjI4S1pabTRKUFFHQUxMVkxXeTNpdlRLY3QxLVl0RGRRb2lkWU5lNlQ2a2FEcDVJQm5iN2FzWm0tYWZtcjYxdnRMSkVXVi1Bdk5rZ0pfMEF0ZlhFTE9IcXkyTzd2VWtKTDV4YnBNX1ZHQ1VRR3F3WG1yUGsxc2hsUFJ0UWtqemZ2TlNDQ3dxcEdibENPV2xDSDVsdUdfY2haV0NXTDBfMTJEV29yNTJtcWNTTzVCNXFnNkJIOXVTaDJmQnNQbG14TjJMbVZRY3MzanNiTjR5UnNVTlFXTGtxQkhkR0lJN0o4dW1rVWd3dy15QTJJN2c0WUFBYlV3WjdmcGVJWFZRbzJKZGdFTHpoWWZoeTVISC1KT2lMbVIwdmp4V3o2bExrRk1JN1pPaWU0ZDlfQTlzZUZDYWtjMFUyT3NBbHhMLW9DLU9Rczk4QXAxRHFPTjY2R05ocFBMajQwZ0xFdkJid29SNUFYMEUzN1p1WHJuWHRyY2NITnYzN05CZmdJa2tpYkMtaEptZGs1a0gyOHB3c1pXT2dEdjJ1MzZXTktvWlE1SjhnaEFtR3J2RE9sdl9aTGlaUXJQSktFc1NzZ2RxbmJfRk1YUFNBamd3ZXBOSWpGU1A2bC1zeDN6ZklHYndJYkJqNTV4dEtVZElGMktObTY2NVlJYUt0MEZ1NGo2d3M0S2pxRVpWQ0x3WjZoTGk5OFFTSHRxS0pEWXNNTDhrUXRQMHVTdThRSmJSZG9YWGl2Z2RMM2Fvd3M2WVNPS1dqQnRTQWFCYlBfQkZfX3ZGd0pYbmM3Y29taGZTbGk2anhmMGpJMHYwcE9NVlBPYThiU2g3ZFNCSDZsRnhGeGhyLU9qUlNiWHhNSjhmZ1FRNzF1VGx5RGRiT3pMY1lIY3R4RWh5bzk0NUJUZUVqenpBNkxRNl9wblN6S1N2N3BSNWFtbk05bHpoUEJscEEtbGVFc0RCZU1takpOZy1QNW5BRTA5a09vY0lVbW1NdjVlMXI5dHBiNEU1ZnpPYW1GSWpjVmJJSHhrSVpwTVdLY3JNUzl5aTEzSnBZY0k5ZnlJT0ZQa1BOUVZ3Q2pvSmVxQ18tSzZmSzdEMGNiU3dRVVNRMFhqVEZRS19fNmNyMzc0UlFSZGxCb29TN2tQLWt1a0xQSi1oZmdzMlEtamxTOVBBWm9CSW52RHVFdGpfTXNpeFFHOTEtSnMzVUhHNFlLS2w0bEtCdG0zVXJYejhZZjFWRmpqa0hkTDU2bmc1R3VPTEhMd1lnbU1oSjhJSDhDQ2FmN3p3MGpuWGx2dENoMUw0OUxpUFg2MHFTeWRlSUxCd2lfTG5VQ0pnb3lXbmdDNzJsTWZmTUhkajhsNk5pVHhjWWFnbEpLQTd6NjkzSmUyU0JBUTR1SVNidGR2TFJpVmQ1VWktMEhpVW1BVHhqX3VFNFJaakh3RldCdFhJbE1odzVwMXBmcW1iX0g0Vjh4Q2JRMmptTnBZaURYTURuNDJtX09TTzVVTzJWV0RyMjFDTXpueDQyS1V2NTZrVHMtakwzcDVBN28yZHpzRVhpdVZPRUpoc1d0M3FPaVFvY0RqSG1XdFRCOFJnaTBJbDFiMHdQeUV0cXl5U2JoWS1XZ2drbDd4R2huTG5na2hrLWxQZzFkaThhOWNOWVctSkZaYWJuMHJEWUE1QWd6MzBSLUkwc3lqZy10QmJyUkZZcGFnaWhNOTVuWWQtTlMtQlkzZnktY1ZsSzNGUkFYVzBnMjRFOElPbjRKWXdONGY3dmVkTXpWTTBva2hXbTRQYWhZWDVuY29ySTBteUQ1WWY4QTE5WXpWcmxFOW9KUThIUWRmb2o1ekZvclN2WW1nVnViSW1KeFQwYUMzTUxzV0F4dnpsbzBYMF9OLXV0M1RMWlBtWDducmJNdkg3MDVwVjdtaFpsdEdNcXNEc1FQcjhtTU4zVlBxVVNGZkhTT3NtMWpodnp1WFJHSU14eThoVzdaLWl2MU80TktUVXdTb2M4cjhYUFhleC0tajFxb0cyYWo4bkZrMGx0MDhEUENVNWVQVldOUnk3b0FQTXlidGdOY3pXcWlONk9Md2ZPT0dxZk8tZU1GanV4RVZUMG1ObGpIYkUxbnhPWGNLd3RHdzJaMGp0Y2Q4TmZqYXJJcll0ZWlfS3FPUlZvU01XRWd6dkYzbzV6OXprYlZkSHcwVlFJa1cxRFF0OWpJWDdfVk52eThJQWpDRzF5NHZfUkFFRUVVOXNZMlVhNGFfdlpvRlJ6UXBBZm5CUFVtQl9kVDVYT0pqYk9MN2pyYjNGWnBKSXozSVZkSGM2UnYyZ1lzTmp1MXpHZzdybXBrYXJJaVMzZnJTeEt2UHp1enVyTnJ5RFdTQlVtUkdaX3piYjNqUXNpUUhaSGRtN25iOXF1N0dKRkxmTVZlR1JUdml6OWVpeWd2aVRQSXBBOFpHaTJzLUQ3cjFUakd4OGFKd3RjajV3TEZKMjExRmhCVHVndUV5NjJYUE9kTEdwM0lHNjVmSWt5Nm91QWgySEN6QzYzMnI5UEpDVHVRWHc5cXJkMFpOaF9ieVpIZUd1cWg1MVAxMVZfOGpyS0tjeml3TzlqQWVKbDdIMV9FU1JZS0dDeG5QX2xyWjdocHVKbUdubThjQWFBMVRBVzJPcTdxdVF5X1RCRVdMTURGcVhBVG9rUy02ckV3bG0zSW03UldQYTEtSnJlR3pSUW9ydUVCNmNkQ3hGNVNSaEZEcWZCMndSTGlzRXZSUHYwNzZZRk1LRWpjZ0FQb1RRVF9EQ21JaE43QXZaclJ2cDZuQVNUZ2VWNVBjV3F6RFcya2tlTHhpM2VTVDNReFFBcnI2R0hUWXpncEJJVWxFdG5lakcza05DQUlteFpQSjJEZFUxVkdCd0E4ZkhWRElhLWFhT2J0WjlFaFl4cjJsbzZCQkcyOW11RmRSOFNNSVhkMTZiQVdMQUtGWVNCb0xpLVM3VHVvU0FqV29RSjNiQTFZOWRrUjdZQXJQYnBvcFJCODRuaC0ySzhoOG1zVHZKbUtOMXF0eGgzUDRpZmxRNXpHd0g4OXdia3dRbDR1MXhwb2J6REk0aFp1akRpTWl3aURweFktNGk1dTBQSWs1N2RwazhtRFZHQThTendPemNOVnNjTnlfOG9rMnVDdVNBMWpNUC1hM3ZPcktSS29VcGRKTDJVOVV6NjJ6OG5mYVZZRTNzSWV4czlleXN3QWNxaVo4T3VrcHRYLUZtOTRWakRSWlp3WWkyZmR1ZUxGc1pnRnBmS2lZOEk3MGJLODRxeEhrWXdVUEZ4NGdqY3BNbVp2OS01VVBBWGpudkhucXpmYmRiNkhLWjY5bC1tZDNBRl83X0tQSlM5UG93YUtMVnlXLTZoU1VqWGR1VXI5alB4bGpYUG5EdURjYndpdVRZUTg3VE1YdVhJdHZ6amlLT1l5RVdTSXhJd05hSlV4WHRNRnFMT0xwZWhhdnFaenFoMjVSR1ZLaUw2YldiajktTzZya19EUWEwdkk2eWhraWNXYWhHMFNNaG5jZXZUX3JRUG41X0ttLUs4emthMUUxUjhjWElMR084cEs0RHRXYjZ2a0Y3N3Bic05URXBUU2VsbFRWYkFMNlFEZ0NtaVcyeTF1ajVRTXFNLWtOaDB1Mnlxa1ZpN09LSVZaSnBJWm9ibnBRNmZJb3F2VGtrUFFpQTNYbkFpMVk1WE1VcVVfdXQ4dnRtWEpmcVBYSHlqRmJmRXUyREV5NE01cFplSzh3MjhKaTl5VWdKLTNBTXBjZTUyVGVBUUpGR0pCRzJyTGI4Qy01TGUzQ3Z5OWtlYVdkd0VJcXVCVmxFNWJPVFJ3RjVwWEE4WWMwNkUxUnIzZFI3eUg3OWtjX3AtY3g4eEMyNkg0VWJZaDRZYU5xYWFBaDI5bjhXbDJZS09yVnFKQTJ4TXJ3dHV2eG12SGtPbFBudWV5UEZndjF0cmNLQUNlLU5Jc3BaRVZPNVhIYlpQSGRnVWpmam9ZbUg1S2xtZmhsb0lJSk5QZ0hRTjFJQ3l0akJQdnJwcl9NMkVtRFo3U3pnRUdEbnRoNUh4czZHNjhYNXF6V0pDNFZSWXJqLWpqeVhBNGpmQmpJTnA1NWltenpfUURrd3hHTFE5c2NKOTNBaHpBUHpQS20xMzVUc3NqMXBiQzFoSUNCeW95NWZJcDczbHp2VjB2dHFENjBLckNKVEgxQkRYdkZiRjRycGlyNVpzOExUTE54UWdwM3NjRXVnNUtxaTI5b1ROc2FCeUs4VUNrNGx0ZkVuVTRna2ZDSWp6b1JPNHBqT1k5MFpSU2dyQzVINGV2aVdNLVpiTFFQVWhfdXdhNmpETG11SWRMZE9nY1pfelJYeHhVZE1NS2JVTndUQnZXY1NkaExxT204dWhUNzZFQ2Z6dzJpUUlYRFlCaENfbzUzbEEzT1FlVHE5MEZacDdhb3lGTkw3UGZiazV1RWxoaTV6YTA0WDZvcWZTVWxEckR5ZmwtNVJYVG9vNS01NU9NdndjUWJSRzI0WkI5UVh3YlMwMGtub1NOU2hMUzhhaVNxaTYyMXJoQUNXQlRHNkJibTltODduVk1uYnNLdWdQb3RJNnhtQkNVT3BMNjJwek9BS1pXQkVHdE1JZlU5NVI2TjFnYkhFMFEwT3pXSnN5aUtfazJzdVh2dmZOLWNERC1lYXVtR21FR0w5MUhKQUgtWWV1U0VtZ0xHMDRsZXVLbkUtTm56dmxsVmoxYlotVHJiclljUUVWQWo3M0VqWXpoMWV4cWYya0R4eTJCRFdjaGdjM2hyZXcyTm5Kdl9iUlFhNm83WGZ2aTB0cy1tWVFfd2xMNmVnQjZvR1V1cUJaTjZxVjVXSVpSb2JzOEExeUFCZHlyOUYzTWhxMW0zc2phSkVnUk92UjU1WFBTT3J6UmtpU3RNVENhc2hzTi1VSVRkeUowVmtvUW9yZGxHeHRZSFlRNk5qam1XQ0lJUFNPUGxTcTN1N3ptZjh4NXJxcXI5RVBPdmNVLVJaLVBxbXA2aVN0X2pJWFY4ZUpQTXAyUkloX0I3Y0FKaVI0NmRJZUNVY0ZqTXk3WGx5dVprWldfQlZpd2FsSTJZLWYxRDNDNHRNUzVLaTdWSlZFUy1zMEk0VURtMXdUejF2S0ZBUU5jUUNHVDV6MHlFN3dvOTBmanRNN0hubERXMEl5ejJwZTA4aXowZWpzU0N6TFFfU2xiek1XVmFkTGxGclBWWThRMFQ5ZVJXWFNiXzVOc2RaTFdoZklpSmRPZ2pCS0hMRHVNLURhQkFhX0JKUkNFVEJtakFrWWZKXzBOOS1wNXVoQldGWmtuYXlPWnNiSUdPS3hablhNQXVCajVCX2F6TWVieklkcktCSllYRWE1aU1rS2hUNDlTQjUzaXJqeDA0NjBieW0tSnFUN3AzZWpNc2NSdEpRT00xeUhNel9kLXgwbUh4LXVKekc1cngweUN6NVZKdVRkOHBldFhOVGVBTjBKbjlFN0ZtTzZpcGotM1lEVGVNM0xtLUV5NlNFalVrQ0IxQnlvMWtzUGN2VFlxTlcycHY0QWJ6T0hCYjNucHlvQ1NxbFNCVXU3VGJrbjloRnZDMk8tQjg1NTRjSFZ5S3JmYy10dWh3b0RzTGxpSFM3ekdrMTlpN2ItLWMzTDZLMWNuYTNqSU9VSE5USi04NGhrVDV6T2JVUVRhQUo4WVJnMDVRVTd6OHF0RXB3alJ2b3ZxMjFtU3cyZWRsSmxhVkZhaUxpS3B2Y014c0VnclBja1l4aGdFMjVneS1oNFBGRS1DVll6TDM5NXBTRHpGSzk3dTYwQ1NVcFRWNWZ3ekdxZU5CTDdlMnh5TzBQczQ4cEFhSUJBU21adnhudWRPR2w1dkxsVVBaWmJMeU1HZ1BtX1lZSzdmcTZ6aFJSSHVWQVlJa3o1b2lmSjN6U0Z3c0szc0tGTVBSLTBTUWl2RElsZEo4eDQ2cXdFemxiRm93ZDVDM1hVcjBtZS1wNTFSMGt2QlZ1MW54NVhUSW93R1NfOFQ2Zjh4cV93b2VNYVVUS21VQ2RVRHBYMjd3Sy1tT0xrV0tGUGxkSDlMMUlBMTFwR1pWVUxKc1ZFdlpkLV9ydzliTjNZNDZWbUpyeV96Wl9vdW9DVGhGWFVrSFVQM09BNFIyM3ZlWlR6N3Q1NGh1SmxJcWNFUGw4dGlSWC1YdklvWjhPZkFvTlNfSHV4YmhVVXkxVWI3dGJsTWFxZTN6ckUwbVdaSFh2UDVTMEJVY1A5S3o5anhNakhTeGxsZUhTUG56QW5CcjhvZVcteWMwQk0tQUo5bUVSVnJyT3ZaUnpIdDduVy1Qek1CaHZia1pjVDA4dkpES25UWk1hV1hBQm9TeG5hUDVoc3lwa1FMbHlzaVowWWpsSVFYQzlnc1g5Z2pKaXFBWm1zWVJWT3dFUFBOejRkWnlGNWl1RW1CWGNpeTZIVUpxQUlZQUo2TEFEOTB0RG5zZlM0dnhjUU1tR09pVURHVW9wU0hjbWxyZlcwZUJxejlDcXJrVVFHc2lOMnctbkhQbU5GMnZ6TktrbGVDajNJYlpaaE51SnFrRHJreXVWVlR1NHFMS0pIcFRvYU43aHgwc21iMy1HQkhRZEo2N25iNS1PckViR3VBYkw0UC1XT294OXRmekM4Mk1WRUNWZFhKa0tPS29lR0szV083S2plbkp0WGJrd1ZzX08yQTRUUmJCbS1PV2tEOWZBMjVlRHlWMzBCcE5QN05IR3JqVDNWa244U2tCMXlPZ0J3NVZFdWVkZWNmeGZMSEtLb2xHSVRrQzFST0VsOHdLNjNidUF1M0xKZVF0NVBSSHJNNDE4NW1lekJFQURacDNKSW40R19KLVVoM0tibmNhXzVVcHNJUEJ1Tnk4ZWhmX1g1NGI4Q1FraU82YlFsTVBuOGx1ampXa0lXb243RnZQazZtekl6UXhBbjJZOWR6Z2RrNHFQS0FaZGdIZnNteDc3X0NuNUotWS1zVU81Snc3UnpJdmhDeU5Yc0I3cFgwT0tXa3VsZVRTTWhRRFVnNFZ2NE5scEQ0UWZpaXlFZm9ybjZCM0czWlNQZUZWOGtXYklXZ0JscFJCZnBXS1dXc1dRc3pwckx4Y0Z5WlBmd1lRcmNVcHJjbXZkQ0VkQjhETjlGZGRfZk1WVElRYWdVcHBmV25XaV9nVlkwUlhya1NQckpFd20yTEQ1VlFTbnZTNXBwV1BMWWEyWXI0bkg0V3lVbjYtLWFyV2lZWXRoRF9DVWV1a0FHa210NDg5blo4NW5xLVhQN0oyTXE4N3ZFemlaenl3NXUwQVc2MHQyNm1Ia2kxNzJDX1Z5UHpmbi0wQnMtZFlnRTlUenFIRG5ud1hyT1E5dzdwdm5meUtRbFZZZXdNazN5N3RDa0lzN0VTYmR4Q0RvZ29TQ1hfTVVRTmRiWDVMMFZxeVUzaWptUVJTeHlZUmZQcWJKdGp5cjFqOVZQeExnRGhlV2pUOVVYVmlJaHhUSTdLTXI0c0F2elpVZ1hEYlhLWHZMRnYwd19KU1BqSy05c3ZVZVFLeGdyWm9IYm1SeXU1MGZLbFozdEVhb2NaX0RXNkgzcmk0UFZVSlNaMEFiZEEzaUVCX0RrcW8wTmp1THhGSUd6NlQ4c2tveXVSX3dKSGozaHdQQzJHYmN4QUxRNzJwRTZ0MTRWMUlRX3M0MVptaXFvWE9LaTJMNXFLNHdkYXlELUV3X0NFLVNCeDQ4bk1kWVpqNzZEbW1pYWtiVUpDb2xjaFBQQ1JEUjBnWjM0VTFPTEF2dGpVc1JhYzRCXzdmamhQb3U4clF3Y3RMeU56S0Y1WGVmQXU3TlNnTmZyb2ZMNEJqNDJvR2dPa3dOV080ZDhiT2FZT3JyTVlDaG1tNlBvUFR4OWxiN1NoSXREZ0hldDBnNjYwSjZwa1dpdTMxQ1FwLTlQY3NsS09NRElvWERlMjI0cmxLSXZRT1ZlTTA1UXg5ZjJpRWRFbmdFUi11N2xlLTA4YkcxLTJCeHlvbzUyTFQ4N1BKUWRPbnJ0enl6WUFhTW5ZaEt5MWdYNk5QMTN0YVdwejF0bGs0Yy12eFN0RUJUZkpjTmZ0RUthUzJKYWt2SXNLcm9sRHBlTFBiTjQ4SEJGQmdGWEVZMmtRaks4V180MGxUaUdTUGxCWm5QUmUtNDk3MXh2SElvZkl5MEhWd29nRVRPQllYQTFhLXJKZmZ6amZ4dmRMV3lmQnV6TDNZb1ZrbDg3dFpUNTlva3dEV192WUUzNDdLOWRDUWZhSzYzb01yOXdsdlJzcGFkMElPb2hlOEtJNGkwbDRZbHdzV3dJS1FwTkJhQXZfejFhbXdEeWktSEtDVnRQSUdYenhpSjlKaUY3ajlnMERFdHJIa2QtYUxNcWpRejZ6NGtvM1J6V08zd3ZMNElHWWZ3QjUzbjlvTE5WSEx4WGg4Z21KLVdGOWtKSHBqZl83anlGYnRBR3hTdDBGazNrS3Q2bG1NWjhEUmRuOFVVVVZqSVZDZjQ1RGUxTHhLcWE2Q2QxS0dET2dRdmlnNG0wMThfUFBwemM0amQ4RlpkdGdpYWtRdzBRSFpYdko1NDRDbHZVN2laWUV6eVJoMjAzQkVOR05JaXUtNzdEeHA1Y2JZc3YyRzJLVkY0V3BEa3lrTGplOVREeC1RMHVCdlFUMWc1ZlgyRlVFemFWSzRfNmFIaVlDZDl0SU1ubG1YdWM0dlZEaWx1WFljdkhqcGw5QTNCeXZJWDVZaEhaRFFaSzNpcmMyNEVPTmE3VXVWSklIZFcxejExRDlUbGtuX0dtanFLWXAwMWxaNFh3ZG55S28zZ2NYVlpZZkRvMDhhaXFuOW1TaXBSTmkzcjk4MFNjZ0RKejZoSFFNT016dGVjUjFXNzBDNFpVbVJHWGVOdjZJSm1PV0taVWtONVVwLXkxYVBTQW54ZllBX3dxLUpMWDVpaE02SU1Va1p4QURSYUNPRnJEYkN1eXZyak43N0JUc1lFdkNGbXAxb0JkVDFVWF9ESFl0R0FuMkpBM3c5cFVsWFk2V0tsR1N3YW1KYlpTRENxdGhDYjZzcTduVzdjNlBwTnBaN0FXTG80T1c0MnBvcVNWMzY2VVROcWRiRjVha3ZheTFwRE9VZ0R3Mk55Y0N1endoZXRlSkFCU3VlaHhNSm5veXZjbnFEWEpkVkRlM0E0WXVLWGl6RzBuZElOZi1ZVVUtTUhYb3ZCSWpEZGVxYlFwZUtvTHJla1VEY3BWRWpabGpGMjhqRmhzbjRnN3gxQjZqV2pDTlVRY1YzZERuMVduREdaYjNxUkR0YTdWSDlkVWl3NTVCamt1dldjVFMtck10TjNrT21DNXRGT1M3NDRob3JRaWlWUmtIa1hnTEdXT3FrQ0kxZUpGZG1zcHNNTDRpbzVIY09GcEFIN3cuTXhLeUxlNjRHa3dhWDBkMWRubS1EVmZqUjNJM3EyS2xKYlBvNjJBVVJkbw" + "value": "ZXlKaGJHY2lPaUprYVhJaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJaXdpYTJsa0lqb2lZbUZqYTNWd0xYQnliM1JsWTNScGIyNHRhMlY1SW4wLi5pT2gyV2drNktEUjllRDU4Nk0wVTJ3LnBxdVUzYVMtcmJJNTh4anl0VnVWX2JCM1FyOS1GUnRUcHdqTEJiMXE1OVE5S2dCNEhhZlh1enB5Sl9Ha1JScmRkNjRLZG0tdlhxT1dKX0wzZkROejIxWmlKLVRGUzhlcWJDblE2SmJubmRqOGY4RXFQT3A4V0loZnhnRFZ6QWZxR3R5UUFEaHpadEpKX0xlOUJkV1pXMUhrbEFOT1NNN3EtQ2dDakVuclI1Z3FwU1l6Z2k5QmFCMnhQZEt3Q2U2NDBFaWk3RTljbU5XcEtOc0FxMXdRVUhPZDQtak5ESUV2aTBQdXA1QTlZa252NE9LaXRGVlJnZzRtVEU2aUZUeXA4a0J2XzJlVVcxa0c4U19Sd3pHOHM4M0NxTGZpWHlPaVlici14TXpmalc0R2J4MFNEVTNWblFXRk13cDg0MHh2eGxaRDBiYXRtRTBqQzVvdXlSemo5SVdfdVB3UU5TUE9oUFJQdDcxZEJFNk5sbjhiOU1kM3hMUldpc3haMlI4R0t5cV9nN3gxWHl3eXZXdDQyVmgzeG5JZkFXWElXWGR3Q1VMeEFacmdjb2EwQzhKU3diMHpzdDhMV1kweF9XZjRGSDRibnBWcHJQcXN6N2xVYkpQRkpSSVN5NEdEbi1WQ3I4b29qOXBoSmRkdHh5eUY1b3Jqdmt1Nnp1WmRWNWVzMm14YUNEY183YjZvMGhURVR6YmNGV3NVSklLOXBGMUw1dFV4MDRLRVo1MlRxMk1NZ0tnZXJSUkNWSWxQaW9kdVVpOXZpOXdYZXVtYjh2emo1Yk9vQ1lvbDNvTnBIdzVxLXRJbWVXWDJuYS13eEV1NDM1elBKZVp3LWZsSmdiRWpoeG95N0RRbm9tLVNWUTlBUjZUSkNXWjUyVjNaaWswdjNjRldUUWtDbUVPcDZnQU83TUQtZnB0b01pdFhXSzhKWjNCcE8tcWZvLXcwdU9yajVLVGFQOHlLN2VhR2hlYm93akhSYTJnSDZDUWdrUm4weFgxU2gwRFJ5U1ZTYzZxUUxkWTJiTGlFNEt2ZThybVhOWmNzVnpDaHhXYlhaYmxCaDVxdTljLUp3ZG5qekNWdWFyUFppNWNIM3ZtbEpvN1BZRXg1bzktVUE2ZFNycWZBbHp0SEdXc0ZuTVRSRUFRWGZtcjZRbFJHaHpTSDJ4NGdsaEFsRlFhU2pFWWpDcDd4OFJ1b2tiS1JTYm1HUDd6Y053aWEzTjZtTVF3SGtPWnM1cDhHa3VUbldsTU1lcWNYM1dNS282ajZLeU4zNi1PZENpYUNDSVM5UWpFNU1td3d0NEdvbFc1T1Z0N2R0dmNaSEpfS3dkaXBhWDgxUzZNb0syYXhxcnpEYmNTUkw2aGhlTVdUSWJxczhPeWw4RVNrWVF5UVVHckRtRFh5cERJT1lRQWdtSGVTRU1IbFpvdHhLWmdfb09ObjhrWWV3RWJkdmRvUmU5UjRtYk0xZkpkMEtpUy1mOGdHcC1WU0hPb3MyZDNBMGFRa3BHcjFUYk9IS0tZVFoycUdJcUY3SDVOZEdEdk1aanY4bGFETUQ1eFROZlVWc01FR1QzdTVnRGM5YW56SEJYb2RjaktlR0RUcE9nd1pXbzRhSGIySWVfSjZQTGpyYnFrbHhtUkxESUlmRzJwdEc4eUVpR2tVMDFINHJMbThDWmhJZmpNczhQUnRNYU5rYzk2SHhVNDNUSXVMUFQtU2FNVThzRC1mSjRrLW00c1dNMGl5VjVDM2NjeWQxeDQyUkJjNHF5eDZyNWhHQ09kckxuMTFjakRxSzRaT1lmV1FjbkhyWl9lektCSmRQNk1mcUtqdE1ucDRlQWxzUDU0amZianlJS3c1UGRaRVcyYS1qOW9lYnJ6eEphMXhTOWVOWFAyQno5enYweDRDN0gxUWVHcVU2QTJQWV8zRVpfWVF3RGJMaUxXSFppQlJVYm5ocnJwVzRwa0N3aFdYSXhBS0NkdXVFZWhIeFVOLTBDSkVKeVJ2b0FwTkR3ekRiY2haazd6RWdFQ0RndzBhbXVUUzNZS1JuT0VFdm5RejRRdlltN21hRDgxUFRNbGU1ZW9oN1R0eFNNZ1hjSHJFMUctTkxnYm44T1ZrRE5QZ002TjlRa3dKczd0aFlVcTk2MnpEUmt4c1NFUGozTTFxaENtcERDdzVZb1RoOF83R214dkI1bzJHMlVHTGc3eHJtb0hMXzRORjFYaUd3U1JWOVI4T2xDdXRzN054dFNTSWNxV1M3MWNVMTFMc2tONUpxUWZ3a21yWXRLSThTWGs2Njk5YzFTN0NHMHQyNHBBci1IZUxPZDUtWEpCT0hXMHFlUVlrYWpReGZFQnoxeG55SHkwS3A2N1ZBQmY5SzBzMFFpV29OSXplMzVLc2hmT0FlR2hDMUpoV09Nb3piU01raF8yOFlPQ1BUM1I4anpSWndUY19IZ2VlNVlkblFORzJBU3pzaFN1RWpzTWhXMkZfbnZ4dkVRZzZDRVBwRkY4bXZNelJyUDVTQldoSEZhRnl6Si1hTUlON1QtVlVjYUY1RS0tVFAxMERJeFBJZDRla2ZpZGZSczZydDZubVl0SjlEQjdrU2xKeE5yT3NWRFNFT0x4dnRueFA4MmpCSVNhOGJHZ3BVZ2dxSlVSTVIwdlJqdXhyS0trQzQ0N0FNb0Z1QTZkZXZZcjBhZ0wtMUdqalMzVEdMUUQ4R21iNVBVaFpfWi03ZmxFc1N5TFNfeVNuR3BMSGJTdUp5TDZyY3l1Z3JxX19mNTZHZzVSZ2VVVllpWjYwZGtWTUFZT3ZrWkVMU3hHLVNQNGJ5OGRUVEtxZkQwYUZuaDg0RU1mRnBzUWRtLVFXam5rZHNjR0JNbUJsaWtxY0RiT2d2TDk4ajZuUk5JRUF5TWhVN0Y5a2hRV2VudXV1djBRcXVtZXhOOE9lVml1Tk5PaVBObGRwdTRJRV9Ebms5SUFkTWZKRzJmcm94ZFBEcmd4R3NCazFVM1pOeDRZc3ZmQy1jY0VVZXFacGpJVU9Lck44dzFLLWxhME0xZERpOERNVW9QdUNsX1doeU12bEhPWk03TWp3YWJYcXBxVFFTZ2xwSjU3ZU9EdVZBai0yb0ctdlVIMkxEOXl6RjFrQUFrb0lVYWpzZkRQWV8xc3lpbEo5V255cFBjU3FfOXU3MElSczg3a05nMGV1b0hHS2I0QzhhN2hfWVhYSnNrNjFGcEZ6eWVQN2FMVjJiRF9SVWJMNG1mWExhcDZPY2ZGWmhtUE5Lc2ZNRGdIdkFDc2Rmd0s3R1JsUmZvTURIb0ljcXlsX09WYzNwbi14YXFYLXMzeHNyemJ3LUdCMXo2X285MWQtY2NQMkFXcmE3MVl1U1RTWmlnUFI4QjIzSlZBajNXS3VMNlNQdDRPNmdGa1NsaGJIdWVlZ0hxUzFXT29EUjQ1WU1Ic0RBUVE4dWo4US1weU9qWEJ1VWdRd3Zidmd5UTlvWk1Tbzl5dXBrNlZGMkZJaDgxWldCd0U4NGpTUWgxNUZNVzItSkZubXoyazJmaGVpN2ZKNTd1akpGRDdwNVFNeXBKZ3RWczJpSUI5Qm9XNGdxblNuS0RNNDZpMEJxc2YwWElVSlJDWE5CVThmRDJ2Vmg2dXJlRzV0TUsxQTVTS24zczBibzFzZVdTWkhWa3JXTWNfWmEzSnhvRndxd1lZbnZMV0laVmRDS2hhV3VfRWNRUlkzQ1JxbnBkcnB1Y2ZYNDI2MUlWNldtTGYzOUNnVkVZTThic0t4b1duUjZQNXIwV0tsM1h4YmFVZ2xEYjZxM2UyZVZvdnF6NHdVRjFCdU5OeFNicW4xWGIyUjBfcHNFTTdTOUVhVTRCbzdycjNaQkNxV0pLTGJ6d0FnWGt3UTBVNk5CUHl0aUlDTnpSZHhONi1LNXZ6a09LcHFOTlZzX0FScm04MUxHc0gweVAwTDF0anFPdlhvWXl3amxFdkVSWWZsdENVWHVpSExoV0xTWTYzU3c4MkZIbmhJZnRhbzV2XzhKa2JjcG5CbTBlWXVDN0JJWXBYWVVUaE5kaUNGUXpyTkxFd3NxVGlyTnlIb1JQdHZYbHhjUVV4N1BwajU4bVkyZUhTNzZJck1ncEpCWEdyVVdJUFp3M1pBWVNhT091TmFLWVQ2eV92U3VZRTVEa1d2dndvSFZkRVdQSW9xQ2toRzdIazhDeFZORVdWUDU3NkhGTUdyU0VlTmVabkxDWHNKbWlMQU5mU3JEYXFzMEdkYnBCU2FBODBNSHZPTi1tRmdsNDdBcm1rcWpLYXhlU09jZm0yb0h5QnZaRDBJdnZIUk10RkhTdGZ6RzdVRE9tR0hxQ1pLV2F1dkRVUDl4b0E5WDlTTVA4eEFreFJkU0dkNVo2VDZCN0tqOFMtelVJYkRlRWRrR1k0TzNUYmpFUFZyYTAwaFFYV1FReDJYcGNhM3BVUEI1eHdGbzhwNVRva1R3NFlHbVhvWVl3X0VvekZsVkVGVUdaTktMNkVtekJsVThCZllJQnZ2NkRCSnB1UlBZWWZaZzRRWTVBZlZrQXJ4dTczc2ZIaDVHdW54VkcxRUtWNlRvQlBoMkp5VVVWV3E4VllUTmhOeXhyTm5yRGtSMkdqTXVhZ2gzQVJUbWxHbk5SNzVKUHFoWHpBS09oNmgxTWR1Qm5scTk2OV9iUjZGSU9TQmYycFM5ODFKMHlKbkpkMzRrWWMwcDhhazFwc2Rqa0k5U3ZwbExLQ2otamJaa0pVR1lNY3R6RjBrMGljVXlCcVZaTHFaV1Bvc3RqQ0pqNjJfQThuRDE5Zmx5WVJiWDk2ZVo1VmNQaFdqQ21HZXFrMWZJVFgwZVlCWTRIVW1Dbk5IakFDT0QwMXdxak90RG5ENVBPR2lyaHlyZ05Wb1V0MnpMaTBmRmtlOU8xOWY4VmdxaTR3TmtwVWxWaDg3bkFvZFZ3UnVrN21VOWtTQktCUDh4bVgwTnJvTk1qVENPZ2haVmZaNzJsV0dkWGdXVWU5OFFYTzZLX2ZCc2tRbzY5VGxzYUNzdUVzbG5RTzlZNUVLRkd4MGo4blhoa1J5Y1BBOUpiX2dSUEg1Zk5ELVBnTk03Y2o1N0E1VFNfYmZGMTVTY1dvelVuYk44LVNCS3NLdEQzQi0wdk1Wd3FWcHFzVWNkTml0U1EwazZ3Ykk5WVhhd0R3SnptWkctTTRiZFhYcXJWZ2tmZGdjTmNJT2ZnQ0NTeW9jYTRIVWFXQVZUQmtfNGJueTRmYzB0R0taZ1IzM2sxc3NMT3U3QUowYTIyd0l2NHE1MGFyYVZtN2tVdlo0eklsdWpkYVBJeWo1NmJtUGJNcGRlZEI4Mzh6LWNCTzRPMXE0Rk5kWV9DVDBIVGpoTzEyVHRkejdaVXoyXzZsUkVvTDZ0UDFsem5XQVlKTHRqWkY4OGRFakwxS21BUGFRdTVLRnlaRTEtQWNDeGVFekJYVUR3UEVHbnduaEJrOGFDaWhOOS1YR1dTcjJrUjk0amcwY3lKV25lY0tNRG5QWWllVE8yS2xiZmpNcFhNc2FvSUQ5WkRJSk5DZ2w5QW0wWWN4cWx0d19RN2dVdjFqaXV3bVliRnI4QTgtMml1S3FiTFoyRzN2cGhVZ2cyYzhBQjVCUy1HU2hldGhuWEtPTHdkeEFVbm1OS1VNdUY0X1Q5UHJLa1hmdnBRZFN6MWJldHJrSDB4NmMzbjQ3d2V4M2x5U1UtUEEtUkRUZHc3Z0xmRHp1OXlDVDk5cXoxQmlDZ1kwYjJJdjRMb0lsN0x2djA0SU9SR3d1MDdoMXo2aHhkREh1M1BOaUlydFZvaXU0TGZqUVBjY2J1MzZiWDUxVjh3d3YwZDFweF9hVm9ubEhSd2R5NkpNQTU3VGRHT281QUNOdXBhMWlkaEQ0SFhHU1oyLWtlR0Mxc1VRd0JIbjktT0tRUUloWmhpUWotTF9VRDg2S2YyQWc1N2VIblAyb3RteFk3RHlXeE5Nd1pPZ09mY1BVRlVQZVRaTFNGb2s2QVI0WGN2U3FuLXJGaFVDNGpiVXpMTVEtVlg2TTN3R2NFZDFZY0VOZklsOWZvSHYwVzBOLTdsbS0tMjQxM3g0c3VpaEV3a3VHY2VnTmJjSUNZak1zRVdCYzFDSjFGUkVJS3hha3k3am9pMkNjeTcxRXlmenUzYTBNMkV0Zy13Z2t2UzVHdWpBcnFPM3hKbmV2emJISmcxYjNINDREeG9FWld6bXN0Ty1DSlFVaktpWUhnek8wamVYdU45OF9hTEJXc2xwN2M0RnRWVEpXclRvYW54WFpWVVl2V0d3SVNweW03TFEwSEpVa29LQ3FQLUhNZF9DUWxTRDJtSVRBSFdBN3lZT1dYM3ppMVJ2VUxOUFJnZTZJZ21vQzZ6alJnTUstRnB5YlpXVVoydDFFVER4TzAwcFFqekVBaGt3NHh3YWk3VVB3eU9qcUdFLTJGMjlfSksxNWVNRDVkRlR0X1Q3SEQ2bGJFQXFUak92TVpkb0xOS0tfQmdRa0I0Sjk4UGpheGdxcVhRTS1KSjZoYzM1WGpUcVBhckRwdnoyNVNBSTFrYzR3SUoycDNLb1dMZXRtUWlxQzhSTGtsZjhHc3MtR25YTjhDa282S2pUM3ZTdUZNWlNSSHdNeVQ4T2ZVdWYzcnczZ2Rsc0MyeUZXbTgzRlZRd0tNTFBPTTBsRm1SdkxIOHFpSWNUM2tTbGhXRmtsdThub1VOYXd5dkZsdkhOcHBSdGNSWFFKVFNWTkNvV3ZSZlVwZ2xwd3FmcVJxNDUwaWc1dFRFcFVGQTZ1RnI1cGM1NUF4UW5JSTVnaE9ma3Y4cG1XX3JEUFdGYnROY3VXUEM3NG1TOHNfQno4dUlNNWxKMHJQbWJkZDMteW9nU0xweERkSzlWMWh3LXpscnZnRldkU3FwVnJ1TTFMbkI0elk3NE0tVGd0Nlk1MUp5R3FGblMzZDExb2lyT045OW1BN254cEVHaGp1clk1U1RyRzdEWWJHUGJTQThHODk4Sm5OM25QUkJGNmdHUjNxVTZwRHRFUS1ZUV9SWDlDRTZRemZXRVEtcS1haXBoaGhOTkU2SGtuUE1HR0RJOF81ZVFGMGl4UEVJNjVfWE9rTFZjbnAwRE5vWi1pUnJhSGJCUFk1eWpueFFNR3preWpROW5iNnVkWVQ5N2RGTVNXaVRaMmpRWnMyXzhOQTZIS2VHdWNnalFGMERhdmdDbFo4cWxTZlhseW9rM0JKMjJweFA0bERaWUxIeFNhV2ZFREg4cTdfY0EyVHZ5NUJ3UkRzZ1RJS0R5S2g3NVltTUlZdXFnRGFIVnhxM0doNnJUUEp1M2J5U1hzMVpZSEplQjdfdkJkelJNZTJXUy1MNmJWVkEweG5Ic1F0R0xyTWM0UmNnZG1kZmhickFIc0xZRUc0QVlnNEJhdjh5cklySF85bE9xZXlJaVpmMWQ3T1dhY3ZWejFna0JJZzE0TmFYWnljTG9yazN0M3R4R0pwSVFrM1Y3dXJiSnlhNVhjNTdsb21oRHRxTVRZZkMxMmp2TlllOFI0MzZ5X0kyTlQ4UjdMQTVCRWt2T3BTVTdhajR1TUhwVk9kdzZSNUxGaWhKSk9NT0kzVm1FMUtkSElhQVl1VVEtMkROcnVTNnhfbDJuRWpfTFZ5YWp6aFlyUzc2ZE50UUtlOUE2RjV1VlF0ampEUDF6cGY4Zmg2MDBsWXRTMHUxeF81aEFwRzdCWllqRk9KbjNaNEd0TDJsOXRUaHhqOGt1X3VDbkhJeHg5UzBlUVlNQmQwUzhzbWFWaDF0c0E1a2VsNmR2djlFWFZ2TUlOS2NEZ0g4N1FDMnFvRmJWWERGVHNDX0VzSFVkVEZ4M3VhbkJ3ajI0WmU3UjJVX2E4VVEydVNOaWNvOWJkNnJZNU5uTUl6V2VEdHZqdzdHXzV1SjU3VDNraTRFQ2ZQazFBRGZDY05TeTRsNHlsQU5CMG1iLWV0M3dISExXZVBsLVRJYWJyWnhmaVhYWVVRTGxKSVVBNkpGTk0zMW5CUzF6a2JOS3N0N2t4SVZGb2ctbHcwbFQ4bnk5TXNLTERvcGh0SnM3c2JER0RMY1AzN3BKOEc4Ry1NLVI3VXgxbFpUY3h0dDlxUzBMNU5wcWJzM2RFM1ZVSEFBWjNoNnE3dnFyQ21DNzVkWllEb3NJelgxYUk3MUtfNE1pdjl5UkF1ZFY5V3UwWjNuODBjcTBfMTkyVTk2cUR0MzNFY3hFbHZ2d1REMVNqc0N4cTlSaXo1X2VLbzlZMTB0UXVwTHFNNGkxVnZYOHZSMlpQUzZfZWo3d0U2MXJ6QjJXSmcyemFyRTlnSnBNNlg0SjlYZ3kxTHRHa3JZY0NENDhMTGlzN3hCak5DbmkzTjI4blhaUllWTFlvcU4zZ3VkR2FzOE5kWENVdDhkLWRKSXdaZ0d2WEhlek5wVHptWUd0ZmNYb0ZJXzhvbVJYcURRWXlxclpRZ1BVT1N0SUQzVEpwYWlKRnRBTFNPbmxSSzg2aGtuQVhwRzhoeG1rRnRGTjlBdGMyRDVObnE1NERqVk9Bb2VtRlRSSlZuVGUyS1hTUUtwNG5UemZySUVnYi0zX05QTXVPWktoelRxQnM2TE01aDdVUXVLZzNIX0YwVXhXRXRFVHJQVjRmQ201T056d0tKTW1yOWRYb281dnBTN0REU2hHMXNFcTk4X0xYUnRiQjBubVU3bU5jM3BFRkZZcTZoMngwX2dIY1hNLXZJQV9Jczh0UzRLc1RIUkd3ZTdTQkhxTm5oVy1xQ1YxeGw3T3RCNWs1SlZoaklBNDJZbC00elBWS1lzXzZobGhNOThRNF9iS0VNRDh4RklMWnFPOXQyaXQzNURNN2VJZkd5ZmxQQjV5VVNEdjBacGRfb3lIVmxxWXJUUHRNMVZzQ0VrbHQwekctSXBLNlVZbTlvLWpBZV94R1NHQjNNeG5SREhyb0Mwa3QyZk5MSWV2S1h4dlNyeTJqYlRFcWR6alFtZDNaMEhsTFBrcE5oUUpERGxOUElPeGRORVE5M29PSGkydV9ETGtydG9BNi1XNFJzYk14UHRvRlVJTlZVVlF3SFR6aW9STU5CWTlpT2gzWEVXbFFMWXEwa1R6c1Z3N3FtOFJ2VDFBQmloVHlvNkxzVG5LaW41QWZleWxmbEt1VF9zOGUtenlfZXU1NzBOaEs0S0dFOFk1OS03TGJHV0toR0dIbG4wQlBaLXk5WHVBdmNncUJKRkppWEJubHhjS3Ricm44U3JlR3pDOEEtMllWbEpkYVl6TzN1VXVlZHZMRGJ2WXBCcjZZODhnTXgyemFxUUVULURleUk4Y3NTNmQ0RFppcEpuUlNfN1ZhSXJsX0hyRXFUVVN3aUFJeDNIYkdUOGlKb1k0QzVPRFRQWVpVWFJibHo5N1Bxa0R6ZzQ2WHhKWWFDZ3h3bUY3R3F4RXNzQnRTNG8xdEdKb29lcHBZT2pwbjBXWmdCU1F2eDhZUzBfSFRMMjRLQ01jaE04cTU3bmx2ZWxZbUdlcVBNOFg0cWx0cnFEUG9way10d1E1amowZnpKOFdxZWZJVlpUMUR0ZEpkT2xzS2E0blhueWNNd0tFM0ZMZklUaXVCUFp4eHdPYU5GLWxUQi0ybkxOTkpWazJNMjBpeEtrYVZ3b1Nia2J0dW8wZFR4X05qZHFGQVNXTTJSY3NYWkV6aDU1NWJnVGVFVThKay1zaXZTdmVUaGp0NGdfMTBmUFRhWEFJalRrSmZKaEZ6OTRIQmdOd2lOSU1pbkFHN2V6bkgyUm5pRkNjYmREOUVkSllRbUxXcExmREd2OHFHQ0xPbk9sb3BCMV9Odkg2bklScmlCNzRJamdyN2hwbkwxN2RORkwzRWpnelo4UlltWUxzby03UnVXSGlLRmpkZGZzOW53SExkY3ZrS1RJRU40LW5yYXZfY0VzekppczEtQ1B1a3VkN1g5ZE1GRVBscjlseUNEZmwybmVUUk5tQmx3MkEzQmZDOVBaOWpEUmxTRGhUNTJhSWxrc3NPcE8zdXJoSnlVbTRJLVhnV2pMLXFHY3pzd2trR1llRWJ2WlpYSllIMnVhNVR3cl9vbU1oOVZGNUdVTXBmZjV6SlVlYUd5cVc2ZVR6dUJTcDU4Qm9NODBnVHRsN3FaZ0NKX1ZNOHlPcTV2UWFraV9BN1lucnZQTDBnQ0tLZ1YxWUNVdmNjNHRvMV80MTM0dGxXRjEwS1hnWE90aEVKVU5sT1JuOFVHUnNadHRkSlBwVGtQWVVjY1dEeWVIanE4YjNTMHRwQVlROFhPQjBaX0tzNUtrT292d3UxTE1pbmxCYnpCb2plZmJhZTc2R0swX0o5amV5UFhLbGtIRllYQ245dmFVXzJBSVpHU29rdk8yMDVWNGIzVmYxay1IVkxuSUFRRGR3MXBucU1kU3YwaEdqa0diNjNvSEZkN2FoWmRNNUVMNDhhVVhTdXJ6R3FubEdMakZZWkREWlVJdzZTeTZ2SEFTNUhfNV9OM1VMdExiMUUzNTZjTlpHYmFJNWZhTERneFExRUw4OTgxWkZ1X3VKNC0yQWlDM1Zsc1JPanNpc1JaeGpHOUJfMlJ3Q1NLd3dneTFLUjdPbXBYZl9WMmVBdFEzV1U4VnVwalZZU1hDWVhUcWwxSUFVYUpmZUJOcDVwdHM0OTNuQXVvNzBlQ0h5YS1rT2FhRHZ0Z2k2WExJWEtYc1BJRHQ5am00WDN2My1aTm0yeUJ6b0RwdFhuN1lEeUxSa2VLaGZVOXNSeEVZTmhUbU9VRlhsQXdvTnJqeldla2gzX2tzM0dWQWFqUjhaZTQ0V21lMy1RbkU3OHBSMDFXSWd1cWVzNmdialBHNmxnQkxrQXVUbllzci1QZlpJcWd1aDV5ZC1EVm1mN1ZSWldDOEUza2VpaURYaWRHZVRRcm5Qb2hrZEVwX0pzY21PdGprb1JibS1xclRYWFBjZXdBY1ZGaW1VNnJHV3hSUmI0cklwZG1ReTJOQkItaGxLUmNFNjE0cDdHUHF2bWZLcDJPYUFxUjd4R2wxRUk5WkdsbUdkZzFtd250aFBWZ0t2M2dQLURRNDM0RFhocnNkLUNDaG1ENmpraGdwSVd3Rm85YmlZMDVmM3REWmlQVkk3ZlhTMkVfb0FweGxtMzdIWl9iOHROY2xUSWdSdTZBaXlhb3RTNURDNXFnRVhfQTB0TGtMT3YzdjIwZTRjbUNnZW1IdHc2U3o5dGliV3Z5T0NXcHVuRWl6WkRERHlKMUFFb2h1SHp4LUNLVEdKUkctWHlrQk5EZ01Mb1kzaXVuQlpYeFdTQlk1MDN5Y2RiUERYNUVJbnNJRC1BY2NwdHM5bWxHejRkOTQ4dHlQMlhveTZRMHVfT3RyblpsWFJMdU1MaU5EVmt1RUFTczJ0RkZHZEg2cXRfWVF0c1BJN0hpWWZCSTFUQUVudUZVQ20wX1dRNXdKNlBxczVSLUJjeFJEcnRCY29UTERkNzVhcWVrTXNwUnFsSlZZZ0FpQ0Q0M3FHMEpOYXp5LWRMLUdNOElGbFZVWnRqSlQ1TWh3MHNub0JLNjJwcTBEM0VMTEVMOUFfTTdtU1VYOVVFcGhSVDhJdGNxRmlkVnpISDJqb2RfZFEwRlhDM3BhandPLVNpd0pvSzNHN3Q0UTJDRjFJOWJibkJiLTZjektabFBMenU4cWhsWGU1SldUTjhOVm51Y05jUUh5cmJIMGd3MEMtOV81TkZvUlhicHZ5OXhFZVUzdzFqbUQtWldiTkhmMnFsbGtxZjFleEdScEFXeFZQeWx3clkyM25hYzJpUnFZMFZUcGNsdmt6VVNaZDlnbjdVVjdhcE42eVdrTkNBNTdpbGJlWWlaZVBMdVZTLWgyTDRycjhYbE0tOEQxeDcwSm9JUXE5MWNWOW4wdFVVc3NHTDZOWkItZVdQSXJBQnpqb1ZfU0FfNkh3RkQ2Tl9DSmVGZF8zZGdGLVV2VF9xMkVBU2JEeWFnOEplUDJoVzNBNlo0NlRhOHo0RWdmalZDQldEWGd5Y2o5bUlFUnd4UWFpYXpvS3NZcW5fSjZNY1RtaW05OTZwTUhxVUFKY3dPa3d2ZURyakZZQ2MwSnRFeVd1ckJIMVlYeVVaT2JHNVlENjg3RU9CTkxzNHpzY1diTENzcUNaN3BWNG5hVE9vekVqdWhWVXZGZmR0cVppdkpQT01PS0NSQUNjM2htOUhHSTdmMEdBOGdibGpHVnQzZGpRR2NMTmk1d1V3Q0ZJVFl6RE5SM05fZ2wtNjY5Y3lYejN2NklfMngtOTN5M2Jzcno5T3pwUnU3bTNsNzhOV2ZGbVgyQ1lZc3B1T3hoVUVLUUwzdTAzWlRvajQwVUExeG1hUWFraXBUd0huczV4TmpRNVduMzRjdEdWbFdWSlRHV1kwYU5COTlzSk9CV1RwNDZFVGFvWEJ1QVNvdjFaSjBrOTdvSEZhT3piOEtyWTVnWWExRy1ubWM3c0tHa0x2ZS03REh3aFNkRjlLeTgwTTE3c2JRVjVPck5ZdkZhem91OEZFUFlGY20xZWxZT0VhcHBwbExsYjhIZUNFajF1Umh0aWprZklLTUhzU3d3bjZmeElaMjBhYU53al8zQXdSNjBjX0VuTk1zQUZxdkloMHZUYUdMZUROX1V5dVpBOTEyTHZld3EzM0lzSGNwOXVfbGxIQ1BzTm1HRVlxNlBvbG9oLVY5OHRQQmFjekNmUkw1QnFzM2IxNy0zRzNnbHBUZkNycjhzTDBINW5JcTZQRzd6SmtuelREMjYxT0w5NlhKelpNY0RyWmxGVDZzVjA5c05DUW8tRTFSaGh4S1ZzMnoxZWllM2ItMm9Hd2V1ZThlQ29kam82OUw3a3o0YUhBUHJVNWlPWjc2ZzA4WF9GNzVmVUtpNDhzY1BMRWJ3WkxMMVBrX08yc0RHdzhtYy1pWDlzeGdtM3pJYVlBSGk1LWlmdGl0c3pNVExWYS1LS3EwbzFKS24wLXBVbHhhdGo4RGxqMFZNWUJjV3dzZVQyUDZYSEVUTkFZN0hHd2gwZWZQU3FTbHNmNXdHTk5BRmZvNFJ1WWJqU2YzUGE4b2VNZmdsbWF4WUlpSHp6b3ZWNnlyUnpST3pYOUVVSFl3c0twaHhRR0NFbVNOanBGaVpXUm5BU0hvMUZmRWw1akNlVmZzRWF1VWxlbTdSdzdRbmJMbXJBZG9rOXVwVy1vbGtHUzhYMW9MM09Wa2p5amVDcnctV09pTGtHbTltZlBmZ2NITzVQWmV0OFUyRS1ETlZHM3ZKVml3WmJBQ25YYmhKekdXY0RwbHdOUm1xVFJkYWxwNTFER3Q5Y3J3enAwN05wdkFZS0RCTk4xazRnWjk0SU9Cdm1yaFRza29rZW5XdVdraURvQkRkNnZ1cjZUWThUZXI4eVhkLUJxZllBRVlSbzl3SUM4dU90M1hfMjgya0dQTTVLZHdPNS15aldCcHZWS1FKb056RzhuYVoxQXR2S2FKV1h3amNTS1VlQTJCQzNac2M4THQyMll6NFktb2NnQWVGQUVRQTJMQ2pFa05JLUFSWWxZSDU4Z29RbDZfZ0ZKOXJIN29HR0pCNmxlS3FKRU95OHc1S2loZlZIZm5fNHdRMm1HNGVkd3h6emVYOTFyRE9qdjQ0NkgwWjVGQlFic2ttOFhHTmRkVV91TERmTnVPbU5XMmpKTDhzWmN0RFVVZmhhMmhwQkJOajk5RmVHcWNZZEN5QlBhNTVkOGh6SFpSSFc0cDdxMENZQWFuS09oQlE1Z1lWYjE3RDNTeE9WTmZrcjlHVk5xZkpMYW5memZKU2lPN19jRFRlbFZUdUhKT3ZFSml4MmtIcTk4V2NENmVxRUtjMHZ4NndXMnlLNEF2dWRjSERTNjVPb0gxMjJqSTZkdmpoR1hXZnZRc1VGUDlBbGVGbE1oVGpybVY5d29UMnZXMW5RUHA2QjdNZnFOSVFBMEZESHlNM3lJdE1vUlkxT2dhX3hzd0xFZWtTWE1PWkNKbXYzVEV3NjNQQVoxdlU1VnJBMDZBUnd3cE1weGNram5OaFozWmZxZ0FtZTBlY1NMZGRQVkd5WGdEQnZDSnlfaWZNLV9ESi1xTm5jd1pjRW8tdnZmbTNDMzExZm1XcFFXSkV6S0t6ZHhRWEQ0WVowZ2FORUsxWE1zRXJ6eDFrMWswVng1RmNUOVM1SllVV1V1djBJWEVzamlncVVxTEo3dHFjRkpLa2tNNlAxV0ZnU3BnRV9JNk14YWN4QjFQSmZncGUxRHRwaGIxVHI2aDhiSi1zOTNLejNxanBNWnh5ZzU2Y2oyZUQ1SVd1MngzbUhNRzViSnhPVUJxbkJWeTEwN1NvdGx0bUpRZDJJWHFtNy1Vd0lIdHFDVm4ydXNRbWZyOTl6MUR0QTRRRDRyc0t5bzkzT0JpVklVQ2xMMVU4aFVBX0YtZWctaVh4UXl4OWZlLV83QlVhYUFhWGpVZncwX19KeklyOFV4V0NCS1k2ZEJLeWVUaEdKVWtpUDVUMkYxSFloNXc1UHRXVlljM3dxNzNjYUdXMVNDVzdRLUpIRXJSOXFuc3AtenBnMDNHeWxSRmFOaWlSMWQ1bFEtUjRNM1ZKalFvYVhWWmVBRlFZalpGakxYUjBMX1dOcFVkRHZ0aDZNMER5S1FwVllDWnV2MzhwdGREY2VxRUxiZTFsQm9wUGQ3YmlEbEVoVUZveHEwU3B1LVBYNEpGN25oendjaXh5YzktMnEwTk96WURnWDNXYnhLWGt0X1Jfak5FWndDSGZUYVlaUnRnUHZlemlDWHRfNUVUTlI4QzVpTm5EQ0V5X0NROFdvVUpDMzd0QlVqWmtpcE01U0VqQlZ2OVItb0ZmM1FGVkpiTkk5WVNtQ2pKWVV1Z3h2ODN0Vk9FVWhHdkxaem5hTjlWWVhXdGpQSXNzbEJ3V0hfMVBBN3F3cGlhc0VKd09keFI3RDlZdEdBWmFLdkNZaWZsc3BGQlBMNXFid05iSnQ4VFlZRHVHNzdUTFAwYVN1Rm50QVhKcU16RlhlbWR1eG9FZ2dUWUh3clNnbXNBb2d4UVg3UHEyYWhDb2I1cnFFTjFJcVlxandPTkw4eXFsS21CZ1Y2YVhjZ2dRUDREa3h1OVh0R3JBOGViaTlhMEFrdlNHb2g4RTRXdXg1OTRuaEVMdks5RjdqRGZ5NW9nZzFKNHItMm9mUjRPaFBDQXJtMC04b3JtenktbXYtdkZsa2ZEbkpKLWI2Q1VGOWdNbzEwaVNld1NualBBdWNGNUlQSEhkUHhtUkJMWi1lb2V2elBvUUJiZXF2RUdLbjlFSmIyUVpzeExJVXhpTkJuOUh1V1FtemhZQzVhZGJYdVFpNWxXUDJCXy1tUW5HejdPTkdOWFZpTl9xaFJIbDRsTXVuZXh2VVFMQzhxLXBQU3dTcGM1NmJRR2ljMnBQamJYRzVUWlFYeS02QVNqaG50TDViM0VwWkZQZjZ6cG9ydmxISm8xamR0SXAyaDd4WTVxVDU3S3pLZGxpc1NfUFhHMEFYTWVXd1RRY0lvVXVJSmowUmdHSUtJb2VXVHNHZklveE1vYWJ6OGdnQV9DSTRncmVmci1tb0k3TG8tang1OUl2OGtlNXl0S0lSODJHcWg5dkZROHJtRWdVeF9Ia1hnUDduVVdKaWNaTENjejA3aVlmVXRzT3RkMDlEaEZ3M0E0UFlmRzdLaFFoay01OXRjaFk4M1QyLUJ6UndyQ0RXRlB4Y3lSVlpLZnpMTjJIdmVMMUVweC00UWIwNWhFWTcxcGhISTlSZkg3T1lrc0ZFWjdMdVNUZ0ZFLWIzNlJXdVpyTWw1NjVxZ1hDSDdUVFlYa2NpQUFLOTRnd2dyWTJtSW9wX2FETjd2RWJHU2tsSjlmQVl1Q0VtVTBBc2IxVXJIYmxsUzhJWFprenlCRkNfY25UbHRGZHM2eDBYa3FCc3MxTl9lYzlNeHVnd3VkMEdoQWlyZDJoRnRjWXhHYUptX1F0dW5ORWhETDdwcE9FXzQ3ek5FWGVXUmlmSVVfandjdXllek1yZGxkVWxmcnJoUFVVY2RLMWZnSzdmRzFJOGJEWk5TRzgxWGdKdkhveXlCSC1OYVVXWjhhZDJoRjc5dlF1WHo2bnkzb056Ml9MMVpuY01KQ1dJZFBFTlM2S1BSbXl3QWNDWWs3SEFWN3Z5R243Q2w5ZURJZzE0MFlWaEtQcGZTRG42dGY0bnhmb3dkZTNiSVRUQ202Y0FWZE1Tbk4yWEozc1h4dGVTLUNHTGJaLXppVlFLV0hISVJzZVZGOU1yTkxFQmpaWkNTbV81MXBLc3duUTFHTmwwSEZVdmJaM3lRNlBUZldjX2tXbGtoVURoQzByRXNjQmZxbmdMc0I5dU1SQ05QZEtYYldxOVZMbU1rVWg3djZLTlZNM2JjYlV3WENNM3pvMUtRX0JndGdUMzdVUERTR3hwN2tvdVhlaVpHV3pBM1ZGU3N4RmtycWNjZ2VqM3ZjdDE0Uzl4QTVUUlk2RE5hUjk1ckpXU0dVRnF1Unpiek91WjNhek1tdFJwTV9vaUVHWS1Zbmo0MjRha0E5TmFDQnczWGVHVFl2ME1iWGVnYVdJYnFyclBxUGNJMjVDOVdONUYtRTlIZ0J4THJxcXdmMjdaRTRmSlNFc1dGM1ByN0k1MHZscXNLZ1JwMUp6QjVnUXVQWklzOXFZOWZsUjNjUHhhaGNTaFdIZnRkaVZQd3dFZXJIbk54UjRkNm0zamVhd2NjNXNPX09NR1BaeEU3OU9peE05R0tEY0pyR0c3UEhHNzNOUlBHR2pLa29NenI2RndTVG1ST3VBQmdvOXdXZUo3Tkw0YURIMkI2a0hYWUpOUDBHMU52S0FtcFdUN21SR3pPY0x6Y01JQTVXQVZRZ2RNNjFxS0pGOU1iMGd6WW9Oc0d3YldiTUtwMVdfc0xuSktDVGhHMk1jWFlPeWZJelNRUUhOVTdQWDkwRDVtSjc4V1hhdG5ZeXpmdE4zeDczbGhyN1g1UjY3NmZuY0F5N2VDb21OMW5FR041QVVqVktTM2FhN29qQ0FIbVlxc1dOZ2pQeVdYT2NJamhsQUtNdXdhMF80X2ZZOHR1MnI2V0dLb3F0dWUwTWJHNUpqUTdnZ1JBcmk2dENWcVNObXU4YXRGSmQ5ai1WSzVrNVBWbUdBNG1kSEo2bUh3Y0NvMWhaR0RFUFhYQndzY1hQZ3ZsQkhqUC1XNmI5aDR2ZU44b1JMTkxZWEFzOFJqUFNKc3AzVEg1b1V5NGg5Y1JMRDFxSm9Na0ptNWdVNEN0UXpTdWNYQVI3RGJfbnRoNnplWG5PUTFrZl9McDhHV25GZVNlc1RsWUZmaFFTZEh0NzUwNE5fRjJSZWx5SGtOcWxJaVk5OUZoTE0xTnFIcktvLWpiWW1MZ3RHME9HYjhrRTFfX1NnUGNFWmExQzhYTC1lbE1QTVBoNjhHTVFORnM4UlktdnFnT2lpMW9NY3dVV3UybFcxN3FIN20xeEFrOHRmZm56eWxOMU5WbkRkVUhSVTQyWndVZ3FscjhtMTBEUG1aVFJtaEdwVmVJalhEbC1KNF9nT2h3bWNzdzJSWDhndWlLdWRNdk9WYVRkOW1HWkREVThHX1dPb1ZSbzlES0VObklLc1FUR2JKb0t6RXVTOXpqMU03eUhBT3c0NVdjajNuNVFNREpLNnVZVURLczlLa1owNzlvR0I2NXpQRjBwX3Z6Z0otUWtSQ19adEJRX1hfamZzaUNncXdBUE1tbGhpaVNkS2E4T1hqNkRjdnhERGVSeXptWmN3RXowbDFWN0RTZzZ3YVZ5X1FEc19keVNyZmVwc3pMd1ZxVmlDZkJKM0M2YlJmNlZDWE10dUZRWTlPRzFBQkNyRlRTMW11VlM1NnVBRjktSnRxM09LZFVHZ1J4dVBZdERWc2xqS3lKQnZ1RHEtd3BYNXZXYmwwVHpkOTZjZ3RLTm1lVngycndBMEJGYTZPN0h2Nl9abjk1ZUlRN1Y0R0Z5NkI1eVZYTGFPYVB0MzFfellkdDhUSUJPVmhKTVpqYkVUU2tZaTRLaEVhLXlMemdPSk03TF84SVg2Q3dvMWZCZ3NMeEpnRW9Yd0pXRjNvWk90LW9GOTlHMXhFRWRSbVBPSlJjODd0WmdjM0QwMGZ1WHpPRWo2RUwzNi1RVTRVVUk4WUlaX3Q0bWttLTE0Z0FQZ2V3WlFVWjhCRXVmUGJ5YVBxLU53YXJ4Z1hFS1BtNG5PSWsxeDRLZXR2R3drdlBOTnBrQU01UTBWWWZETVc1cHNGMTlYMG9xTVAydlo1dDRUbTJtRzFleENVYmZWNUZBOURvb3JxUUZNZjNrRW41VzFSbmNyd0pxR2NrTERSOHVfT0c1YUczeWZ0QW9ZbVJHQW94YnBoMGRUN3lrUTVmSm9OS01Fa21XcllGM2k5Vm1CMkdXc0lIWTh5OXlSWlpiVEVtUHdOSW5xWlJhdXlYUHloS0ozSEdmSXJzeF84eVczU3hHWWpVb21UeHN1c2JmT3FFZnlkYUNJVkRHcENCZ0RaNkc1S3lZeHZfWndBcHpRLWJpUGNFSWw5aFpMSV9rM0lJQ2dMVUxEOS12YlNGQWR1cDRfd2plS3dyVTFLcWlwcVVrbFRNeU54dm4tRDVscWVoUXZ3cG14SmI3NHlsdzhvR2RlMlFlWFFwWGxucjNXUHozLVNlZk5zT1NTSkw2ZXFmaXZJbGloODgwYWtwU3lhRjdjc3hQc24yc1pfQnVWcVVrdmVIUUNFelJIWi1LOW5Yb2VQWS1fUF85YnJ4TDVXOGw3RnJ6U25UaUp2akp5LUVIZnNuaTRKVWRTUXRreUNWM1RXV1ExM0dDb3hGODVrYWJJUDBla1NSNXhQMVhDM1hxY2FQdU5QNzNBLVlBLVh4dEFnX2ZYMjVGcTBRazVXeEVjMEN2NE5VVzdiS003QWd5SUxxNlFXd2xOUTNNZl9PM3Y0Q3gyN3BfMzV1djFkSVRLamRvNUJsZFFlRlhlQkt2QzNacXVIaFM0YUNnb0dUdGU0Z3BUM2xmRlpZSVZLZlNpT0RJTDFybU02NV92RHBjNGRWbF9aRkxNczJqejZWajQ1bUMzZVBpTDNPekJBN3ZzWEN3dnZaVFdGbWR0SlpmNGdkWksxRWRtOFA4SXZIRkpJc1JDV0cyZThyd3hjb09DV0tXdFZCc19wODZRRXJIdDlLeDRaQ0lnUVpFR1Z5eUNERkxmbENqeHhPakhvdXlKTGxfYU9hUUNQc1N1WExaVWktNlZOdTA3Wk10U2FLU1BHbk9VVmE1aUsyMF9iaXFFbVVXSnlHMWtLQ2pvNzJPR0RjVGQ3aDYyYW9ZdVotZi05VW1mOXc4TVBwRlJ4NWpuRWJaX0VtazUzS2k1U0VvbGNzaFJDR3Q1MzktdEZvby1kYXY3MnVKbHR6LWtNVWh2dG90dG5Dc19fdGdtbTRIeTUwWDlUb2N6d1hBODV5Y1hNUmdUT1pVRnlOUFN3aDcwa3dvYlBoSEdSS0hVcXpQSXozcmZGcVRyN0hwY3Jqb1F1V1o3QW13OXAxUXBrTEpGMzRpcHRvZEF4dmw4ZkRkb1JGMGZ0MzRIMXJTUk5VX2c0RlhOTC14amJVVUlmNWt3RURXclFRLVl0Q2gtMXlHSnNiZ3ZqdmlPRktLNVJob0hjY2JXbkNnX2M5OUdwV2ZoQXNySGE3Vi1kT05ndEN5SzVoYmdFa2p1X0E5b2VLZHNHOW1wQTFsdU90TVJmZlRmbmN5Z09hVm9kT0d4cHQyUzBJN09kYVZfX1NwRlVvQ183N2Q0MndyM0NRUnlub3YzbkEzblpqYUdNSUVkTjl4b3VNRTZSaXdyUDF3VFJoTXZyX25RZDI4a2p5bFktUkFyU3pVd2hDcFc3M1dRQVd4dDBlUkxCUFRXYmNrQVVtdnp2Nld2S3B5SDJsZkNmLUtsX01tWGVveTNlOGRSSXQ1Y3dBdFBKa0RYTFEtWnRHdTBiREd1cG9HZW1MOHcxcUp0Z3NFTzRMTFkxdVFKM3hiR2Jfd093cWlPZEdpeFVna3RKOVJGUmppWVVyYzVINE5hakFNRkFCQnRaZktTZF80TkE1dTl5Wm8zTE9lSTNxMjlUVnNpaTZQS2VQZzZMN3MyVTBsZFBnU0Jud0xta1FfWjJoeWtsTzJyUWY2MVhsd3Y4QlFRekRQZGtxY3VhMV9YNDlOXy1QbzBYM0tqSWhLNWdwdlNHVlN1Ynd5VjNzbXJqNm15dEdWVWE4WEFxaVJSZ3VaU09scG40QzEyNlZ1MVR0NkJod0xhWThpUWhab2dabnhXVkNQZVBHVTgydnA5cXkzcFFGZmo4SFVOVkZyMTRjNUc0aU1xLWxNc2E2SFlHVlFrTHRoSXkyNFBTeTNfVzhTOUx4M2s5LXgzR0t2c05MQkE3Rkg2UmptSlRXX21STGhYLUt1SDZNTExvLVB2RHNWYjlBclp4NW5uVEtUQVBzaG5XSTZNck9nOUJ2WkdVVHh6ODlwV0JnRGRDUFRiQmFVQUYyRE1kRWh4eFFHLWFzT0t3Q0QxYlY5M2xGbWN0dFBObW85cFc5WU16VjEtdnVQMUkxbXpyY1FXRERDTTI2NmRDWUREbVctcHZzTHh3T0xaZ3pReVc1dXpMenZrVVFLc1U3WDhONXIzZVJLMTlld2Z1T0N3RnJvVld0WkdqLUxiSjFSX3RQSDYzbmJmbm9LdWRITlZWMmtMMTJvWlZBVmxjeG1XR1B5Wnp3LUpqSUdGREI5VGtfSEtaenBQQ1RFeS1fMHFEUzFWTG9vcE8ydE1JcUh6RFhqbGRJLVFSUUhSSy10VTlIM0x6eUFhR0dHc2RlbWc4UG1DM3RNTHAyZWNVbjFNRkZuS3o2WThuSThVbVFJeXVFN0NzSmM3aHJlM1Vzejk0alVyRHAxTDFLQlB6WHFvN093UzFkTXBSdFNXMmtfLS1fZ3dMOWxOWUFIQ1luTlB5VWgwYkU5cmxsbktzaVZMOFd3dWdNWmZTdF9jVTRuQnhhVVhXZVpmc2RDSHQ2NFdtdGtCT01ZdWU3SHVzRE41enQ2UnJTa3ZSRjNuNTJsSUJkVlE2cHo0ZkM5T0ZJTmtlNnppV1VNRmdJdVlJOUxETHhnbjBmR29YamJLYUJlT3NPUWV1YWJoX3JpV2FuWmwtOEtYS202djhVZzJPRlp4MFFDZ3M0cU1OOUIyNXZDQVhZc3I5X0o2enRLUnhpamswX3pMSDlldnBNY1NsZ0JmZ3RKaXRQT2RSUWo1TnBDMmIzUUtXNTZ5cDIxS05ZVE1JaXdveTUta2ktVFRfU2FRbW9UYUU0SVlPcjZoODZZNU1ZS1hPazZMSUIzdExlaFhSUXhNZzdXSWpzWDZOVS1tNlBsQjVtdEo2bWt4SHlyNmszcnFBUmNhcXJsSkQ4RDE4MFJwa3BtbVlQWGFWWEpnQkN5ZGE4Z2Z1aEVaelY5TWFUVmFOeHJnV1pwbUpjTE9zcXYzTVBnR2JhcXN3OWtyQ1Q5dGZadURfT0hWek15MzkxVzh2NmdTR0NRU3EtbkNBLUhDU3A1S1VMR1pmZ1hRSm5fVFlZVFVETkxLQS15enItQmM0SXpzUkl5WjhuV00zZnZFVXcxSEdOUlJOZ0IwMTRoeGhzT3NzSmNvaDBaOHBTRjJsNVUyaS1SbjRjZENlTllXS3MyTFNENGM5VWtnSnlpU2Rra1hudmlzQjZzaF9TQmszLV91Vk5rQXFuTDVielhTVnMwSEFiTG1EVnFyVHExVzlnWHA5N3d3UE40QnJXOVdaaGpaYVFaZ0Z4NUh1VnZGTjVUUGd4bDl5bHBnbHguY2hVZVAzMjhCY1ZrSkxyaVluTjMtOEZ4cEVUX2pZMmpYOThLdlVDMVljOA" }, "StatusCode": 200, "ResponseHeaders": { @@ -417,17 +416,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "39b74b44-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "94" + "x-ms-request-id": "9e0e6946-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "61" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": true, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, "key": { "e": "AQAB", @@ -439,9 +438,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" } } }, @@ -468,20 +467,20 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "39cfc282-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "19" + "x-ms-request-id": "9e22290e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "18" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": true, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, "key": { "e": "AQAB", @@ -493,9 +492,80 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" + } + } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/key%21@%23$%25/backup?api-version=7.3-preview", + "RequestMethod": "POST", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "POST", + ":path": "/keys/key%21@%23$%25/backup?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "128", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "9e2f4d64-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Invalid key identifier or name (Activity ID: 9e2f4d64-61b3-11ec-985f-000d3aec06d7)" + } + } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/restore?api-version=7.3-preview", + "RequestMethod": "POST", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "POST", + ":path": "/keys/restore?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "28", + "Content-Type": "application/json", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": { + "value": "ZG9lc25vdGV4aXN0" + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "192", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "9e39843c-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "error": { + "code": "MalformedBackupBlob", + "message": "Backup blob belongs to a different crypto domain and cannot be used with this instance. (Activity ID: 9e39843c-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -524,19 +594,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "39dce07a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "78" + "x-ms-request-id": "9e43c014-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "75" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": true, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, - "deletedDate": 1637185333, + "deletedDate": 1640018462, "key": { "e": "AQAB", "key_ops": [ @@ -547,12 +617,12 @@ "encrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295", - "scheduledPurgeDate": 1637790133 + "scheduledPurgeDate": 1640623262 } }, { @@ -578,22 +648,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "39f2db8c-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "9e5988cc-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "33" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": true, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, - "deletedDate": 1637185333, + "deletedDate": 1640018462, "key": { "e": "AQAB", "key_ops": [ @@ -604,12 +674,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295", - "scheduledPurgeDate": 1637790133 + "scheduledPurgeDate": 1640623262 } }, { @@ -635,22 +705,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "3a022204-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "35" + "x-ms-request-id": "9e68f83e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "31" }, "ResponseBody": { "attributes": { - "created": 1637185324, + "created": 1640018453, "enabled": true, "exportable": true, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185324 + "updated": 1640018453 }, - "deletedDate": 1637185333, + "deletedDate": 1640018462, "key": { "e": "AQAB", "key_ops": [ @@ -661,12 +731,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/3e395e0af794036380e794cbca162d63", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/backup-key603254295/b03e43bfe25146653114e8e6734dd12c", "kty": "RSA-HSM", - "n": "suU5dld_gRQEETdIpN4icTQWDtGDdToBJ0jOjfqb2LjXga9lQrQwGP7JHqXL7z2t8wsZasB9w-Mn0fASPcGb4uB1YP6V_91lzDBMvHSRcGgF1yL3K8iFu4Kte_wx60SDaiOXboRlUYltzDO0vle5uvkS3xQS9yxy_7EhTFAC_bZf9yujOJvo98YCWQLyTILKKqsxkAg3w1kn86bbwUwVOexE1-6njtITgOUrO_4nycmEcH77B3zx2MoTwJhUUGhjZXNxvFGJn2FHVF605coF5T3qwhKyvhxgXHQmi2GLqkJUU1uZYuSxPE4vnlwoLwdXAbrn2KpPu8MytNC2qESNww" + "n": "h7FkXp_HTRPO9u_FMd5dCCm2NgeuNmMhE_DM338g3qY_15vWWn5d3dmtJXmL0eNeAILaFxKNXKqgNYzNMlxNTY7HuIlDLBslQIXoTKKbpS9OGaqrhh1J10p_Kinx2lFgYTvRVu6Mi-WxoFrIGIraUKkplhhPbt0Iw7pcey0r9r9wo_gHtIKksseGmPdXK-dPmTqfix7FxwH4RxlHj2pfy1YcmA_EHRaXlQldsWGSyfpadQ1NgKJMFx959VUA_rml6QdJrWeINaNs5HCC_U-qqiDY2gcDzcZFw8O793DmxXkwdcYGlff_b8YEIfRdQQ2G9x4jr23gdQbAJDuFrtfheQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/backup-key603254295", - "scheduledPurgeDate": 1637790133 + "scheduledPurgeDate": 1640623262 } }, { @@ -694,8 +764,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "3a11ab20-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "112" + "x-ms-request-id": "9e78145e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "123" }, "ResponseBody": null } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_NON-HSM.json index b974c79ccdec..298a812e0068 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestBackupKey/TestBackupKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:23 GMT", + "Date": "Mon, 20 Dec 2021 16:40:40 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e9992519-5249-4653-b5e8-624c99fc00b3", + "x-ms-request-id": "a4c2adcc-63b3-4b24-a699-cb9be83da42b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "693", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:23 GMT", + "Date": "Mon, 20 Dec 2021 16:40:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d089f671-230e-438e-a3f9-8cc74cf12333", + "x-ms-request-id": "1bf01061-cf59-416e-a92d-706d7c9a9029", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/c739ce059c4c40cdaff9e6b747d4f80c", + "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/6846e40e9aba48f98d604508990af9a5", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "2fDKZM6HDH377J4_DPdBYPECe9TaTvehECH3izi-vtjBbk91vOm2MoHN79QJGs2RwHQdQkEvqo3saJlbCuDNdXJd_MH2E70LBj7iK52pLiIzeZsUaUnq70JhQH3z-x4vjSU9-n2LXumybsqGpAJugNB9_9R7AEvdbE3uOsH-3lHAB-_AO3HQdxs-1E5ML3p_ib4W8MNiFc2M24G2Yidk0z3jn3G4t0eoycLu-7Q4aavtG5pgPLZL4sHmjAqjOu_-MN0yweZM7XAqKbm1B5Mf00fMnp-BxQmRA667PilK81D2m6QZtcIdXzfA2SkrzqVTg4211ODhI12sCp_Zh3rQoQ", + "n": "-LoBXWRIHj2lypE0QmxZNhuj2jZtSdHZOXsT864PNa5CQSzzTOZ3KGH2rRG07mwDWk6kdeSn__oDl_veHog6qB1ZELxGnCZmp66V_YRKczJ61QQGUmjl5cFO0CqSqW-QtS4ExRpyIeO6N9eI8THourGY7FCI9eR4Q9XUH-P_qUzAPpF5Y3veXvJHuzPKx3rL4pzY0YVZyYs3fvW7bpgKRjLasnxH-JL0JdtTvSV_73zPqV_4H9xyPpqZTgP0tS3ofdlvyL0WcbVzogKSYmhXg0qq_6HuLZ4abVvXye95ogQgeGCGTUhlJuygyxgDx2vfcKSByPAfgajoUKjyA84EQQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070364, - "updated": 1639070364, + "created": 1640018441, + "updated": 1640018441, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -115,9 +114,9 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "10499", + "Content-Length": "10584", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -125,11 +124,11 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "89c49b6d-9380-49ce-9220-183a1f216fc6", + "x-ms-request-id": "ced332f3-5573-47b4-ab0a-74b0c2e83118", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUl5WVdabU5tRmhNUzAzTm1Ka0xUUTBZVGN0WVRjek5DMDJaalZoWkRCaU5XRTRPVGdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAuZDlBMVJGOFh5NDltWmVVeTVGRi1ZUWZZSncyX2RkS1d0aWdmN25lUk45ZGZzQ2llM2ZGVlBQa2ZvNlZMLW9md3kxcWlaMlRPYXFVSzExeHFhTXJyN2ZGeTNxeURrS0h1MHdRX01VQ2pkZlhKc2tKVFIxY1c4YUFULVZKSGU5R19tNFFwdkI0M19WVWpIaVMtUENwREpyY1JHeXdGR2RlY1Jyb1dzalpWdVRNb3ZyUC1CWUg0UDl6UFM5M3VtaEFiZmdIbEtyQXRUWUlVMEZuNmZvYi1rODNPZ1pqd2E0Umt3RUxJb25EX1ZFZmNyMFM5UkwxTjZkMl85TkZVa3c2d0FhUU9CZHEtQ0w5X1VpY2xPSUZVVFJGM1psb2t2SUpDQmhyOEJMN2gybFBNcG9oOFBwUnFmOE5MdDNPWVc4a1ctOWZyVkpIaG1VaG9xenhnU2lRSHZRLmNGRndJUVB4eFZienlVTkpqZmJLRHcuUHlvZExoQlNWQUc3ektRd0w3NTRDaVBTc1lSN0hoVWRfOW5pbi1IZ0ZQbExTNko4cEpER1FLY0JyLS0yaGJTaDQ2Zm0xR1FwYTlBNmg0R2FMYlpxY2ZPVmRqX0xZcWZyNU5CLWJYQUVDc2EzUHJfdmxPM01qeWhVTHVRNWxqOHhLMVh1TGhac0EtNGZKaFJEcEVGNmQyWnZLcDJ6SURhU2o4bkJQQWNnY3p2YnhGWjJNOER5LW9vX2R2b05nbDBWX1VrYW5zU2lPb3dnNUNleDB2V0ROSEpBdXo4dlZjdVpqUWVMOHJRdVkzRWpwRTJ5bUNpTzduWWVydkhvV1RyMUpBeG9fZzlYcE5mRzE3ak93SkVheHdreHpaT1hpa2EydEtMVkQ5cm1TQmJZR25lRkxHMHlhczZKZFFWZHNHWVlKWDEtUUJYTTJWOUFjT2RsQ3BGM3JMVkxXS3lPcUpZdklBXzdTR0t6R3FybjNNRmx6X1BGR2x3Z3VlRjBzRi1RRE9TNVdhY2VIbzhqUXNWWUE1NktGc3J4Q1IyM1VPZ3ZDaEkwa1piSTl2alAwQng0V3VsUVNSOXNvVnF1MDhHWVVBSGlsVEpFWElFVFhqNHVZWmZBZmcxeWEyX25uTVRqaTFka0dVbG1hQ0FiYnR0R1Z5Z1NvVndJNEVFUG5yOExpQWlTaVYzMkFzb0hnT3I1Ry10Z0JkUk52SWxaR21QTUVZOEJWdU9JbjdxenB3N3ZzcWNfNnZ5UGJ1Q2ozeGdQa2pvQ1FZUllSV3otNGd3S0Q1WDNPaUNrNlpZYXNDd3BaMFJmSV9ycXFGM0ZwU0ZFZEZUbEFQQVRGUGFHQWVfZkJlS2VkNEtNYTF4YUIwbzk3cGxSRDVRSGJ4N2lia2FvcTF2dzFyYUljaE1ZUHBBbkJIVFVHRHZqRDNHd2RFMmFDc1Nsak5mcGVpRkluazZjMWFveVVLZzdTUFhfVTB5alhBSEh3OHVQQkpuY19rWXBYSmtlUUlRb004cmZsRHN3bGd2RXM4ZXYwSU4tc0FBTGgybkJVSHZkRWN6SGdFT3lmYjI2aUdFWll4bFNGRjR6Yno0Mm9JaVRBLVluaXZJZWVDaTM0RGpfeWNMemhFVUQxVmlwSUh2RG5sNWdCZk91QWt1VTczUVItMlpFSUVpN19PeFFUV1RwdHptX0F4NEswYlhtN2JBUVZGRWVaZE1kdE85TmlBZXQ5TklGV2k3MlR6UmVlSE1HWHhlNERwX2pSSXZUeFEwMkdpNHZnRnU3NkVSY1YwdDJKRDBpSFY3eG56TTh5Q3NyOFk4NlJWVWpsaWdQeUtoVlFaM2lKUGRFVkF1ZWZlTDdlOU5JTWp2bkdWNlN6ak9zMlRVT3Q0YkI3cDJYNlVZenJiR01UdC0xOE43WG5vcWRZWWNLMnFxbmxQd2Jya1VpSFJ6Yy1wN1NzNDJjSjBhYkNDS3p1VE10SElEcDZGcU1LdUQtdlByeVE5WG1zc2hRbUphUDFOVUlhMmFPY0xVSU9GemN5Z3VsY29veHI0U2ZZeU1OZDJHVGl0ZVZodUJ1QnlBTktsU3JHSVFkOWdIQms1SGo2a0lxU1ByYlJfRGVodkdCX09vTHBaMndwbno4QU10bzBBWnB6NmUyUncyNG9fVFdsM09Rb3ZiNkt6dlM1M01FVVlCTkRkRUdUNjdLSEhxMTlYYXhFY1RjVlI4Mjl6NWJ1Vk9zblNGc0MwRXhlUUI5XzVaMk92MHdCSXVWVHhPUDVIMzBkZkZOYzFNMVZ3azV2RW8tNnc4bmFta0FOM0NCOW93bkFrX2ZkM3pJaTBpZnVEMDM0WnFneDlwVm05eHRTZDIwTTNlNU5pN0FJM1hXa3RySzNDWU5lY1JTZmZVcjk0ak1UMEwwdXA2UjYwNm5uWDdhMTVDQ1dNLU52c29RWDItTG9mNmNOU1BtVi1wSnZ3OHBVYzhxb29McEtJRnVtSmtsQ2lPNWFkNUlSSjlZMmJ1ekhBSjZKMUZsdFVERm8xQ1RqM2dpaDd4dUNIYWIzOUgxV2tNUlp1aFdfUDREVDJOV1dXaEpxVE5qVzdWVEVtT0kxZUpEQ2hBWHJFS3FJQk1GSFNmWTdVV2dwUFBELThBa2tZVEpOSHBzZmthUXhCbDhnT21zWnpuMUdPWTF6R3Y0NVhXUEhwS1lPZEpKcUQ2UlBCZlhsMEZJZDVxN2JNXy16Y1F2OVlQdEFjNXViN3M5ZnlaY29Xb1VyemN3N0NKQndCNS1YQU9QaWdNcUdSS3hnX2d3bmd0RUVPOExhV2lxVndTSkFLbUZLVXdwdy1FcVBqTmRfUnM1NFI5Q3FoMjdEcjFsUDhFckt1bzczYmNQb3JfVlVyeXExSFZFWWdCMk44aXVNOVJaZVNxSUJQMjkxUEtiakM2SENBd0ZpVExEN00zOUo2T3NtREVQSFJYWUVtRlkwTGstQUF6RjE4WGNqekI2Z2pveDZ0NGdMY3A1VGk4MTlOQ3dZU2o1dG9pQjJqdTgzM0ZvRzluWVZNZkNiU1V3QURyeDRBQWZfek1HekF5ZVNrb2w0SnN1T3NwUmhEeVRxWFFzWlN6cnlqN0ZUZ3FfNEV0ZjJJQVMwNEZqWFlPZkIzdXB4ak0xVFlIRHdhWE5JYzRGR2JNbWhZeXg2ZzZZWVRMVWxOZWxhR1FkV0UyQ2xGQXFZVFoyVW9CSTB3cnBMSV9iTXhkOWVSM29fTGt6cHdJV2JrWXdFdVp1dC00V1paUEM0MzRQdWdLSkRtY003S1lwTDdId1hVTzBVX2VoSk4zNDZ1dFdCM2pSMjFUbjREc2tvNXh3WHpLamZoRVB1ZzJyV1g3X1ZxVHlRSTlJODFVUGoxX3FQbGFoN3lWQVJzaDNYeWNXZUpxZEN6MTBWcUtvY0poZ2ZkTm5LS3dtNGpIYS1rM3JhM0FqcXduRy1xOE9NSk9zUGZkRHhCZk45TjJUaUFzVll5QXhVOUVLMnh6TmJ2cGVvanVkMHpCUW04WFVuRHltSWhtSEd0aUJBVGgyX00xaW9sWXRfWThyUzB1cnFqYjZxN0F2cG01aVo1d21tdlk1bmI1ZnIyTW9QNmY0dWI1MEk5TlJLa2RfNFUwbWRxQmQycHpzZHF2N182a21rNThRYTNFRjBSWGVoT2lNN0ZWeVlWN3Q2cHZyZm96bjNEWHRFTDh2VHBDUk5jbUhWS3kyclJ6T29FT2pEWllsenZWWmdWSWxsTnNuSEwycDhuUHhQT1VpcmUxZDluTkwyQk5BOWh1VEdHaFlVNlZOSFlETDVTZjAxekVmendrdDk5RTVTUHE5YlZVZm1qRHprcnB5bGpMTm5qU0RER3dZbXJ2eFZjZGFtRXFuUzJUMU9fX1d3eUlrX3R3QlNZdXNBU3c1M0NkR1RrSm5jbFEzVXdULU5GekdZSEdQYTQwTG1HeDdUM2VDOWo0eWJjcVBrcG0yR1gzS1ZLd25Cel8tcTVDU1V0ZXZrTGlKbE5ITEl3OHBDa2F6TlN4TG5FYy0ySFVSTWw5TEhyQm10YlB1M2J1alp4NWFjUElRWXhsWTBWR0tyQ3NUNVV3ZkRnbkFmZi1xZldJV2h1bUN2STJIWUQyQ1Jsd0g0d0VPTHAyWHdQYVdiU2VtMG1ENW41RzRYclRoVVNBYUNCTXAtNXdmNzZSQzZtY0JmU3FYSmlqclRiZFJqS19QY3cxeFpEZHY5QkZpMVg2dkM1dE1LN01qbFY2MktHY18zcGYyRVdpMTZpX2lEM21sQll6ZXpXTXN2Y1d5ZE1MT19xR1liX3JSajlOYWNvQVRVRUc5UkN2b0NNMkdGaER2TEpGa3hLOEV5SzF3a3lTYXF4TEpWUGRaZnFsYmI4MEVVaFp2b3Q0WXZBSnQzaXRwdVhwM01OTnU4Rmt6Skc1YTkyREgxM0pfQzFNemtKbFFLc1FqUi1iekFTSnNTRlFPMG85TUlTYUsyZG5GSXl4OWhWMVNUcHNsVFFaa1FmOWpzRzJwZ3lQanM0Y0N4YjJUNno1bDZ3Q3lCN3hVb1RyYkRxb1hKb1dpTHo1dDFNTlBnRmRUd1VDdENEYU8wTWlqUlNvUV9CRW9fZU5YZEhxNWo2TXhIWVJBa2xHWW9HX1lXMGZtVEdDWUs3SUF0N1NudzVQc01OVUgwSjMzWnBhbmF6Z3FGOEttR1ctcTdzSVlTQy1yZkRFZXlsSEtzeHowSnh6V2NfYng2YkZxXzFjcFZQVzhQWk45MzE3clJJVTA4RXJfR2V5UVJjSFJBQ1lmZlV5MTZKZnp4MjZ4TmFjNHBYZ3VOZWJzRFBFVjhFZUlHenpvQkRtSnJNbHc4OE8tdENaRXh4bldmUHRQbXZpbkdWWE9yemdmSEZiT2xHTzhIaEVTVXpCUzBfU241QnJRbGtkZjlmNGFGRnBLcUxMWWlaWEtjWHNBclh0N19JamtHQ1ZPb2JiVllvVWpfY1lSQUprb2hKRndpc0lKOUlONzBVbmRCWFRsQWlEdDd2OWluaHhZMEkwRFR1SlUySXRfbFZzUTZqdmJSM3poUG5vRjc3SnZaeVVWa3AzQzdha1YzaUlrQnJWR1NZVEJNTHB2c01POEN5Wl9ZRlc0WldQX2w5bloxUTN5SDMtVHA3aUR4cXc2MkxmcDF6MWVCOWhVSGlhWV8tbjdEZzJmR0RIZVVocEVyMlVLWTBScFBYdmRKRUdKdmpMMmdkNmhic1c2X09IZ2poRFNMa05IY0JGUnhDQU5pOTIyS0pPWEZET210Q1lnaGxEcnI2N0UwR3ZsZ05XUXZVbjQ4bkRaZXA5NTFRYTdUY1diMEdNZ3ZsRFFOdEQ3RjUyZmFLeFBWdzBVTF9KVXYzd21YLXBvREJod3BuSzFpYlRwSGVmSmNqVmxHWUV6cW9rdEhIeWlyaTQ2ZkRPRHFUejB4cHVhSDBiaHFTOE1GZUZ3b0J2TzZwTUx1SjBZRkNvRUtwRlRmdF8tZGp4Q3dkSDdNbWcyQ1RxNnlUZHZJZG1IUUVWVV9lWk5fX3hiY0dmM2JELWpTXzJUeE5DMHVHY0Q2b3JPRUd4aERiRmxPVUtKMTRLUnNWbFNUWkxaVVBWbWFJVG5PbzlpM21HaEtFbExCOFViLUhHUEo2WER1TUttWFlWNG90UnhTRHBNR3dlRWR0dHNvUTlnVFhJU003SWxXREx4STZIdWQzaF9Dd04zbFVUd042N1JLTkdYclI1RkM4YkpHVGlHM0x2UGpzaVZ0R01PM3l3YVp0dDlJN194MXdvLWVCc1VMY1BmR0hqSWVtYlFWSmx4VGFvTVMxS2wyZ0JpVUc2TTdLN1g0TW9XR1A3YkpmSExxRHBoWEFxYXg5ZEVFLWdRUGZJUEg4T0xPcTZtMnh6aGNkTTVXREFYWk1rblo4ckNjaGV4TzdsQnpST2RYTzFNVG1nM09QQ2hmT29fM3hwZVo5a3Fja2FKWGg0QzNjdmxyRzZXTHAzRUZmQUJKSF8xX2V5MHRYaWlvWlhpdFd3WkM5aDcxWXBVUTQ4bV9DYWQ0T3daU2xReWd1QTJpaEtwQXNPLXFTZVRCWnZqeFpsYWNaMHY1RXppM1R5clJLbllhNWxHbGxGZnMza0hTaHBodXBTSDg0dW1TMTR4RjIxbUVuSVByd2xvb2tyS3BfYnQ2UVRRdGU4X2xGc19ZVUJOSmZkZVRQX1BlMjNqVHhoclJ6aVRZQUI1LUtFZlZJQlZUVjdKS1d1cTltUTBTTzBTVERFbGU4eFhLN29ndzl5cGl2Sm8yQVBiMUVKRW1jRFVDVk9zMUZTRm5BNzVrTDQ0YlItTWZJZVVrbG1xX1d2TTUtX21ydGZVTUVvMFFOWDZ2YktiWnl0MGVqOXNHdFg4V2RHQV9DTDBVcFlvRzE3dTVUYzQ0Y0xpSzJlSzVmM19DaXpkZlhYczZsQVVtSVhwUV9fX3BBTTNzdFVxMmZyb1dGZlZKeEFDVkRldEFyaGZvU0hkR3JrNUgxUGtwNUMwLVZ4ODRmQlpIQWphZUs0VXd5LThUbmNlOFJxRE0zOUlJQVhFR3Q5RjgtaEk0dnI1dkVMSFNfNHF3VUNPYXE2UGZrVG54Zk9VdlFDbVZFaWdoRG01T1BNQmNoZ3I2SWxHT3BvYm4zdUNaeHM3WnlzcVFjRnhRWnJfUVZIR2dicnB2VkNSaWp3aXlCZzlMMkRvUlEyZXZYVk41elcxQXRCbjlmNVZVNENpeC0ydGx1endma1VuWlRwSjdvWTIyeG55RkVWdDJpekdWd19ReDdXWlI1UmZXSTJYNUZHUWQzU3Q4bWNIOWR6eDR3Y0k4VlJscVZQTjZhWjNJMzRfUzRlclplQzQ1MWJ4SVNBVHZqUy1lNW5fTWtwc1E1VzhIX2o2MkFnTTJ6UzBvUGRUTzJ3YmJORG1TdlNlZjdQQUVjT3FqOEF1di1kcGpHbDI3ZWNNc1FNRWFRa0dnZHBoazJrVW9KS2RDNm9qZkMzWDJocEtGX09UVHZCZFVvYnBZMkFrd3k5Q3NVYXpJdEJZLWIzVTdCaEl4UVFvNzNPUWlLaHAzSXJ5NVQ2OEJpVGdwR2Z3bVdIR0NFZVFhODNCbnZwSUUxM2JTR3NIakd2WWc2NGVwR0JhbUdta1ctR0lFdmZIdW11STNBNUF3ZWljUVVxQW1rXzBvZWFMQ1lzYjdGRlk1a2NEa0JkOHNyanZsU0I0YzVsTzc4dUlxbEZjWGxJcUZvVXZMQ2lzODJZdlljbmZfSk5sbFFfSHR0TWZveXZTWnY4Y2xkNHJWSi1CWWtrWVU2LUx0REVicC1kWklmaU1QQWtvY3FpeUJDMU1yYzRsYzJVSXZUeEZLRzFVSHQ2TXZIVUxZVjJQUFNJSWttSm90b3EyTlp3YnRWVVlNRVczZHlIdzBPQUl3TC1Ta0JCR0lpYkg3Ymw2eThiNm9hLWVNNFRkaVI3QUFHV3k1THAzNDFhQWVZeTdYUWc4WXJJYjU1MlZLblJ4d1Q5TkNlRzNqSGtIc2VJNGNEaEdWbV9rdk5NN0c2STNwTGJxTzVpcjIzTFJJUG5UYW1JNnZ6NkdtaUphTXpPLTBwSGY0WXUwOFRlQWRPTGhmdmIyTnlRaVJFOG1RNnBpel9GakVTUGJpZlVEQTQzNFRnUVl3UXVjSW1faGdhS1U2RG4wTHNWUjJra1hlRGd5NTJ5bFFnRFE3WFpGSTkxZDVZdTdacnY4aHNQdFllRGJKVXI4eHZub2tSWVdCV1BCYUhWOS1JdHJ1RHp6U1VYdXpVZHI0dkI4dE0tZThqOUNlSUpQMVIycEFybVlqMkpDZWJIT0FuemRpd3JLazNoWG9jNmFpZ014YUFQcFloeFVXa05lQXg4SV9LUlZ6bjJReGFRRmFNR28xb0ZOeThYUlltaVNBU04tejdCOTdscjFuWTdrVmxBcGlBa1FsQW9mTmotcHdLM3A3c3dnV1NOOHB3QnRTV2NuYi1qTzRFbTdNN2pRYlUzaXVaSS1nMjBpSWNfQ3E0dGNxSFlDUlE0eEZ4cnZqUWRDNkI5YmZzYjBwaHpjS1lxS3VSZ0dwOVM3cU1xT2I5UGZCTTdPMzA5WkZmRVpfWkxueWVrTXF0RHF6NnNicU1OOUZKdjRJRGs2ZW5HQ0d3MlE4SzlvVXZHbWpCM3BJOW0tSVN6ZmlOc0E1S2hLSHJzZDVhcFUtdVJEV0E0UnZPVDVmT2hlZjZVNmhOTEpiWkRaN0czelJ2cGdYVHZqUkpxRHdHQ3JrUFgtN1NrTEdkSDZtQzRfcFcwYnZzcmNqQjN6MTNKRDI2UDlsSnFicXdzSzhlYmgybW1ZR3pCV21tc0YyZTVmaU5OX0lDVFl6aktHQnNTSGNkUDQ1M3A0UnZ2VEh6YUlrX0pOb0pDVFZRUmVxWU4yRHF0RFRTQTFLbEpGNE1fZHRrRlVEcDh1MjNhUnFqS2ZBTFVrY1VlUms4RUsxOHp6NHRiY0ZsZDVJV1AyMzBBTmVxSnRRYlZGZ2trdGFsTVNwR1QzTG1ubUZiRDliR0c4Ym1aSGJkNm5NY1FpMER4VmQ4UFZrRmdYdjlWM0h6OHh3SElkNl9lU09HREwybzF4ejRfUF84MER4b0xVa1dEd3hLaWpEWmZhdkJ6RWJWZkVfOVRTbVVHTHY2N0hhNDNlcWxYZ1EycERHdmtRMHo4UUF5Uy1kUm5PQ2JmaXVUQUcwQjN0emlJZ2w5NldlS1VXVGhNeDVPdnpUZklQRW5veENWSTFQT3c4OUthZ2VTTF9ueU9GRndaazBtSVdGNU1pMzBwMlRiSzRBaUM2MTctcm5vYzZpWlhzUzdPemhTWkZLUDZRSFdVajdRb0U5dTB4MzJ0aVd5WFhzdTFjUXFmYUJ1STdJMGQwc1RxaGgtLUl5Ym1pZlBsWlZ5YjgzMFpiS25pVFYtTlpjdmpUbVNKTE9pVDVLS0ZMUDRGM0g1UHQ2enF5eWhzRkZKOGhPUjFKR0VoQjZhUWhfUnpqVXd4eWVEOWlJVi10Q3E0b0owU0hoVTJOSXhJQTRTYW5DX0VsNVgzaFBwR2VrZjFXUUVJN3VJVnNfMWRPTDJGQUltY2dZNXF2T0NJdHF0M2hyTnV6UXRRcmNPQWtXdEg1MEVqSjZDeXlKclJRUEN4R2w3bEhRTUp0UlE0VWJoN2dkZDJyMlV3aEFsSjhvcThoWWIyNG1rWjdqNmlpaXZCX0NJQlN3RHJ3YjlzVjl4Z0Zfa1Rsa0dQRGxYUTl3UzA5QVA2bGNvci1FS0hvRjl6S091TGdTVDF2cmQxSjhOZDlKa1BKUDRCdWdIazNsSHNpZ1RqbklJVW5iUnNrakZ0ODNwU3VnUzNiamJTRHZHUE1yZndCdXQwNV9fOHhEWUJ4UUJ4VFpuek04RWlMSmxmaXNDcnpoWmRNQVJJUlZFdU9ZeFZteGpoWGh5di1xRDVwYVdUd0UtSGt4MHJTQUhtVkR0c0pWZzB4RlVOYm92d2FpZmlqeUVxMzNsMl9DOERXNUhiamJNN0xiNV80aEJMOHdYOExtUG8zN2MwNm50alFwemx1WDZqRHF4dzl3SXBYcUdaeDN0WjNwUmlEV0Y3Tl84VC0xaGFjUGxLZ3FPemZHM0JQd3hOLVRXZy14RmVlSEN5c2c4RVF3cUhiZHpWYUN6bjlpYzBEbThHRC1ZbXJJYk1XTzVXU2ZYcGRwOWNZRUl0MGtrOHRJMktVLVVObFh0QXJ3akN5VVVoTXlITnZFbTBlQ1hwZTJkUWF6VkFxLUNqcDNBY2lmZTZKSHVvSFZJenNKQlVUSW9zZElsakdjeDFFaFVXTUk5d1VQUVJqYWJCVTJickU0X2xXQnY4R1h2NW5xVDFBLTBpZ2xYQkRGV3d4TmNtQnE5RFk0bVFCdTFxN25VcWwyQy1kcWwtOVV3aDlFTnB1TU9lNkVuUTkzWDJMbzRqdTh2bjc0R2F6c0htQkVfX1FrME1Za2swb2ROM25uUmdibkgwNEF4cU1wRWZRQzFkaHhvdnVYRjFSdF81SGc4UEV5aVpFMjFtYWMzeHBHdVJhWnluV1VsbmdpMTh0Y3hUOHNPdWNvTE01T2s2ellfWURUUlhnWE9oZS0wOUJ3aTVaaEg5emRna3g4VW1wdF9RVEVHZjc4eVpucnVBZWZzcUVpSFlhVzVQMnpQTndOSkM2bk9JSFNVZ3ZEY3lGVHNTY01IcjFpejFkLmFSSlZlbW1KZUJMcXA1R3BoUFhrNl9OMzhJQnlEbVVSUnI2b0RvZVBSeFk" + "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUl5WVdabU5tRmhNUzAzTm1Ka0xUUTBZVGN0WVRjek5DMDJaalZoWkRCaU5XRTRPVGdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAubElmTmxIaG43ZDZBeUN0MnhNeFU0YUhBaEFUQm5Sc19QZlBJdUFnUEJCb0JURHpENG1JSXRjb2lkdWhYOEZTTXR4ZG9fTk85RkstLTRlNVhtQ0dHa2dKbVFKTFNsU1FfTEVxZ0Jldm5FeXc0LVJqT1pUeDRLZEFfUGdtV2RWZ3c1Z1pFZEl6MWlwWWRENnF5VjZ4SE1sWkpxR05VbnM5NlYtbDh1TkFqZ2RwcUp0dXdzNFVIMi1RdEhaTjdkTnRCSzFqeV9ORHNXSDlmMGNnbEhaMWhnUktWMFhJUnlWLU9lYzhZeGNxVGE0Sm1mZEhoQTJ4ZzJybFdmVERwRzlIOVZpNnd1VjZGWDZJanphRUNoV2lzX1NTbTJEYktmbzN2ODlxRUJ5cXZIdkVaTTFweGlTT053X1R3MklXZU5oaXRJMm90YWFnSGdpSi14cUhmOVRSNXF3LmRFaFUtR0c3WW13NkI4R0RaX01zeWcuYWIzQ0cwN3B4YkJYeWh1RThvNjM1dlVKbzktS1B4WGFmZzgyREExZlNTbG5oSF83RFJib0dydU5LZm9FWlpEQ3U1MzNhMjhIdEF3enpZWWtfak1YM084UFdRblpsS0JMcF9fWnR2enBMbE1YU0lTY2d4MWM3V29BWC1OZGw0bGNSbWRhQVBlYWg1OE9CT25zNTN6U21vRXE1VjhYSmZUTzhmMUdDZGdqNDRPQTkwdHQxbHlSNERoSkNVOGptbjlhczI0ekVHWFNMNDVhUGtVZnpUejY0VGhHNWFRb2Q5WlVKS3gwU3dfWGRoSERCYldNdFB2Ykt5SWpvUEVjWXQyR2EyWXJkaDJNVjUwRWI5TFM3akFzX2x3N1VQNS1fNzJFMWV3OGVNMnVfZ2pRMWZJenJUOFFHNlN3dXBqOXNZZldwaU5lQkV0cWhIUmJrOVoyUk9LNXJSODFUb2FqZzdsUU5MWnFEVEtOejJIS0wyQWJhdm5PQXE4M25rWUdfMG9FOGdfLW45RTlJbkVFamNWeGw0RmhsSEx5Sy1rNEFVS1dfTVN6LUZrR1hsalNFS1RLODdvZUxkakdoMkhfT1JMWU5XS2NXWkFfR3hvZTZLQmhhMEMycUhTb3hMVUZzZ1BxWnZLUVB2ZExsaVlHWDRUWmF0ZjMwLUJTNHpSRC1jNklmMGlGVEdlSGZDVE5tRXBUeW1FQWZ0Q1oyek0xbEhycFVKbnJBbllQRXlKdlZhb3V4QS1OTEdJeGFnc3JyUjJwaFE3VC1kdEJBNjBPdHhwTmw4bFRweG43TkJRVmN2dHh0blZvLWU1LVg2V2IydDN4S0ZYZkFuYU5rdmdhaXlVdF9jZkJ6REd5VzUzN0lkZjNKaDI5RVZ2YWo2TFJ3eHVfQ3VQV1Y3YjdNWDJtOWhSNjl4cHJGYkRKN3FQUVRaTC1wV0hVUkJLY21UVXNyNmY0ZlIyYTBMOW5lZVJkcjhkLTZqSlFPYUJ2a2p2MHNucFY5VzVZbVdaUGlLRXJsWmJ1dFBvZ2Y3ZjRMcndQRnlUNzQzXzJEcU5HcF9tbm9kQnlKcE5LTXZ3N01GUmdLRnIzUWNma09qOGpFRTM3UWNOSlpHRnNFTXBoZXNzX1JwdFk1OThrWURsaE10S0xGWk5ySjBtNmE4RG9ScVd1a2ZjMjQ1UVBZemo1R3gxMjl1d1p0aHpreTBINjJZQ0FIdnlDUEFFNUNMTmZkRHIxM2R3RFpwbUNjZHpsYnFoZXdSd0NtTEFyTFdyUmNnOEVHXzNXdFFPTjBWM0hKSkVUdkc0ekR1M01TNzVHTkI2T01PLTRtUE9NZ21mekFQTkJNYTJiU2M4dGhxcUtnd2RENmxOSzhRX3VwYmlUVy1mSjZKZm5oOGh5QlZkV2k3MHU1LTU3ejhtUkxPMmNkNzlTN2Y0NHVCTE8wXzVHN0tYUFBhS1NvS1loNGcyTGN5NmpoQnJLM2U5SU1CUE1PR3p4djVfX3J0aDBnTWNYd0pWcG9IUTNGblZqTDE1SDI2dzBUazR5d1lhX25fczNfRkJHU2g2SkdHcEsyMXpNQWhmZDFHQjZDc3NSZ1IzaFBURjZjNGpmblVUdmljaXVGX2ZfWXFramF4RVpTQnJoYkd4QU4zTFJLeE1WNXBjOWpyWF9YNXBNV3RELVJEazU4dURweGVrWUhRYmNSWWdCVFA2QnZWdnhVWUVSY0dGSVo0WE1HdVk2WDVNbW8xdUZlM0pSTGdycjk1b0hoalRxd2U3ejhoR2R6NlJSREZlb29WSDBNdnlKTUFma0FfRlZpazFJdkxTRGRzUTAxT0xTZFlYUTk2QkczLTRtTkFIcm5KZ3RZMzVXUV9HamR1eWN3RDNweVJSRWpxRWZ5dEV4Y3FFRjh4RDVQaUVwWU5FNTVDdkVxOFdaOVFxY0I4NWN2Ukd6OUduQkdiYk9xU2IxaWU2cnRHTTE2TTN6djZjUmM4NXFvQVRkNjdwOVRQZWoxQ01FYW9PYVhzemRlYVZPWFNOdlVGUktGUFBLU2U2MDZTR1lnLTRMX0diVnFGV0szYzMtcTNPQ1licWJiaXU5R1h6TE9sMHBvaUg5c1ZXWTNaWXFxTFhwZXlRbkVQaS1jSWV4eVZHeGFpRl9td0dRVFNrRVFPVVRSd0tXcEFOVGN5Z1B4Mk9JREtGZlQ2MjRuUjN3eWh2S04tS3o0MHo1bHcxMnI0THNqOG9KcFhIVUFXMGRQX01XODlNQlRtZ29lMWY4Z2tIYWpPZ3h5ak5hVDZtTmRzT3hpWDQ4cGhZNnpHNE1OOHpGa1RCVmtHTEZjcXhyS1VtSlV6YTEzbmU1NVFJNXBHRUN1M2t2WGFHeUNLZUVQdUczOC1xSWxpU2hsTWVRWllvNW5OZUJ6YlVaQXhqRlpTQmwwRDBIZDlSWWVIVjY1VF9rVzgwTFRHTTR0RHhxMjV4aDRvVXR6WmNsWGJzQnhkQjcyOFRVU1BEdlNEQXBQeTZUZW9IaHFTUzF1anI2VEJYSExTQXdET2xtb1dUNkZqanBvN204a1ZBUXc2REVGZFBDXzBfVnBXWmlOSGIzVmJraVFDamNabU5VbzYxdTA0ZTRFMEtTR1cyekVzY0ozczFNMG1lTGVTSm5vRWZpQXBDa19DLUVDNjM1c3p4bVQyRjQwc2dGeWtxZ0FkdFptSXlvQzVDVS1NN1hLd21BQXdIUDd3dEp2NnJOaHNGbXo1YWl2cm5WUVNrVDUyc1p4ZWFtc2d1RG1QTEZmNVlKaDRTSUJKTGpCVkI0QzdYeUM5bXRQR0RQb1lMQnV3UVBTSWxtWGM0QkhqVEotRlo3SzBKSmUwQjJBdWxobURDb2ZhRDdRcTdpeWxJN1lha2Z1YzlUVkd4b24wSHpSdHBiTFJqVHdzYXRJUGRJYlRjWG5veWlieGRGSHhiTndWQkk1anlPRHhDd0hJNUJMNnMyd0tHSzJJQkhWZUVLT3ZDQUJFbVNBM1prUVZrUHJsQWprenVBc0h4UWdidnVwUER5X3p0UUtsNDYtUzBIbzRyVTNDTDFucGZwNFc3WEgtTDIzUGhPbnc3NTNVLVc4TmUtQnNkTmlrYnZxTUx2WllvSUlGdkJjUnRJU3JwLThLdE45OHlCclFHdk11c0E5c01NRGFuVkIycGpGb1JoS3VhMUVnOUtVeHZ2TXU4MGgzLXRPWGFvNW9vQ052SHd1d0RZVXQwZUFJSkJvemRrRndZN1V0UllwZFFwc0lHMWZGRUpRTGFWVG1HNkUzS2NFdG0wYzh3bGZMU2lUZHBaaE5GU1hKRTNoWXRFOEVGVEs4ZVEyTm9qbWVJS3lFcHZvdUlPRFYyZnFjRnFwZ1FueFc5VWw2dWR6Wk1Ic1B6cWtJOWlaS093bDJ0a0lySFhSMGRoOHZFSUZmbnpXNE5LVVlDa0c3VXNmYUxqN0dQbVh2LUdWV0ZYMy1EdDc0NjhNWWk0RHdjREtiY0gzZVFOcVJvLW9JRTBVRWkyTTdyNzFxNVFXNG5VVVl5YTBQcG5KOWRMb0xxZk9LVXJDVk1yRTdqNzJPVGp2VXdHUDVVcXN5WUNFNlEwbG1uUEtIX25QNmhGNDk5RHVWbmJOX0VpZ296R0FTOE44QV9BMEg1X3VzQzcwTnkxTkdTN0E5RUxxalhSNnhHZGVPek5pZS1IVFB5amV3ODJKWUJsSkJSYUpaZEVUWXhFREp3U0NLU016ZXhzRzlxNTBfQzZEZ2ItM29sZng0OEpVZFFLQ0ltNFQ5V1hsUmNzQWtGM3NwaVN2Z3BoNWtFU2Fzam9KVHRXNVlKRWNuLS1UZzdPMW1iVVdRTWJYMy1SSGU5ZS1KYjVwZ1hXaXBsd3NueDN0M0ZZdWUyX2F2S0lWS0p0QVdvQWcybnllUkdlOGNFR0hPRnpYcTZvbHQzMk03aV8wVUxYVWRrN21OWjd2MGpDVk5MUFNTb1Y0QmYxRXg4YnBaZTRGV242WXJ4cEJhSUpOY2Q5RDRqQzYtQkZBaFFRbjl0aGI4RTdCZy05TVVmOVJxaUc3OTJfZmFJUmdzOXZBbHRZZ0tDSHRtQTFOUWQ2ZXZCaG1BNnF2Q1d3OW1JZEg1X0xjMWhHYUVzcGx5SGFXb2s5V0VVTnYxRjdJT010amFERUlURWR4anVLbVFuZllHYXNuenk4S0QtLXNHZERHVlJuVnVNTXcwR1RuWS1QaTlsUnRJTjJIWTR6TEMxT2x1eE1kNEpFVElmWXNLWHBiUWpkNkk4U3pNNmZjZFJOYnQyWlQ1SzVKdFBlUTJyem4xUmtZUHpiVTNLQUlseUNtUEF2TThGcW1XdFpnSnZsS0FnR3ZjTlhrNWpuMEJMV3FySXEwUExuNWU0Q2lUM0VHTlQxZS1IX1cyNW5TMmtGVWticHhob25OZEZqY3plTVFTclhHUng5eGYySGVqa01aZjdWNTFiRWxSQmlhNm5fMjEtbWpjWGFnaUFrM3dZR3ZTZ2t3M2pKT0tsOExfMENSSGRRWnVGbzVISFVwakxLZnoyem9LNWR0OW1DVWF5QU5WNWphRDZpNWRTR1pIejJQaW5iNUU1LWJXUVYzZUdSalM5bHo5M1FJWEo4X01GNGQ0b201MVkxSHphT2dsZXpxR01SckNjb292RWlBX0hwWjBNZnY5NW1vVjV6QzNLbG1QNGpxNjlmaHp2cHoyd1NYTXJpVjZOS2ZRWmktU1hpSzhCbXlsb3pERUhYRHctSHM2RWlFSXlNNUMyN09URUZ2OUZyQkhtR3BNak1mQnZZVUE4cmVlUmtkN0JKeWxnemRxYmFCTUl2cnJJNUs4dnNiM3lzQjVNZU9BQXNfa29TdEpzRnpOYWpkdFBqQTA0eENhOFlrR2J1RWo4OVhkRVA3VjFnSVlaS3NZVUM2dW5rOE9KbUFFN3drNEVLd1huRVh1RHlVMDN5ZC1mVGVOTFVUV3NKQUtrVmVpRng4dkRSd2hwRmRJZWtqVExVbXdkT1h2eVJZX0FnZzNwckQtY1ZLWDAyT0xrOWpwT2Z0TnllbkRkU2s1NHZQbExxU1JsSEZvZWVjSHdhbEVkY1hEYlBTcXFGeTBNcmlUemw4cDBkbmdFUFBnN0dsWEVFbHJQMnM5X2l3c00wM0pzcm1HTHNJSHU3bWFZTC1hLUlueWdfRXVkRGFOY3FaNUtkNGVNNXlnVWw0eHl0NXo0TXZQZkhNc3I3S2pYaVlZSkNoaGxhbUlRSTU3cE9CRkpMVnA5UE9mSGJ6Szg5dm95WWkyemZ3eFFZbDNtWjMzR2ZOZjY4RGVJaFlMbWRIVFV5UWVYMy11a1h1RzhucE4wbjVrbUFpUmZ4Z19SdkxRQU5zMFAzdmoxc0xHM2NWeDNXUFNpSGhoZDhnWHl1VEpnX3kyWUlaR2ltM1R3OHFHbGtLM29ldmw4d3pRWV9iYzFqZmczNmJmSEowUFFpSkdIMkoxenhseFo4S0xaQmxZdkJERExUZXB2dmF6by1DRnlmNVhNbEJoUmkyWkRvQXNRWGlKYmtzQ3RXYzh0djR4c1NBUEdOcVBfdi1BcHB0T3lZVmZmeGowVDFXOGcyd3ZIbXh3b3laNldCbDk3NFZremhydWYzaWY1azFtZndhcUlDUXhkNXA5eUp6emJVaW5aOVAxVWFOcDNKVGZCWEhJZVNZbWVjaVZNNUFXNXVJV0lYVFVucHAza0FZWFNLeWhNVW55aTdWMkNWeHhXUV8yREM5TWI1R2hhVGhvNWZLY2szZkR6MzRwZ2pnWGlhQ2NTdGpBVjc1OHNIWmVCZGdUQ25VaEZ6QkJvZzREQUJ1U1E4QkwwYl9ndDl1NGNVN3V1VmtyWWFraHlaTktzd0ZKVjFlSHU3c1B2Y0N0SEtGclUydkt1Y0NCRktfSUpSeTlzUnNKOE1WbTYxUzNoNXQ3aTNQZHJJaXR5dzAyUmFoeHJ1WTJKUDliWWIzWVl4RGd6VFZFVF9CLUU0R1JScXNJd2hlMHg3M1V0RDlNSUhoVTJDdHN5clhVNDZ2VDh5NEktODkwOF9yU2k0WDVvOG5fQm9fRHI5OE10MEFJeF9lamhiaS1LZjE5ejdPTjFoTU5YWENtckRIcEF2QmF6cVRKcjIycmN2UjE0RFhpazVRakpVek1SeDVvSkIwbGo1TVI5SG54R0V2aU1KZ3h6d2xVQS1zRFJ5eWNJTGZOOVM1MlAtWFNWenhRVWFiTk5xZmhta08yUjV6SVZWT3lpbTlURlRVT0FmNjRtdTF5aWtuWS1YaGFPMVlGZ1lmajBnSksyUmg3SWFZQ2xKeG5WRVhfdkZVWkNBOFFTUjE4cVlNbTRlVXF4dWdSYTV6OG53UmNMdHFTWTJZSHd3TjV4Z0VqZDRrSXhHNVBINXpyZlRudEpSZzRfX3hXTlBYbVZkQUxkWVM5SXVxbllBQmF5VkxhVFpIUm9wWDNfYzBYUlNTaV93TGl3ZTFIMkRoSmd1bTZjR1NnWWM2R25ROFdVVS1Pc0YtWDZTTEtHcFhZclpwc3FTbnQ0cmI2amg0LW5UM2xQejFydjJfN0RFTFZSSWRwZGwyTVBMbmg5VjV2c2NPMHVBR3F0SzBkT1hKUG8wQ1czUGsycDJjRl9acVRDOVNraHB2cjBLdmZnRFhwVkVCMC1VRzFRRHdPYmhERlVJSlV4Y2RZNy1Db0xFZVEyWl8xczZxbTZlNGNMWTBkdkltSURpbUY4cnFqZVZBM0UwNDI3bWFLMzZwV1NPeE51WVdtYnFPamdFOEJLMF9OUFJpLURVQkJncklDc1dKWWVyLTRtQ090aGI4MXVEZHB2WnZxempZTHVfWVFWZGMyQ215dUR3b01MVjdDSFdkU05YNXd0N2x0Yjc3Q25xaWktbWlxMi1odElLZXZlR0d6LXAxM0xmWVkyN1hla1ZZS2FPSEUzbnNibzZWSDI5TDFoVm9IN01FdjNKUDZhTll1LTM0SEplT0RhVHVKQk0wTkRaMm1RU29jUkwyRjJ3NV91VW5hV1FGNmwyMVN0bmI1b21QR3EtM3NkdWdFRHFWNDlISlMzbXdwRlNiaVAyWVJsZGkydDkwVzRrNFoydG1uQk9peDlGVTZuNU1NVkxKSmVPMDJWZFJ3NGFBcmdMdmY0SU9HT3Z5ZDlkRUg0M3FmX3hWVTZrcy1pcGVPcGRnZFlFU29CY3IzaEFQTjhhQ1daUjJBVHM0Mm1TVEIxM0gtTkZYSUJtMXJScHVwU3lmVl9IalFOajF2LVczNUxpN21VdlZSU1hGRHU2NmJFZDNLOHVsUV8wUFY4MkJJUkpPRjd3WXppLXdsR25NY0pPa3lTRnFCZW52TVlFZ3FwczlvNVBrbHNZQ2lYQXJPOEZ4SzJVNXNXdTFUVUk4OGJUSEIzamJpdXFwMW9lM0o1cTBSRlNXM0NodmFaelkwYUVZeGZuakd4RzlvZEZCNU5OSnFVbVBnNFE1UjhSWEs2OUlHQ0FiUUhScnBvZXlJMm9DT3MxcFhGNFZtZVRQVlpwRVRyOTF5bE5tbVRqRk41V1hzeEZoUXdNNWhRbW5LRng5XzhmRzBLTno0eG1PdzVZNFQtTXZxOGQxUjBtQmZaQjNyM1hrQ1VIZWh2WnJsMkp3MU9WTGk1LV9UdW5qOGpldVhHMUw0ZS1DNUp6TURPTnBrU1B1TS1NUmQ5Q3c3UGZSUkZMcWtsR29sOGt1TVNmQ0xlQWlLNXAtWEtKSEdEWGljUEtiT2J4dTRybVdKM0JrMWhVM0ZCODRHWUY5LV91LWZYdXRmWjA5U0hiM0lDaGtvSnZmSzJBUnhDZWQ1Ym82SUdMajVmcHdQbVVlUGhTel9mX1d5dWpmVjhyRkJuczdURTZndXhEUDhWLWtsSEFnY1BtYUZhdW1LcXMxVmhuOTFmZmw1VzJYSUlDYlhJbDZDWlQ5OUNfOHpSMDUxUS15NG1HbDNJSUJLY1pJWXRhVXc2UVdUVU1odldYVU5JdXFfbmlTV3pZcG5XSGdhSEtLS2M0Ukt5VnJ6aVdUWG9IUXhnOGIxcUh1SFBCSUR5U08xZEdtT0pySVk1RFZ1X3Z4MHFjdGdoa0xyUUFNN3hiczdsRGhRdlNxY2xfcFlDSkJnamNEUDlsYndEdVpUOS12eDFBTWtnRjJmUkY1bXJ5MlYyU3gybDk3NFNIYlZCN2tqSmdFRDJvMDJqaGpBTzBnTzNPVC1ua194Z21MSl95SjBjaktyeGdyWUdDWGY0d1FYNDMxTU5LVHRoTkpfOG0yWmliREJfVS15UUp1X2tDejdvSFlKal8xZVVuQ0t2eF9PcXYyLTFORVNLbXJIQXRhcjJJb2tsUDBRMFFXRy1NM2MxOXY0cE00QlZVaDRNZ1ZzQU9BaTFKanBYekRpTklfOUpHbm5lQklXYzdod3FBWHRSZlZzMXJpaFBsdGlRcFlwV2JZUDRfQTNueHBMdnczNnhyZ1J3c1NTZjdvb21oZnkzanhrb3RzWVRNOTJRUE54WExtTDd2MWFndi1fTWhzdjluY1BXdXhLa0N1YWpMbHVSM0JSZE83UFdnbjZnb2VUb3RISmhSeUtWbkFxUXQ4LUY1TklVRURWX3JxVG1PUDk3NFRRSk5vMUZ0dEV3cnVQdFV1VVZJUEpZWGJXQmxESjhFQW1ndEIyeXZDb1lvRjBfS2g2TUZXNEhYVnAydFhXUWZIRlpPajNmZ0hZZjJPck9fVXlxR2J2V3NydEVCa2Y1WmduSnJpRWVEdk9QZzNKMlFTVjh2WXp2clFnQmxpTTZaZ1hUd2xKWkFJSU1XT1A2TXBvbVEyUnMzc1NjMG03ZXF6SElleEdZQUdUOGtWNjJDNUp6NjZZZU1pMUFKQnlsY0trT096TEw1YWxfYTljQlYwYmszdkZmVDY1RjFERHFRaXRIYWxHTEEzYmJoeU5kUzBQemJyWlVJc3EybXpYaFVhZExKZWY4NlZfdTNyejBIYmhpQjRaa0hGQXJ6U1FyN3RwZS1STGVoUDRaVXFJOGhvU2FMbkROSi12RTI2b3lENEhyZTNNY0paYWJwQVp0U1NDQ2ZUZVBldlZHc3oyRDBXckNDaENqN1Fhajk5NXVVdUZGc2hEa1p0MnlTSDBlZ3lRQjZyZnhHcU1BZS01c3pRbThMWGRtVFdTOUNlS0tadnJpcDZEbm1ubE5wVnlQWkNRczBOVktmRlBoUlQ4NmRTZlpKZU9hLTJNQTg0R1dDVnNwVjVmeWVHdzJpbm9iX2VsY2JfYk5iUUVScHh2bUtpdnlmN0pEYTd0NlZsamtIa2UySVJmNU9BMmhjclZLYk83TGhPSmlCemx5cXNtWkU1Q0tKR1pmalJqMlZhZldITnFzNVBWblNxejlQdEdOdzNZeFFGZDRwU1hOMF9RTm9tTjZka1pzWEwzSVNFWVFzRWRub1dJY1V1VTRRMWRENURfb0FfaEIxRFAyS194am9jYUpRckNZaXhwYUZGWWxmOUZ2NUZndmFXTkxhU2FHZ1JGbGxGdjl4Y3RZSjJBdWpobVVpSkVSYWptdk1pVll2bUdoeW8xdjhCd1BXX3NUb2FpRXpfbWFZUlNPajdlLUZDOXRMd0ZtelY2TTdad01NTU5Dd3lVWnlld09nU3A5bXFrLVlJb2JBSDF1UmFsdUhINzh5T21namVWRG5ITXZvR0NiUHZUU2trbEtxaFU5OEFNOEd3ZEVnWkdISTkwaXF5bENoNXI3OU9FUlBQY0x4THdIbFhZS3RqWGJZMHZ4aXJELXh1cHZRWXJXWTQ2NmJBZ0wxVkpaWkp6S1lYUUk0RUpndi51TGxjMUpEeGtib3ItdHpfZGFYU3g0U0g0dG1iaE5zbkJXY25wVmpycngw" } }, { @@ -151,7 +150,7 @@ "Cache-Control": "no-cache", "Content-Length": "831", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -159,15 +158,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f8b55009-16ca-437e-9e2c-3cd77f0f60c4", + "x-ms-request-id": "834a7285-1636-476e-b097-cc01d37ad52e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157", - "deletedDate": 1639070364, - "scheduledPurgeDate": 1639675164, + "deletedDate": 1640018441, + "scheduledPurgeDate": 1640623241, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/c739ce059c4c40cdaff9e6b747d4f80c", + "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/6846e40e9aba48f98d604508990af9a5", "kty": "RSA", "key_ops": [ "encrypt", @@ -177,13 +176,13 @@ "wrapKey", "unwrapKey" ], - "n": "2fDKZM6HDH377J4_DPdBYPECe9TaTvehECH3izi-vtjBbk91vOm2MoHN79QJGs2RwHQdQkEvqo3saJlbCuDNdXJd_MH2E70LBj7iK52pLiIzeZsUaUnq70JhQH3z-x4vjSU9-n2LXumybsqGpAJugNB9_9R7AEvdbE3uOsH-3lHAB-_AO3HQdxs-1E5ML3p_ib4W8MNiFc2M24G2Yidk0z3jn3G4t0eoycLu-7Q4aavtG5pgPLZL4sHmjAqjOu_-MN0yweZM7XAqKbm1B5Mf00fMnp-BxQmRA667PilK81D2m6QZtcIdXzfA2SkrzqVTg4211ODhI12sCp_Zh3rQoQ", + "n": "-LoBXWRIHj2lypE0QmxZNhuj2jZtSdHZOXsT864PNa5CQSzzTOZ3KGH2rRG07mwDWk6kdeSn__oDl_veHog6qB1ZELxGnCZmp66V_YRKczJ61QQGUmjl5cFO0CqSqW-QtS4ExRpyIeO6N9eI8THourGY7FCI9eR4Q9XUH-P_qUzAPpF5Y3veXvJHuzPKx3rL4pzY0YVZyYs3fvW7bpgKRjLasnxH-JL0JdtTvSV_73zPqV_4H9xyPpqZTgP0tS3ofdlvyL0WcbVzogKSYmhXg0qq_6HuLZ4abVvXye95ogQgeGCGTUhlJuygyxgDx2vfcKSByPAfgajoUKjyA84EQQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070364, - "updated": 1639070364, + "created": 1640018441, + "updated": 1640018441, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -208,7 +207,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -216,7 +215,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "dca8bf6c-fb25-4d7a-ae66-b272c5ec2158", + "x-ms-request-id": "678bd3b2-b68b-4423-8113-39cdb0aed27c", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -245,7 +244,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -253,7 +252,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a716de9a-540d-4a2b-95a0-0a5c82438ee8", + "x-ms-request-id": "76f3e841-0bf1-4b26-87d4-f4fbf28803a9", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -282,7 +281,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:41 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -290,7 +289,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1ba4d807-e53a-461b-854b-a2fdfc0c32c3", + "x-ms-request-id": "db82bc56-ec45-4ff3-b707-4312a93e30e4", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -319,7 +318,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:42 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -327,7 +326,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6e3bde24-f815-47fa-bf5d-921ed9990157", + "x-ms-request-id": "7e167045-e43d-45ce-b773-90d9c78efe9b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -356,7 +355,7 @@ "Cache-Control": "no-cache", "Content-Length": "831", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:42 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -364,15 +363,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "71cd7f0c-997d-421e-9143-18e3a361bca8", + "x-ms-request-id": "a903d998-71f8-447b-961a-b2f980c4bcba", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157", - "deletedDate": 1639070364, - "scheduledPurgeDate": 1639675164, + "deletedDate": 1640018441, + "scheduledPurgeDate": 1640623241, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/c739ce059c4c40cdaff9e6b747d4f80c", + "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/6846e40e9aba48f98d604508990af9a5", "kty": "RSA", "key_ops": [ "encrypt", @@ -382,13 +381,13 @@ "wrapKey", "unwrapKey" ], - "n": "2fDKZM6HDH377J4_DPdBYPECe9TaTvehECH3izi-vtjBbk91vOm2MoHN79QJGs2RwHQdQkEvqo3saJlbCuDNdXJd_MH2E70LBj7iK52pLiIzeZsUaUnq70JhQH3z-x4vjSU9-n2LXumybsqGpAJugNB9_9R7AEvdbE3uOsH-3lHAB-_AO3HQdxs-1E5ML3p_ib4W8MNiFc2M24G2Yidk0z3jn3G4t0eoycLu-7Q4aavtG5pgPLZL4sHmjAqjOu_-MN0yweZM7XAqKbm1B5Mf00fMnp-BxQmRA667PilK81D2m6QZtcIdXzfA2SkrzqVTg4211ODhI12sCp_Zh3rQoQ", + "n": "-LoBXWRIHj2lypE0QmxZNhuj2jZtSdHZOXsT864PNa5CQSzzTOZ3KGH2rRG07mwDWk6kdeSn__oDl_veHog6qB1ZELxGnCZmp66V_YRKczJ61QQGUmjl5cFO0CqSqW-QtS4ExRpyIeO6N9eI8THourGY7FCI9eR4Q9XUH-P_qUzAPpF5Y3veXvJHuzPKx3rL4pzY0YVZyYs3fvW7bpgKRjLasnxH-JL0JdtTvSV_73zPqV_4H9xyPpqZTgP0tS3ofdlvyL0WcbVzogKSYmhXg0qq_6HuLZ4abVvXye95ogQgeGCGTUhlJuygyxgDx2vfcKSByPAfgajoUKjyA84EQQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070364, - "updated": 1639070364, + "created": 1640018441, + "updated": 1640018441, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -411,7 +410,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 17:19:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:42 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -419,7 +418,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "17183cf9-dc40-42bb-a75c-485a21898d15", + "x-ms-request-id": "69a813bf-31a5-4c13-9740-dd0751760c85", "X-Powered-By": "ASP.NET" }, "ResponseBody": null @@ -443,7 +442,7 @@ "Cache-Control": "no-cache", "Content-Length": "307", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:42 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -451,7 +450,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0d0e0691-85db-41ff-889d-ffade875f035", + "x-ms-request-id": "dd47471a-92ad-4669-b008-4c121d13c2a8", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -480,7 +479,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:43 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -488,7 +487,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a105f310-59cf-4a9e-90f6-4c1dd74c165f", + "x-ms-request-id": "ecd5091f-f2fd-400d-b700-26e11605eedc", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -509,19 +508,19 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "Content-Length": "10499", + "Content-Length": "10584", "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": { - "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUl5WVdabU5tRmhNUzAzTm1Ka0xUUTBZVGN0WVRjek5DMDJaalZoWkRCaU5XRTRPVGdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAuZDlBMVJGOFh5NDltWmVVeTVGRi1ZUWZZSncyX2RkS1d0aWdmN25lUk45ZGZzQ2llM2ZGVlBQa2ZvNlZMLW9md3kxcWlaMlRPYXFVSzExeHFhTXJyN2ZGeTNxeURrS0h1MHdRX01VQ2pkZlhKc2tKVFIxY1c4YUFULVZKSGU5R19tNFFwdkI0M19WVWpIaVMtUENwREpyY1JHeXdGR2RlY1Jyb1dzalpWdVRNb3ZyUC1CWUg0UDl6UFM5M3VtaEFiZmdIbEtyQXRUWUlVMEZuNmZvYi1rODNPZ1pqd2E0Umt3RUxJb25EX1ZFZmNyMFM5UkwxTjZkMl85TkZVa3c2d0FhUU9CZHEtQ0w5X1VpY2xPSUZVVFJGM1psb2t2SUpDQmhyOEJMN2gybFBNcG9oOFBwUnFmOE5MdDNPWVc4a1ctOWZyVkpIaG1VaG9xenhnU2lRSHZRLmNGRndJUVB4eFZienlVTkpqZmJLRHcuUHlvZExoQlNWQUc3ektRd0w3NTRDaVBTc1lSN0hoVWRfOW5pbi1IZ0ZQbExTNko4cEpER1FLY0JyLS0yaGJTaDQ2Zm0xR1FwYTlBNmg0R2FMYlpxY2ZPVmRqX0xZcWZyNU5CLWJYQUVDc2EzUHJfdmxPM01qeWhVTHVRNWxqOHhLMVh1TGhac0EtNGZKaFJEcEVGNmQyWnZLcDJ6SURhU2o4bkJQQWNnY3p2YnhGWjJNOER5LW9vX2R2b05nbDBWX1VrYW5zU2lPb3dnNUNleDB2V0ROSEpBdXo4dlZjdVpqUWVMOHJRdVkzRWpwRTJ5bUNpTzduWWVydkhvV1RyMUpBeG9fZzlYcE5mRzE3ak93SkVheHdreHpaT1hpa2EydEtMVkQ5cm1TQmJZR25lRkxHMHlhczZKZFFWZHNHWVlKWDEtUUJYTTJWOUFjT2RsQ3BGM3JMVkxXS3lPcUpZdklBXzdTR0t6R3FybjNNRmx6X1BGR2x3Z3VlRjBzRi1RRE9TNVdhY2VIbzhqUXNWWUE1NktGc3J4Q1IyM1VPZ3ZDaEkwa1piSTl2alAwQng0V3VsUVNSOXNvVnF1MDhHWVVBSGlsVEpFWElFVFhqNHVZWmZBZmcxeWEyX25uTVRqaTFka0dVbG1hQ0FiYnR0R1Z5Z1NvVndJNEVFUG5yOExpQWlTaVYzMkFzb0hnT3I1Ry10Z0JkUk52SWxaR21QTUVZOEJWdU9JbjdxenB3N3ZzcWNfNnZ5UGJ1Q2ozeGdQa2pvQ1FZUllSV3otNGd3S0Q1WDNPaUNrNlpZYXNDd3BaMFJmSV9ycXFGM0ZwU0ZFZEZUbEFQQVRGUGFHQWVfZkJlS2VkNEtNYTF4YUIwbzk3cGxSRDVRSGJ4N2lia2FvcTF2dzFyYUljaE1ZUHBBbkJIVFVHRHZqRDNHd2RFMmFDc1Nsak5mcGVpRkluazZjMWFveVVLZzdTUFhfVTB5alhBSEh3OHVQQkpuY19rWXBYSmtlUUlRb004cmZsRHN3bGd2RXM4ZXYwSU4tc0FBTGgybkJVSHZkRWN6SGdFT3lmYjI2aUdFWll4bFNGRjR6Yno0Mm9JaVRBLVluaXZJZWVDaTM0RGpfeWNMemhFVUQxVmlwSUh2RG5sNWdCZk91QWt1VTczUVItMlpFSUVpN19PeFFUV1RwdHptX0F4NEswYlhtN2JBUVZGRWVaZE1kdE85TmlBZXQ5TklGV2k3MlR6UmVlSE1HWHhlNERwX2pSSXZUeFEwMkdpNHZnRnU3NkVSY1YwdDJKRDBpSFY3eG56TTh5Q3NyOFk4NlJWVWpsaWdQeUtoVlFaM2lKUGRFVkF1ZWZlTDdlOU5JTWp2bkdWNlN6ak9zMlRVT3Q0YkI3cDJYNlVZenJiR01UdC0xOE43WG5vcWRZWWNLMnFxbmxQd2Jya1VpSFJ6Yy1wN1NzNDJjSjBhYkNDS3p1VE10SElEcDZGcU1LdUQtdlByeVE5WG1zc2hRbUphUDFOVUlhMmFPY0xVSU9GemN5Z3VsY29veHI0U2ZZeU1OZDJHVGl0ZVZodUJ1QnlBTktsU3JHSVFkOWdIQms1SGo2a0lxU1ByYlJfRGVodkdCX09vTHBaMndwbno4QU10bzBBWnB6NmUyUncyNG9fVFdsM09Rb3ZiNkt6dlM1M01FVVlCTkRkRUdUNjdLSEhxMTlYYXhFY1RjVlI4Mjl6NWJ1Vk9zblNGc0MwRXhlUUI5XzVaMk92MHdCSXVWVHhPUDVIMzBkZkZOYzFNMVZ3azV2RW8tNnc4bmFta0FOM0NCOW93bkFrX2ZkM3pJaTBpZnVEMDM0WnFneDlwVm05eHRTZDIwTTNlNU5pN0FJM1hXa3RySzNDWU5lY1JTZmZVcjk0ak1UMEwwdXA2UjYwNm5uWDdhMTVDQ1dNLU52c29RWDItTG9mNmNOU1BtVi1wSnZ3OHBVYzhxb29McEtJRnVtSmtsQ2lPNWFkNUlSSjlZMmJ1ekhBSjZKMUZsdFVERm8xQ1RqM2dpaDd4dUNIYWIzOUgxV2tNUlp1aFdfUDREVDJOV1dXaEpxVE5qVzdWVEVtT0kxZUpEQ2hBWHJFS3FJQk1GSFNmWTdVV2dwUFBELThBa2tZVEpOSHBzZmthUXhCbDhnT21zWnpuMUdPWTF6R3Y0NVhXUEhwS1lPZEpKcUQ2UlBCZlhsMEZJZDVxN2JNXy16Y1F2OVlQdEFjNXViN3M5ZnlaY29Xb1VyemN3N0NKQndCNS1YQU9QaWdNcUdSS3hnX2d3bmd0RUVPOExhV2lxVndTSkFLbUZLVXdwdy1FcVBqTmRfUnM1NFI5Q3FoMjdEcjFsUDhFckt1bzczYmNQb3JfVlVyeXExSFZFWWdCMk44aXVNOVJaZVNxSUJQMjkxUEtiakM2SENBd0ZpVExEN00zOUo2T3NtREVQSFJYWUVtRlkwTGstQUF6RjE4WGNqekI2Z2pveDZ0NGdMY3A1VGk4MTlOQ3dZU2o1dG9pQjJqdTgzM0ZvRzluWVZNZkNiU1V3QURyeDRBQWZfek1HekF5ZVNrb2w0SnN1T3NwUmhEeVRxWFFzWlN6cnlqN0ZUZ3FfNEV0ZjJJQVMwNEZqWFlPZkIzdXB4ak0xVFlIRHdhWE5JYzRGR2JNbWhZeXg2ZzZZWVRMVWxOZWxhR1FkV0UyQ2xGQXFZVFoyVW9CSTB3cnBMSV9iTXhkOWVSM29fTGt6cHdJV2JrWXdFdVp1dC00V1paUEM0MzRQdWdLSkRtY003S1lwTDdId1hVTzBVX2VoSk4zNDZ1dFdCM2pSMjFUbjREc2tvNXh3WHpLamZoRVB1ZzJyV1g3X1ZxVHlRSTlJODFVUGoxX3FQbGFoN3lWQVJzaDNYeWNXZUpxZEN6MTBWcUtvY0poZ2ZkTm5LS3dtNGpIYS1rM3JhM0FqcXduRy1xOE9NSk9zUGZkRHhCZk45TjJUaUFzVll5QXhVOUVLMnh6TmJ2cGVvanVkMHpCUW04WFVuRHltSWhtSEd0aUJBVGgyX00xaW9sWXRfWThyUzB1cnFqYjZxN0F2cG01aVo1d21tdlk1bmI1ZnIyTW9QNmY0dWI1MEk5TlJLa2RfNFUwbWRxQmQycHpzZHF2N182a21rNThRYTNFRjBSWGVoT2lNN0ZWeVlWN3Q2cHZyZm96bjNEWHRFTDh2VHBDUk5jbUhWS3kyclJ6T29FT2pEWllsenZWWmdWSWxsTnNuSEwycDhuUHhQT1VpcmUxZDluTkwyQk5BOWh1VEdHaFlVNlZOSFlETDVTZjAxekVmendrdDk5RTVTUHE5YlZVZm1qRHprcnB5bGpMTm5qU0RER3dZbXJ2eFZjZGFtRXFuUzJUMU9fX1d3eUlrX3R3QlNZdXNBU3c1M0NkR1RrSm5jbFEzVXdULU5GekdZSEdQYTQwTG1HeDdUM2VDOWo0eWJjcVBrcG0yR1gzS1ZLd25Cel8tcTVDU1V0ZXZrTGlKbE5ITEl3OHBDa2F6TlN4TG5FYy0ySFVSTWw5TEhyQm10YlB1M2J1alp4NWFjUElRWXhsWTBWR0tyQ3NUNVV3ZkRnbkFmZi1xZldJV2h1bUN2STJIWUQyQ1Jsd0g0d0VPTHAyWHdQYVdiU2VtMG1ENW41RzRYclRoVVNBYUNCTXAtNXdmNzZSQzZtY0JmU3FYSmlqclRiZFJqS19QY3cxeFpEZHY5QkZpMVg2dkM1dE1LN01qbFY2MktHY18zcGYyRVdpMTZpX2lEM21sQll6ZXpXTXN2Y1d5ZE1MT19xR1liX3JSajlOYWNvQVRVRUc5UkN2b0NNMkdGaER2TEpGa3hLOEV5SzF3a3lTYXF4TEpWUGRaZnFsYmI4MEVVaFp2b3Q0WXZBSnQzaXRwdVhwM01OTnU4Rmt6Skc1YTkyREgxM0pfQzFNemtKbFFLc1FqUi1iekFTSnNTRlFPMG85TUlTYUsyZG5GSXl4OWhWMVNUcHNsVFFaa1FmOWpzRzJwZ3lQanM0Y0N4YjJUNno1bDZ3Q3lCN3hVb1RyYkRxb1hKb1dpTHo1dDFNTlBnRmRUd1VDdENEYU8wTWlqUlNvUV9CRW9fZU5YZEhxNWo2TXhIWVJBa2xHWW9HX1lXMGZtVEdDWUs3SUF0N1NudzVQc01OVUgwSjMzWnBhbmF6Z3FGOEttR1ctcTdzSVlTQy1yZkRFZXlsSEtzeHowSnh6V2NfYng2YkZxXzFjcFZQVzhQWk45MzE3clJJVTA4RXJfR2V5UVJjSFJBQ1lmZlV5MTZKZnp4MjZ4TmFjNHBYZ3VOZWJzRFBFVjhFZUlHenpvQkRtSnJNbHc4OE8tdENaRXh4bldmUHRQbXZpbkdWWE9yemdmSEZiT2xHTzhIaEVTVXpCUzBfU241QnJRbGtkZjlmNGFGRnBLcUxMWWlaWEtjWHNBclh0N19JamtHQ1ZPb2JiVllvVWpfY1lSQUprb2hKRndpc0lKOUlONzBVbmRCWFRsQWlEdDd2OWluaHhZMEkwRFR1SlUySXRfbFZzUTZqdmJSM3poUG5vRjc3SnZaeVVWa3AzQzdha1YzaUlrQnJWR1NZVEJNTHB2c01POEN5Wl9ZRlc0WldQX2w5bloxUTN5SDMtVHA3aUR4cXc2MkxmcDF6MWVCOWhVSGlhWV8tbjdEZzJmR0RIZVVocEVyMlVLWTBScFBYdmRKRUdKdmpMMmdkNmhic1c2X09IZ2poRFNMa05IY0JGUnhDQU5pOTIyS0pPWEZET210Q1lnaGxEcnI2N0UwR3ZsZ05XUXZVbjQ4bkRaZXA5NTFRYTdUY1diMEdNZ3ZsRFFOdEQ3RjUyZmFLeFBWdzBVTF9KVXYzd21YLXBvREJod3BuSzFpYlRwSGVmSmNqVmxHWUV6cW9rdEhIeWlyaTQ2ZkRPRHFUejB4cHVhSDBiaHFTOE1GZUZ3b0J2TzZwTUx1SjBZRkNvRUtwRlRmdF8tZGp4Q3dkSDdNbWcyQ1RxNnlUZHZJZG1IUUVWVV9lWk5fX3hiY0dmM2JELWpTXzJUeE5DMHVHY0Q2b3JPRUd4aERiRmxPVUtKMTRLUnNWbFNUWkxaVVBWbWFJVG5PbzlpM21HaEtFbExCOFViLUhHUEo2WER1TUttWFlWNG90UnhTRHBNR3dlRWR0dHNvUTlnVFhJU003SWxXREx4STZIdWQzaF9Dd04zbFVUd042N1JLTkdYclI1RkM4YkpHVGlHM0x2UGpzaVZ0R01PM3l3YVp0dDlJN194MXdvLWVCc1VMY1BmR0hqSWVtYlFWSmx4VGFvTVMxS2wyZ0JpVUc2TTdLN1g0TW9XR1A3YkpmSExxRHBoWEFxYXg5ZEVFLWdRUGZJUEg4T0xPcTZtMnh6aGNkTTVXREFYWk1rblo4ckNjaGV4TzdsQnpST2RYTzFNVG1nM09QQ2hmT29fM3hwZVo5a3Fja2FKWGg0QzNjdmxyRzZXTHAzRUZmQUJKSF8xX2V5MHRYaWlvWlhpdFd3WkM5aDcxWXBVUTQ4bV9DYWQ0T3daU2xReWd1QTJpaEtwQXNPLXFTZVRCWnZqeFpsYWNaMHY1RXppM1R5clJLbllhNWxHbGxGZnMza0hTaHBodXBTSDg0dW1TMTR4RjIxbUVuSVByd2xvb2tyS3BfYnQ2UVRRdGU4X2xGc19ZVUJOSmZkZVRQX1BlMjNqVHhoclJ6aVRZQUI1LUtFZlZJQlZUVjdKS1d1cTltUTBTTzBTVERFbGU4eFhLN29ndzl5cGl2Sm8yQVBiMUVKRW1jRFVDVk9zMUZTRm5BNzVrTDQ0YlItTWZJZVVrbG1xX1d2TTUtX21ydGZVTUVvMFFOWDZ2YktiWnl0MGVqOXNHdFg4V2RHQV9DTDBVcFlvRzE3dTVUYzQ0Y0xpSzJlSzVmM19DaXpkZlhYczZsQVVtSVhwUV9fX3BBTTNzdFVxMmZyb1dGZlZKeEFDVkRldEFyaGZvU0hkR3JrNUgxUGtwNUMwLVZ4ODRmQlpIQWphZUs0VXd5LThUbmNlOFJxRE0zOUlJQVhFR3Q5RjgtaEk0dnI1dkVMSFNfNHF3VUNPYXE2UGZrVG54Zk9VdlFDbVZFaWdoRG01T1BNQmNoZ3I2SWxHT3BvYm4zdUNaeHM3WnlzcVFjRnhRWnJfUVZIR2dicnB2VkNSaWp3aXlCZzlMMkRvUlEyZXZYVk41elcxQXRCbjlmNVZVNENpeC0ydGx1endma1VuWlRwSjdvWTIyeG55RkVWdDJpekdWd19ReDdXWlI1UmZXSTJYNUZHUWQzU3Q4bWNIOWR6eDR3Y0k4VlJscVZQTjZhWjNJMzRfUzRlclplQzQ1MWJ4SVNBVHZqUy1lNW5fTWtwc1E1VzhIX2o2MkFnTTJ6UzBvUGRUTzJ3YmJORG1TdlNlZjdQQUVjT3FqOEF1di1kcGpHbDI3ZWNNc1FNRWFRa0dnZHBoazJrVW9KS2RDNm9qZkMzWDJocEtGX09UVHZCZFVvYnBZMkFrd3k5Q3NVYXpJdEJZLWIzVTdCaEl4UVFvNzNPUWlLaHAzSXJ5NVQ2OEJpVGdwR2Z3bVdIR0NFZVFhODNCbnZwSUUxM2JTR3NIakd2WWc2NGVwR0JhbUdta1ctR0lFdmZIdW11STNBNUF3ZWljUVVxQW1rXzBvZWFMQ1lzYjdGRlk1a2NEa0JkOHNyanZsU0I0YzVsTzc4dUlxbEZjWGxJcUZvVXZMQ2lzODJZdlljbmZfSk5sbFFfSHR0TWZveXZTWnY4Y2xkNHJWSi1CWWtrWVU2LUx0REVicC1kWklmaU1QQWtvY3FpeUJDMU1yYzRsYzJVSXZUeEZLRzFVSHQ2TXZIVUxZVjJQUFNJSWttSm90b3EyTlp3YnRWVVlNRVczZHlIdzBPQUl3TC1Ta0JCR0lpYkg3Ymw2eThiNm9hLWVNNFRkaVI3QUFHV3k1THAzNDFhQWVZeTdYUWc4WXJJYjU1MlZLblJ4d1Q5TkNlRzNqSGtIc2VJNGNEaEdWbV9rdk5NN0c2STNwTGJxTzVpcjIzTFJJUG5UYW1JNnZ6NkdtaUphTXpPLTBwSGY0WXUwOFRlQWRPTGhmdmIyTnlRaVJFOG1RNnBpel9GakVTUGJpZlVEQTQzNFRnUVl3UXVjSW1faGdhS1U2RG4wTHNWUjJra1hlRGd5NTJ5bFFnRFE3WFpGSTkxZDVZdTdacnY4aHNQdFllRGJKVXI4eHZub2tSWVdCV1BCYUhWOS1JdHJ1RHp6U1VYdXpVZHI0dkI4dE0tZThqOUNlSUpQMVIycEFybVlqMkpDZWJIT0FuemRpd3JLazNoWG9jNmFpZ014YUFQcFloeFVXa05lQXg4SV9LUlZ6bjJReGFRRmFNR28xb0ZOeThYUlltaVNBU04tejdCOTdscjFuWTdrVmxBcGlBa1FsQW9mTmotcHdLM3A3c3dnV1NOOHB3QnRTV2NuYi1qTzRFbTdNN2pRYlUzaXVaSS1nMjBpSWNfQ3E0dGNxSFlDUlE0eEZ4cnZqUWRDNkI5YmZzYjBwaHpjS1lxS3VSZ0dwOVM3cU1xT2I5UGZCTTdPMzA5WkZmRVpfWkxueWVrTXF0RHF6NnNicU1OOUZKdjRJRGs2ZW5HQ0d3MlE4SzlvVXZHbWpCM3BJOW0tSVN6ZmlOc0E1S2hLSHJzZDVhcFUtdVJEV0E0UnZPVDVmT2hlZjZVNmhOTEpiWkRaN0czelJ2cGdYVHZqUkpxRHdHQ3JrUFgtN1NrTEdkSDZtQzRfcFcwYnZzcmNqQjN6MTNKRDI2UDlsSnFicXdzSzhlYmgybW1ZR3pCV21tc0YyZTVmaU5OX0lDVFl6aktHQnNTSGNkUDQ1M3A0UnZ2VEh6YUlrX0pOb0pDVFZRUmVxWU4yRHF0RFRTQTFLbEpGNE1fZHRrRlVEcDh1MjNhUnFqS2ZBTFVrY1VlUms4RUsxOHp6NHRiY0ZsZDVJV1AyMzBBTmVxSnRRYlZGZ2trdGFsTVNwR1QzTG1ubUZiRDliR0c4Ym1aSGJkNm5NY1FpMER4VmQ4UFZrRmdYdjlWM0h6OHh3SElkNl9lU09HREwybzF4ejRfUF84MER4b0xVa1dEd3hLaWpEWmZhdkJ6RWJWZkVfOVRTbVVHTHY2N0hhNDNlcWxYZ1EycERHdmtRMHo4UUF5Uy1kUm5PQ2JmaXVUQUcwQjN0emlJZ2w5NldlS1VXVGhNeDVPdnpUZklQRW5veENWSTFQT3c4OUthZ2VTTF9ueU9GRndaazBtSVdGNU1pMzBwMlRiSzRBaUM2MTctcm5vYzZpWlhzUzdPemhTWkZLUDZRSFdVajdRb0U5dTB4MzJ0aVd5WFhzdTFjUXFmYUJ1STdJMGQwc1RxaGgtLUl5Ym1pZlBsWlZ5YjgzMFpiS25pVFYtTlpjdmpUbVNKTE9pVDVLS0ZMUDRGM0g1UHQ2enF5eWhzRkZKOGhPUjFKR0VoQjZhUWhfUnpqVXd4eWVEOWlJVi10Q3E0b0owU0hoVTJOSXhJQTRTYW5DX0VsNVgzaFBwR2VrZjFXUUVJN3VJVnNfMWRPTDJGQUltY2dZNXF2T0NJdHF0M2hyTnV6UXRRcmNPQWtXdEg1MEVqSjZDeXlKclJRUEN4R2w3bEhRTUp0UlE0VWJoN2dkZDJyMlV3aEFsSjhvcThoWWIyNG1rWjdqNmlpaXZCX0NJQlN3RHJ3YjlzVjl4Z0Zfa1Rsa0dQRGxYUTl3UzA5QVA2bGNvci1FS0hvRjl6S091TGdTVDF2cmQxSjhOZDlKa1BKUDRCdWdIazNsSHNpZ1RqbklJVW5iUnNrakZ0ODNwU3VnUzNiamJTRHZHUE1yZndCdXQwNV9fOHhEWUJ4UUJ4VFpuek04RWlMSmxmaXNDcnpoWmRNQVJJUlZFdU9ZeFZteGpoWGh5di1xRDVwYVdUd0UtSGt4MHJTQUhtVkR0c0pWZzB4RlVOYm92d2FpZmlqeUVxMzNsMl9DOERXNUhiamJNN0xiNV80aEJMOHdYOExtUG8zN2MwNm50alFwemx1WDZqRHF4dzl3SXBYcUdaeDN0WjNwUmlEV0Y3Tl84VC0xaGFjUGxLZ3FPemZHM0JQd3hOLVRXZy14RmVlSEN5c2c4RVF3cUhiZHpWYUN6bjlpYzBEbThHRC1ZbXJJYk1XTzVXU2ZYcGRwOWNZRUl0MGtrOHRJMktVLVVObFh0QXJ3akN5VVVoTXlITnZFbTBlQ1hwZTJkUWF6VkFxLUNqcDNBY2lmZTZKSHVvSFZJenNKQlVUSW9zZElsakdjeDFFaFVXTUk5d1VQUVJqYWJCVTJickU0X2xXQnY4R1h2NW5xVDFBLTBpZ2xYQkRGV3d4TmNtQnE5RFk0bVFCdTFxN25VcWwyQy1kcWwtOVV3aDlFTnB1TU9lNkVuUTkzWDJMbzRqdTh2bjc0R2F6c0htQkVfX1FrME1Za2swb2ROM25uUmdibkgwNEF4cU1wRWZRQzFkaHhvdnVYRjFSdF81SGc4UEV5aVpFMjFtYWMzeHBHdVJhWnluV1VsbmdpMTh0Y3hUOHNPdWNvTE01T2s2ellfWURUUlhnWE9oZS0wOUJ3aTVaaEg5emRna3g4VW1wdF9RVEVHZjc4eVpucnVBZWZzcUVpSFlhVzVQMnpQTndOSkM2bk9JSFNVZ3ZEY3lGVHNTY01IcjFpejFkLmFSSlZlbW1KZUJMcXA1R3BoUFhrNl9OMzhJQnlEbVVSUnI2b0RvZVBSeFk" + "value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUl5WVdabU5tRmhNUzAzTm1Ka0xUUTBZVGN0WVRjek5DMDJaalZoWkRCaU5XRTRPVGdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQzB5TlRZaUxDSmxibU1pT2lKQk1qVTJRMEpETFVoVE5URXlJbjAubElmTmxIaG43ZDZBeUN0MnhNeFU0YUhBaEFUQm5Sc19QZlBJdUFnUEJCb0JURHpENG1JSXRjb2lkdWhYOEZTTXR4ZG9fTk85RkstLTRlNVhtQ0dHa2dKbVFKTFNsU1FfTEVxZ0Jldm5FeXc0LVJqT1pUeDRLZEFfUGdtV2RWZ3c1Z1pFZEl6MWlwWWRENnF5VjZ4SE1sWkpxR05VbnM5NlYtbDh1TkFqZ2RwcUp0dXdzNFVIMi1RdEhaTjdkTnRCSzFqeV9ORHNXSDlmMGNnbEhaMWhnUktWMFhJUnlWLU9lYzhZeGNxVGE0Sm1mZEhoQTJ4ZzJybFdmVERwRzlIOVZpNnd1VjZGWDZJanphRUNoV2lzX1NTbTJEYktmbzN2ODlxRUJ5cXZIdkVaTTFweGlTT053X1R3MklXZU5oaXRJMm90YWFnSGdpSi14cUhmOVRSNXF3LmRFaFUtR0c3WW13NkI4R0RaX01zeWcuYWIzQ0cwN3B4YkJYeWh1RThvNjM1dlVKbzktS1B4WGFmZzgyREExZlNTbG5oSF83RFJib0dydU5LZm9FWlpEQ3U1MzNhMjhIdEF3enpZWWtfak1YM084UFdRblpsS0JMcF9fWnR2enBMbE1YU0lTY2d4MWM3V29BWC1OZGw0bGNSbWRhQVBlYWg1OE9CT25zNTN6U21vRXE1VjhYSmZUTzhmMUdDZGdqNDRPQTkwdHQxbHlSNERoSkNVOGptbjlhczI0ekVHWFNMNDVhUGtVZnpUejY0VGhHNWFRb2Q5WlVKS3gwU3dfWGRoSERCYldNdFB2Ykt5SWpvUEVjWXQyR2EyWXJkaDJNVjUwRWI5TFM3akFzX2x3N1VQNS1fNzJFMWV3OGVNMnVfZ2pRMWZJenJUOFFHNlN3dXBqOXNZZldwaU5lQkV0cWhIUmJrOVoyUk9LNXJSODFUb2FqZzdsUU5MWnFEVEtOejJIS0wyQWJhdm5PQXE4M25rWUdfMG9FOGdfLW45RTlJbkVFamNWeGw0RmhsSEx5Sy1rNEFVS1dfTVN6LUZrR1hsalNFS1RLODdvZUxkakdoMkhfT1JMWU5XS2NXWkFfR3hvZTZLQmhhMEMycUhTb3hMVUZzZ1BxWnZLUVB2ZExsaVlHWDRUWmF0ZjMwLUJTNHpSRC1jNklmMGlGVEdlSGZDVE5tRXBUeW1FQWZ0Q1oyek0xbEhycFVKbnJBbllQRXlKdlZhb3V4QS1OTEdJeGFnc3JyUjJwaFE3VC1kdEJBNjBPdHhwTmw4bFRweG43TkJRVmN2dHh0blZvLWU1LVg2V2IydDN4S0ZYZkFuYU5rdmdhaXlVdF9jZkJ6REd5VzUzN0lkZjNKaDI5RVZ2YWo2TFJ3eHVfQ3VQV1Y3YjdNWDJtOWhSNjl4cHJGYkRKN3FQUVRaTC1wV0hVUkJLY21UVXNyNmY0ZlIyYTBMOW5lZVJkcjhkLTZqSlFPYUJ2a2p2MHNucFY5VzVZbVdaUGlLRXJsWmJ1dFBvZ2Y3ZjRMcndQRnlUNzQzXzJEcU5HcF9tbm9kQnlKcE5LTXZ3N01GUmdLRnIzUWNma09qOGpFRTM3UWNOSlpHRnNFTXBoZXNzX1JwdFk1OThrWURsaE10S0xGWk5ySjBtNmE4RG9ScVd1a2ZjMjQ1UVBZemo1R3gxMjl1d1p0aHpreTBINjJZQ0FIdnlDUEFFNUNMTmZkRHIxM2R3RFpwbUNjZHpsYnFoZXdSd0NtTEFyTFdyUmNnOEVHXzNXdFFPTjBWM0hKSkVUdkc0ekR1M01TNzVHTkI2T01PLTRtUE9NZ21mekFQTkJNYTJiU2M4dGhxcUtnd2RENmxOSzhRX3VwYmlUVy1mSjZKZm5oOGh5QlZkV2k3MHU1LTU3ejhtUkxPMmNkNzlTN2Y0NHVCTE8wXzVHN0tYUFBhS1NvS1loNGcyTGN5NmpoQnJLM2U5SU1CUE1PR3p4djVfX3J0aDBnTWNYd0pWcG9IUTNGblZqTDE1SDI2dzBUazR5d1lhX25fczNfRkJHU2g2SkdHcEsyMXpNQWhmZDFHQjZDc3NSZ1IzaFBURjZjNGpmblVUdmljaXVGX2ZfWXFramF4RVpTQnJoYkd4QU4zTFJLeE1WNXBjOWpyWF9YNXBNV3RELVJEazU4dURweGVrWUhRYmNSWWdCVFA2QnZWdnhVWUVSY0dGSVo0WE1HdVk2WDVNbW8xdUZlM0pSTGdycjk1b0hoalRxd2U3ejhoR2R6NlJSREZlb29WSDBNdnlKTUFma0FfRlZpazFJdkxTRGRzUTAxT0xTZFlYUTk2QkczLTRtTkFIcm5KZ3RZMzVXUV9HamR1eWN3RDNweVJSRWpxRWZ5dEV4Y3FFRjh4RDVQaUVwWU5FNTVDdkVxOFdaOVFxY0I4NWN2Ukd6OUduQkdiYk9xU2IxaWU2cnRHTTE2TTN6djZjUmM4NXFvQVRkNjdwOVRQZWoxQ01FYW9PYVhzemRlYVZPWFNOdlVGUktGUFBLU2U2MDZTR1lnLTRMX0diVnFGV0szYzMtcTNPQ1licWJiaXU5R1h6TE9sMHBvaUg5c1ZXWTNaWXFxTFhwZXlRbkVQaS1jSWV4eVZHeGFpRl9td0dRVFNrRVFPVVRSd0tXcEFOVGN5Z1B4Mk9JREtGZlQ2MjRuUjN3eWh2S04tS3o0MHo1bHcxMnI0THNqOG9KcFhIVUFXMGRQX01XODlNQlRtZ29lMWY4Z2tIYWpPZ3h5ak5hVDZtTmRzT3hpWDQ4cGhZNnpHNE1OOHpGa1RCVmtHTEZjcXhyS1VtSlV6YTEzbmU1NVFJNXBHRUN1M2t2WGFHeUNLZUVQdUczOC1xSWxpU2hsTWVRWllvNW5OZUJ6YlVaQXhqRlpTQmwwRDBIZDlSWWVIVjY1VF9rVzgwTFRHTTR0RHhxMjV4aDRvVXR6WmNsWGJzQnhkQjcyOFRVU1BEdlNEQXBQeTZUZW9IaHFTUzF1anI2VEJYSExTQXdET2xtb1dUNkZqanBvN204a1ZBUXc2REVGZFBDXzBfVnBXWmlOSGIzVmJraVFDamNabU5VbzYxdTA0ZTRFMEtTR1cyekVzY0ozczFNMG1lTGVTSm5vRWZpQXBDa19DLUVDNjM1c3p4bVQyRjQwc2dGeWtxZ0FkdFptSXlvQzVDVS1NN1hLd21BQXdIUDd3dEp2NnJOaHNGbXo1YWl2cm5WUVNrVDUyc1p4ZWFtc2d1RG1QTEZmNVlKaDRTSUJKTGpCVkI0QzdYeUM5bXRQR0RQb1lMQnV3UVBTSWxtWGM0QkhqVEotRlo3SzBKSmUwQjJBdWxobURDb2ZhRDdRcTdpeWxJN1lha2Z1YzlUVkd4b24wSHpSdHBiTFJqVHdzYXRJUGRJYlRjWG5veWlieGRGSHhiTndWQkk1anlPRHhDd0hJNUJMNnMyd0tHSzJJQkhWZUVLT3ZDQUJFbVNBM1prUVZrUHJsQWprenVBc0h4UWdidnVwUER5X3p0UUtsNDYtUzBIbzRyVTNDTDFucGZwNFc3WEgtTDIzUGhPbnc3NTNVLVc4TmUtQnNkTmlrYnZxTUx2WllvSUlGdkJjUnRJU3JwLThLdE45OHlCclFHdk11c0E5c01NRGFuVkIycGpGb1JoS3VhMUVnOUtVeHZ2TXU4MGgzLXRPWGFvNW9vQ052SHd1d0RZVXQwZUFJSkJvemRrRndZN1V0UllwZFFwc0lHMWZGRUpRTGFWVG1HNkUzS2NFdG0wYzh3bGZMU2lUZHBaaE5GU1hKRTNoWXRFOEVGVEs4ZVEyTm9qbWVJS3lFcHZvdUlPRFYyZnFjRnFwZ1FueFc5VWw2dWR6Wk1Ic1B6cWtJOWlaS093bDJ0a0lySFhSMGRoOHZFSUZmbnpXNE5LVVlDa0c3VXNmYUxqN0dQbVh2LUdWV0ZYMy1EdDc0NjhNWWk0RHdjREtiY0gzZVFOcVJvLW9JRTBVRWkyTTdyNzFxNVFXNG5VVVl5YTBQcG5KOWRMb0xxZk9LVXJDVk1yRTdqNzJPVGp2VXdHUDVVcXN5WUNFNlEwbG1uUEtIX25QNmhGNDk5RHVWbmJOX0VpZ296R0FTOE44QV9BMEg1X3VzQzcwTnkxTkdTN0E5RUxxalhSNnhHZGVPek5pZS1IVFB5amV3ODJKWUJsSkJSYUpaZEVUWXhFREp3U0NLU016ZXhzRzlxNTBfQzZEZ2ItM29sZng0OEpVZFFLQ0ltNFQ5V1hsUmNzQWtGM3NwaVN2Z3BoNWtFU2Fzam9KVHRXNVlKRWNuLS1UZzdPMW1iVVdRTWJYMy1SSGU5ZS1KYjVwZ1hXaXBsd3NueDN0M0ZZdWUyX2F2S0lWS0p0QVdvQWcybnllUkdlOGNFR0hPRnpYcTZvbHQzMk03aV8wVUxYVWRrN21OWjd2MGpDVk5MUFNTb1Y0QmYxRXg4YnBaZTRGV242WXJ4cEJhSUpOY2Q5RDRqQzYtQkZBaFFRbjl0aGI4RTdCZy05TVVmOVJxaUc3OTJfZmFJUmdzOXZBbHRZZ0tDSHRtQTFOUWQ2ZXZCaG1BNnF2Q1d3OW1JZEg1X0xjMWhHYUVzcGx5SGFXb2s5V0VVTnYxRjdJT010amFERUlURWR4anVLbVFuZllHYXNuenk4S0QtLXNHZERHVlJuVnVNTXcwR1RuWS1QaTlsUnRJTjJIWTR6TEMxT2x1eE1kNEpFVElmWXNLWHBiUWpkNkk4U3pNNmZjZFJOYnQyWlQ1SzVKdFBlUTJyem4xUmtZUHpiVTNLQUlseUNtUEF2TThGcW1XdFpnSnZsS0FnR3ZjTlhrNWpuMEJMV3FySXEwUExuNWU0Q2lUM0VHTlQxZS1IX1cyNW5TMmtGVWticHhob25OZEZqY3plTVFTclhHUng5eGYySGVqa01aZjdWNTFiRWxSQmlhNm5fMjEtbWpjWGFnaUFrM3dZR3ZTZ2t3M2pKT0tsOExfMENSSGRRWnVGbzVISFVwakxLZnoyem9LNWR0OW1DVWF5QU5WNWphRDZpNWRTR1pIejJQaW5iNUU1LWJXUVYzZUdSalM5bHo5M1FJWEo4X01GNGQ0b201MVkxSHphT2dsZXpxR01SckNjb292RWlBX0hwWjBNZnY5NW1vVjV6QzNLbG1QNGpxNjlmaHp2cHoyd1NYTXJpVjZOS2ZRWmktU1hpSzhCbXlsb3pERUhYRHctSHM2RWlFSXlNNUMyN09URUZ2OUZyQkhtR3BNak1mQnZZVUE4cmVlUmtkN0JKeWxnemRxYmFCTUl2cnJJNUs4dnNiM3lzQjVNZU9BQXNfa29TdEpzRnpOYWpkdFBqQTA0eENhOFlrR2J1RWo4OVhkRVA3VjFnSVlaS3NZVUM2dW5rOE9KbUFFN3drNEVLd1huRVh1RHlVMDN5ZC1mVGVOTFVUV3NKQUtrVmVpRng4dkRSd2hwRmRJZWtqVExVbXdkT1h2eVJZX0FnZzNwckQtY1ZLWDAyT0xrOWpwT2Z0TnllbkRkU2s1NHZQbExxU1JsSEZvZWVjSHdhbEVkY1hEYlBTcXFGeTBNcmlUemw4cDBkbmdFUFBnN0dsWEVFbHJQMnM5X2l3c00wM0pzcm1HTHNJSHU3bWFZTC1hLUlueWdfRXVkRGFOY3FaNUtkNGVNNXlnVWw0eHl0NXo0TXZQZkhNc3I3S2pYaVlZSkNoaGxhbUlRSTU3cE9CRkpMVnA5UE9mSGJ6Szg5dm95WWkyemZ3eFFZbDNtWjMzR2ZOZjY4RGVJaFlMbWRIVFV5UWVYMy11a1h1RzhucE4wbjVrbUFpUmZ4Z19SdkxRQU5zMFAzdmoxc0xHM2NWeDNXUFNpSGhoZDhnWHl1VEpnX3kyWUlaR2ltM1R3OHFHbGtLM29ldmw4d3pRWV9iYzFqZmczNmJmSEowUFFpSkdIMkoxenhseFo4S0xaQmxZdkJERExUZXB2dmF6by1DRnlmNVhNbEJoUmkyWkRvQXNRWGlKYmtzQ3RXYzh0djR4c1NBUEdOcVBfdi1BcHB0T3lZVmZmeGowVDFXOGcyd3ZIbXh3b3laNldCbDk3NFZremhydWYzaWY1azFtZndhcUlDUXhkNXA5eUp6emJVaW5aOVAxVWFOcDNKVGZCWEhJZVNZbWVjaVZNNUFXNXVJV0lYVFVucHAza0FZWFNLeWhNVW55aTdWMkNWeHhXUV8yREM5TWI1R2hhVGhvNWZLY2szZkR6MzRwZ2pnWGlhQ2NTdGpBVjc1OHNIWmVCZGdUQ25VaEZ6QkJvZzREQUJ1U1E4QkwwYl9ndDl1NGNVN3V1VmtyWWFraHlaTktzd0ZKVjFlSHU3c1B2Y0N0SEtGclUydkt1Y0NCRktfSUpSeTlzUnNKOE1WbTYxUzNoNXQ3aTNQZHJJaXR5dzAyUmFoeHJ1WTJKUDliWWIzWVl4RGd6VFZFVF9CLUU0R1JScXNJd2hlMHg3M1V0RDlNSUhoVTJDdHN5clhVNDZ2VDh5NEktODkwOF9yU2k0WDVvOG5fQm9fRHI5OE10MEFJeF9lamhiaS1LZjE5ejdPTjFoTU5YWENtckRIcEF2QmF6cVRKcjIycmN2UjE0RFhpazVRakpVek1SeDVvSkIwbGo1TVI5SG54R0V2aU1KZ3h6d2xVQS1zRFJ5eWNJTGZOOVM1MlAtWFNWenhRVWFiTk5xZmhta08yUjV6SVZWT3lpbTlURlRVT0FmNjRtdTF5aWtuWS1YaGFPMVlGZ1lmajBnSksyUmg3SWFZQ2xKeG5WRVhfdkZVWkNBOFFTUjE4cVlNbTRlVXF4dWdSYTV6OG53UmNMdHFTWTJZSHd3TjV4Z0VqZDRrSXhHNVBINXpyZlRudEpSZzRfX3hXTlBYbVZkQUxkWVM5SXVxbllBQmF5VkxhVFpIUm9wWDNfYzBYUlNTaV93TGl3ZTFIMkRoSmd1bTZjR1NnWWM2R25ROFdVVS1Pc0YtWDZTTEtHcFhZclpwc3FTbnQ0cmI2amg0LW5UM2xQejFydjJfN0RFTFZSSWRwZGwyTVBMbmg5VjV2c2NPMHVBR3F0SzBkT1hKUG8wQ1czUGsycDJjRl9acVRDOVNraHB2cjBLdmZnRFhwVkVCMC1VRzFRRHdPYmhERlVJSlV4Y2RZNy1Db0xFZVEyWl8xczZxbTZlNGNMWTBkdkltSURpbUY4cnFqZVZBM0UwNDI3bWFLMzZwV1NPeE51WVdtYnFPamdFOEJLMF9OUFJpLURVQkJncklDc1dKWWVyLTRtQ090aGI4MXVEZHB2WnZxempZTHVfWVFWZGMyQ215dUR3b01MVjdDSFdkU05YNXd0N2x0Yjc3Q25xaWktbWlxMi1odElLZXZlR0d6LXAxM0xmWVkyN1hla1ZZS2FPSEUzbnNibzZWSDI5TDFoVm9IN01FdjNKUDZhTll1LTM0SEplT0RhVHVKQk0wTkRaMm1RU29jUkwyRjJ3NV91VW5hV1FGNmwyMVN0bmI1b21QR3EtM3NkdWdFRHFWNDlISlMzbXdwRlNiaVAyWVJsZGkydDkwVzRrNFoydG1uQk9peDlGVTZuNU1NVkxKSmVPMDJWZFJ3NGFBcmdMdmY0SU9HT3Z5ZDlkRUg0M3FmX3hWVTZrcy1pcGVPcGRnZFlFU29CY3IzaEFQTjhhQ1daUjJBVHM0Mm1TVEIxM0gtTkZYSUJtMXJScHVwU3lmVl9IalFOajF2LVczNUxpN21VdlZSU1hGRHU2NmJFZDNLOHVsUV8wUFY4MkJJUkpPRjd3WXppLXdsR25NY0pPa3lTRnFCZW52TVlFZ3FwczlvNVBrbHNZQ2lYQXJPOEZ4SzJVNXNXdTFUVUk4OGJUSEIzamJpdXFwMW9lM0o1cTBSRlNXM0NodmFaelkwYUVZeGZuakd4RzlvZEZCNU5OSnFVbVBnNFE1UjhSWEs2OUlHQ0FiUUhScnBvZXlJMm9DT3MxcFhGNFZtZVRQVlpwRVRyOTF5bE5tbVRqRk41V1hzeEZoUXdNNWhRbW5LRng5XzhmRzBLTno0eG1PdzVZNFQtTXZxOGQxUjBtQmZaQjNyM1hrQ1VIZWh2WnJsMkp3MU9WTGk1LV9UdW5qOGpldVhHMUw0ZS1DNUp6TURPTnBrU1B1TS1NUmQ5Q3c3UGZSUkZMcWtsR29sOGt1TVNmQ0xlQWlLNXAtWEtKSEdEWGljUEtiT2J4dTRybVdKM0JrMWhVM0ZCODRHWUY5LV91LWZYdXRmWjA5U0hiM0lDaGtvSnZmSzJBUnhDZWQ1Ym82SUdMajVmcHdQbVVlUGhTel9mX1d5dWpmVjhyRkJuczdURTZndXhEUDhWLWtsSEFnY1BtYUZhdW1LcXMxVmhuOTFmZmw1VzJYSUlDYlhJbDZDWlQ5OUNfOHpSMDUxUS15NG1HbDNJSUJLY1pJWXRhVXc2UVdUVU1odldYVU5JdXFfbmlTV3pZcG5XSGdhSEtLS2M0Ukt5VnJ6aVdUWG9IUXhnOGIxcUh1SFBCSUR5U08xZEdtT0pySVk1RFZ1X3Z4MHFjdGdoa0xyUUFNN3hiczdsRGhRdlNxY2xfcFlDSkJnamNEUDlsYndEdVpUOS12eDFBTWtnRjJmUkY1bXJ5MlYyU3gybDk3NFNIYlZCN2tqSmdFRDJvMDJqaGpBTzBnTzNPVC1ua194Z21MSl95SjBjaktyeGdyWUdDWGY0d1FYNDMxTU5LVHRoTkpfOG0yWmliREJfVS15UUp1X2tDejdvSFlKal8xZVVuQ0t2eF9PcXYyLTFORVNLbXJIQXRhcjJJb2tsUDBRMFFXRy1NM2MxOXY0cE00QlZVaDRNZ1ZzQU9BaTFKanBYekRpTklfOUpHbm5lQklXYzdod3FBWHRSZlZzMXJpaFBsdGlRcFlwV2JZUDRfQTNueHBMdnczNnhyZ1J3c1NTZjdvb21oZnkzanhrb3RzWVRNOTJRUE54WExtTDd2MWFndi1fTWhzdjluY1BXdXhLa0N1YWpMbHVSM0JSZE83UFdnbjZnb2VUb3RISmhSeUtWbkFxUXQ4LUY1TklVRURWX3JxVG1PUDk3NFRRSk5vMUZ0dEV3cnVQdFV1VVZJUEpZWGJXQmxESjhFQW1ndEIyeXZDb1lvRjBfS2g2TUZXNEhYVnAydFhXUWZIRlpPajNmZ0hZZjJPck9fVXlxR2J2V3NydEVCa2Y1WmduSnJpRWVEdk9QZzNKMlFTVjh2WXp2clFnQmxpTTZaZ1hUd2xKWkFJSU1XT1A2TXBvbVEyUnMzc1NjMG03ZXF6SElleEdZQUdUOGtWNjJDNUp6NjZZZU1pMUFKQnlsY0trT096TEw1YWxfYTljQlYwYmszdkZmVDY1RjFERHFRaXRIYWxHTEEzYmJoeU5kUzBQemJyWlVJc3EybXpYaFVhZExKZWY4NlZfdTNyejBIYmhpQjRaa0hGQXJ6U1FyN3RwZS1STGVoUDRaVXFJOGhvU2FMbkROSi12RTI2b3lENEhyZTNNY0paYWJwQVp0U1NDQ2ZUZVBldlZHc3oyRDBXckNDaENqN1Fhajk5NXVVdUZGc2hEa1p0MnlTSDBlZ3lRQjZyZnhHcU1BZS01c3pRbThMWGRtVFdTOUNlS0tadnJpcDZEbm1ubE5wVnlQWkNRczBOVktmRlBoUlQ4NmRTZlpKZU9hLTJNQTg0R1dDVnNwVjVmeWVHdzJpbm9iX2VsY2JfYk5iUUVScHh2bUtpdnlmN0pEYTd0NlZsamtIa2UySVJmNU9BMmhjclZLYk83TGhPSmlCemx5cXNtWkU1Q0tKR1pmalJqMlZhZldITnFzNVBWblNxejlQdEdOdzNZeFFGZDRwU1hOMF9RTm9tTjZka1pzWEwzSVNFWVFzRWRub1dJY1V1VTRRMWRENURfb0FfaEIxRFAyS194am9jYUpRckNZaXhwYUZGWWxmOUZ2NUZndmFXTkxhU2FHZ1JGbGxGdjl4Y3RZSjJBdWpobVVpSkVSYWptdk1pVll2bUdoeW8xdjhCd1BXX3NUb2FpRXpfbWFZUlNPajdlLUZDOXRMd0ZtelY2TTdad01NTU5Dd3lVWnlld09nU3A5bXFrLVlJb2JBSDF1UmFsdUhINzh5T21namVWRG5ITXZvR0NiUHZUU2trbEtxaFU5OEFNOEd3ZEVnWkdISTkwaXF5bENoNXI3OU9FUlBQY0x4THdIbFhZS3RqWGJZMHZ4aXJELXh1cHZRWXJXWTQ2NmJBZ0wxVkpaWkp6S1lYUUk0RUpndi51TGxjMUpEeGtib3ItdHpfZGFYU3g0U0g0dG1iaE5zbkJXY25wVmpycngw" }, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "693", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:34 GMT", + "Date": "Mon, 20 Dec 2021 16:40:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -529,12 +528,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "618528f9-e1d1-45e6-b768-e602009bf89a", + "x-ms-request-id": "0d3de4f6-a98e-450b-b898-0fe64e19a12f", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/c739ce059c4c40cdaff9e6b747d4f80c", + "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/6846e40e9aba48f98d604508990af9a5", "kty": "RSA", "key_ops": [ "encrypt", @@ -544,13 +543,13 @@ "wrapKey", "unwrapKey" ], - "n": "2fDKZM6HDH377J4_DPdBYPECe9TaTvehECH3izi-vtjBbk91vOm2MoHN79QJGs2RwHQdQkEvqo3saJlbCuDNdXJd_MH2E70LBj7iK52pLiIzeZsUaUnq70JhQH3z-x4vjSU9-n2LXumybsqGpAJugNB9_9R7AEvdbE3uOsH-3lHAB-_AO3HQdxs-1E5ML3p_ib4W8MNiFc2M24G2Yidk0z3jn3G4t0eoycLu-7Q4aavtG5pgPLZL4sHmjAqjOu_-MN0yweZM7XAqKbm1B5Mf00fMnp-BxQmRA667PilK81D2m6QZtcIdXzfA2SkrzqVTg4211ODhI12sCp_Zh3rQoQ", + "n": "-LoBXWRIHj2lypE0QmxZNhuj2jZtSdHZOXsT864PNa5CQSzzTOZ3KGH2rRG07mwDWk6kdeSn__oDl_veHog6qB1ZELxGnCZmp66V_YRKczJ61QQGUmjl5cFO0CqSqW-QtS4ExRpyIeO6N9eI8THourGY7FCI9eR4Q9XUH-P_qUzAPpF5Y3veXvJHuzPKx3rL4pzY0YVZyYs3fvW7bpgKRjLasnxH-JL0JdtTvSV_73zPqV_4H9xyPpqZTgP0tS3ofdlvyL0WcbVzogKSYmhXg0qq_6HuLZ4abVvXye95ogQgeGCGTUhlJuygyxgDx2vfcKSByPAfgajoUKjyA84EQQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070364, - "updated": 1639070364, + "created": 1640018441, + "updated": 1640018441, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -575,7 +574,7 @@ "Cache-Control": "no-cache", "Content-Length": "693", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:34 GMT", + "Date": "Mon, 20 Dec 2021 16:40:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -583,12 +582,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b6ae1c01-c74d-48e9-98a0-a315845846dd", + "x-ms-request-id": "2d7af094-dad7-4704-b238-358c311b4b2e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/c739ce059c4c40cdaff9e6b747d4f80c", + "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/6846e40e9aba48f98d604508990af9a5", "kty": "RSA", "key_ops": [ "encrypt", @@ -598,13 +597,13 @@ "wrapKey", "unwrapKey" ], - "n": "2fDKZM6HDH377J4_DPdBYPECe9TaTvehECH3izi-vtjBbk91vOm2MoHN79QJGs2RwHQdQkEvqo3saJlbCuDNdXJd_MH2E70LBj7iK52pLiIzeZsUaUnq70JhQH3z-x4vjSU9-n2LXumybsqGpAJugNB9_9R7AEvdbE3uOsH-3lHAB-_AO3HQdxs-1E5ML3p_ib4W8MNiFc2M24G2Yidk0z3jn3G4t0eoycLu-7Q4aavtG5pgPLZL4sHmjAqjOu_-MN0yweZM7XAqKbm1B5Mf00fMnp-BxQmRA667PilK81D2m6QZtcIdXzfA2SkrzqVTg4211ODhI12sCp_Zh3rQoQ", + "n": "-LoBXWRIHj2lypE0QmxZNhuj2jZtSdHZOXsT864PNa5CQSzzTOZ3KGH2rRG07mwDWk6kdeSn__oDl_veHog6qB1ZELxGnCZmp66V_YRKczJ61QQGUmjl5cFO0CqSqW-QtS4ExRpyIeO6N9eI8THourGY7FCI9eR4Q9XUH-P_qUzAPpF5Y3veXvJHuzPKx3rL4pzY0YVZyYs3fvW7bpgKRjLasnxH-JL0JdtTvSV_73zPqV_4H9xyPpqZTgP0tS3ofdlvyL0WcbVzogKSYmhXg0qq_6HuLZ4abVvXye95ogQgeGCGTUhlJuygyxgDx2vfcKSByPAfgajoUKjyA84EQQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070364, - "updated": 1639070364, + "created": 1640018441, + "updated": 1640018441, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -630,7 +629,7 @@ "Cache-Control": "private", "Content-Length": "3420", "Content-Type": "text/html; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:34 GMT", + "Date": "Mon, 20 Dec 2021 16:40:51 GMT", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Powered-By": "ASP.NET" @@ -719,230 +718,29 @@ ] }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/backup-key564789157?api-version=7.3-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "DELETE", - ":path": "/keys/backup-key564789157?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "831", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "676930e1-5b7a-4a64-8de4-0bd27dafa035", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157", - "deletedDate": 1639070374, - "scheduledPurgeDate": 1639675174, - "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/c739ce059c4c40cdaff9e6b747d4f80c", - "kty": "RSA", - "key_ops": [ - "encrypt", - "decrypt", - "sign", - "verify", - "wrapKey", - "unwrapKey" - ], - "n": "2fDKZM6HDH377J4_DPdBYPECe9TaTvehECH3izi-vtjBbk91vOm2MoHN79QJGs2RwHQdQkEvqo3saJlbCuDNdXJd_MH2E70LBj7iK52pLiIzeZsUaUnq70JhQH3z-x4vjSU9-n2LXumybsqGpAJugNB9_9R7AEvdbE3uOsH-3lHAB-_AO3HQdxs-1E5ML3p_ib4W8MNiFc2M24G2Yidk0z3jn3G4t0eoycLu-7Q4aavtG5pgPLZL4sHmjAqjOu_-MN0yweZM7XAqKbm1B5Mf00fMnp-BxQmRA667PilK81D2m6QZtcIdXzfA2SkrzqVTg4211ODhI12sCp_Zh3rQoQ", - "e": "AQAB" - }, - "attributes": { - "enabled": true, - "created": 1639070364, - "updated": 1639070364, - "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "recoverableDays": 7 - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/backup-key564789157?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "87", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "be1d62a8-dcff-423a-a1f9-d2a3f5a4a09c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: backup-key564789157" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/backup-key564789157?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "87", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "744b20cc-7f80-4692-a54e-47b368bfd7fa", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: backup-key564789157" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/backup-key564789157?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "87", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "22dfa113-911a-4275-b970-655a336ce2fa", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: backup-key564789157" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157?api-version=7.3-preview", - "RequestMethod": "GET", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/restore?api-version=7.3-preview", + "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/backup-key564789157?api-version=7.3-preview", + ":method": "POST", + ":path": "/keys/restore?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", + "Content-Length": "28", + "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "87", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "90dde440-d473-4f55-a284-6fbfb6a49baf", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: backup-key564789157" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/backup-key564789157?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + "RequestBody": { + "value": "ZG9lc25vdGV4aXN0" }, - "RequestBody": null, - "StatusCode": 404, + "StatusCode": 400, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "87", + "Content-Length": "78", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:35 GMT", + "Date": "Mon, 20 Dec 2021 16:40:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -950,23 +748,23 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "db3abf9b-5cd3-4bbc-8a5f-b8cbd7c94740", + "x-ms-request-id": "7a2767e5-a968-40fe-bc4b-841efc7af0b1", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: backup-key564789157" + "code": "Malformed backup blob", + "message": "Backup blob is corrupt." } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157?api-version=7.3-preview", - "RequestMethod": "GET", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/backup-key564789157?api-version=7.3-preview", + "RequestMethod": "DELETE", "RequestHeaders": { ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/backup-key564789157?api-version=7.3-preview", + ":method": "DELETE", + ":path": "/keys/backup-key564789157?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -974,12 +772,12 @@ "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, - "StatusCode": 404, + "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "87", + "Content-Length": "831", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -987,13 +785,33 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "27d7d140-3ddb-4e66-894c-11e1effd3d81", + "x-ms-request-id": "11b74334-d175-405b-a126-1559808218cc", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: backup-key564789157" + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157", + "deletedDate": 1640018451, + "scheduledPurgeDate": 1640623251, + "key": { + "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/6846e40e9aba48f98d604508990af9a5", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "-LoBXWRIHj2lypE0QmxZNhuj2jZtSdHZOXsT864PNa5CQSzzTOZ3KGH2rRG07mwDWk6kdeSn__oDl_veHog6qB1ZELxGnCZmp66V_YRKczJ61QQGUmjl5cFO0CqSqW-QtS4ExRpyIeO6N9eI8THourGY7FCI9eR4Q9XUH-P_qUzAPpF5Y3veXvJHuzPKx3rL4pzY0YVZyYs3fvW7bpgKRjLasnxH-JL0JdtTvSV_73zPqV_4H9xyPpqZTgP0tS3ofdlvyL0WcbVzogKSYmhXg0qq_6HuLZ4abVvXye95ogQgeGCGTUhlJuygyxgDx2vfcKSByPAfgajoUKjyA84EQQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1640018441, + "updated": 1640018441, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 } } }, @@ -1016,7 +834,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1024,7 +842,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "97dffb53-d866-4490-9c8a-c9566f96294a", + "x-ms-request-id": "ade1c004-4594-4658-8c91-2f4ffaa1270d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1053,7 +871,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:51 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1061,7 +879,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d20aaf1f-b109-42b9-b8dd-8bae5382773e", + "x-ms-request-id": "32272a97-beed-4a16-a807-6d87d0382304", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1090,7 +908,7 @@ "Cache-Control": "no-cache", "Content-Length": "87", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:52 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1098,7 +916,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d2162698-1259-42f6-bd84-e4d96653de2a", + "x-ms-request-id": "5caf1947-6c3a-424a-9062-8c9739491fcd", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1127,7 +945,7 @@ "Cache-Control": "no-cache", "Content-Length": "831", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:19:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:52 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1135,15 +953,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "74bb1a45-8058-4bbc-b660-1ce5909efaff", + "x-ms-request-id": "2ce34dcd-a78d-439e-af2b-ba5551079313", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/backup-key564789157", - "deletedDate": 1639070374, - "scheduledPurgeDate": 1639675174, + "deletedDate": 1640018451, + "scheduledPurgeDate": 1640623251, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/c739ce059c4c40cdaff9e6b747d4f80c", + "kid": "https://fakekvurl.vault.azure.net/keys/backup-key564789157/6846e40e9aba48f98d604508990af9a5", "kty": "RSA", "key_ops": [ "encrypt", @@ -1153,13 +971,13 @@ "wrapKey", "unwrapKey" ], - "n": "2fDKZM6HDH377J4_DPdBYPECe9TaTvehECH3izi-vtjBbk91vOm2MoHN79QJGs2RwHQdQkEvqo3saJlbCuDNdXJd_MH2E70LBj7iK52pLiIzeZsUaUnq70JhQH3z-x4vjSU9-n2LXumybsqGpAJugNB9_9R7AEvdbE3uOsH-3lHAB-_AO3HQdxs-1E5ML3p_ib4W8MNiFc2M24G2Yidk0z3jn3G4t0eoycLu-7Q4aavtG5pgPLZL4sHmjAqjOu_-MN0yweZM7XAqKbm1B5Mf00fMnp-BxQmRA667PilK81D2m6QZtcIdXzfA2SkrzqVTg4211ODhI12sCp_Zh3rQoQ", + "n": "-LoBXWRIHj2lypE0QmxZNhuj2jZtSdHZOXsT864PNa5CQSzzTOZ3KGH2rRG07mwDWk6kdeSn__oDl_veHog6qB1ZELxGnCZmp66V_YRKczJ61QQGUmjl5cFO0CqSqW-QtS4ExRpyIeO6N9eI8THourGY7FCI9eR4Q9XUH-P_qUzAPpF5Y3veXvJHuzPKx3rL4pzY0YVZyYs3fvW7bpgKRjLasnxH-JL0JdtTvSV_73zPqV_4H9xyPpqZTgP0tS3ofdlvyL0WcbVzogKSYmhXg0qq_6HuLZ4abVvXye95ogQgeGCGTUhlJuygyxgDx2vfcKSByPAfgajoUKjyA84EQQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070364, - "updated": 1639070364, + "created": 1640018441, + "updated": 1640018441, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1182,7 +1000,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 17:19:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:52 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1190,7 +1008,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "fb4cc0b2-d18d-4169-bc0e-f0d51b015c34", + "x-ms-request-id": "d365fdb1-0908-4b64-a9c1-a6dd78c60005", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestClient_Encrypt.json b/sdk/keyvault/azkeys/testdata/recordings/TestClient_Encrypt.json deleted file mode 100644 index bd2772aacc79..000000000000 --- a/sdk/keyvault/azkeys/testdata/recordings/TestClient_Encrypt.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4081119768/create?api-version=7.3-preview", - "RequestMethod": "POST", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "POST", - ":path": "/keys/key4081119768/create?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Content-Length": "0", - "Content-Type": "application/json", - "User-Agent": "azsdk-go-internal/v0.1.0 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 401, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "97", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 28 Oct 2021 16:37:08 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://vault.azure.net\u0022", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "southcentralus", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "51b6ea2b-2cee-4df9-bfd7-2d27177c30e0", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "Unauthorized", - "message": "AKV10000: Request is missing a Bearer or PoP token." - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4081119768/create?api-version=7.3-preview", - "RequestMethod": "POST", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "POST", - ":path": "/keys/key4081119768/create?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "Content-Length": "13", - "Content-Type": "application/json", - "User-Agent": "azsdk-go-internal/v0.1.0 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": { - "kty": "RSA" - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "685", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 28 Oct 2021 16:37:09 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "southcentralus", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "754974a3-3bd4-410f-808b-132bacbce212", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key4081119768/0e9656918a8e4b98b65759f2047a5374", - "kty": "RSA", - "key_ops": [ - "encrypt", - "decrypt", - "sign", - "verify", - "wrapKey", - "unwrapKey" - ], - "n": "4x16xYmm0hsLeVBoOUR9uTZ-92vB62IviXKL-PlarW2u5EiVIKsr2iIcFMpaFd7Qe-zUu2uvYlrsb-_J6iGvTzrCXaa_n0HCZUUG5Wl8rpEno4y_LB6mCD4a5PzRvTDzQVdQ7S136_yWf6r_v0q1fpwnSFIxLtiGmLvmDeqCW7VCQ1zH7AawGNf5ZC3PbT7uScL9PFmNaZCrHw6CfXsMtyuSEKu6KYLJXj5zhTqPGgIroFZyE_7uGB1ll9sLM3omBnpMyrpr9d8xV5GkRm0--y66VRe6oOT_haLyv95-tUxZDM7o0JEPPtLrlNLk46ip_HaVHC_yDOm3dxg95iNygQ", - "e": "AQAB" - }, - "attributes": { - "enabled": true, - "created": 1635439029, - "updated": 1635439029, - "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "recoverableDays": 7 - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4081119768/0e9656918a8e4b98b65759f2047a5374/encrypt?api-version=7.3-preview", - "RequestMethod": "POST", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "POST", - ":path": "/keys/key4081119768/0e9656918a8e4b98b65759f2047a5374/encrypt?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Content-Length": "0", - "Content-Type": "application/json", - "User-Agent": "azsdk-go-internal/v0.1.0 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 401, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "97", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 28 Oct 2021 16:37:09 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "WWW-Authenticate": "Bearer authorization=\u0022https://login.windows.net/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://vault.azure.net\u0022", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "southcentralus", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "8e3b8545-d760-41d4-a881-6cb0598c664b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "Unauthorized", - "message": "AKV10000: Request is missing a Bearer or PoP token." - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4081119768/0e9656918a8e4b98b65759f2047a5374/encrypt?api-version=7.3-preview", - "RequestMethod": "POST", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "POST", - ":path": "/keys/key4081119768/0e9656918a8e4b98b65759f2047a5374/encrypt?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "Content-Length": "41", - "Content-Type": "application/json", - "User-Agent": "azsdk-go-internal/v0.1.0 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": { - "alg": "RSA-OAEP", - "value": "cGxhaW50ZXh0" - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "446", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 28 Oct 2021 16:37:09 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "southcentralus", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "00dfe177-c1dc-4df4-af91-0947277a370b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "kid": "https://fakekvurl.vault.azure.net/keys/key4081119768/0e9656918a8e4b98b65759f2047a5374", - "value": "tt7kiz49F7d4-0wWKPOLRmNudFC8YLQOon_omWjhZHROYbQJhiDlkd0gVk_yT0CjHG9QNphy1f4WkR31VOfw9Je7lnfk5Vs5fid_jntPuK6Rx49mQg39aZ349u03a7YGexp4YEczyOT38DzeGDfUhaZdH0iKW0uneR9pZpZqCAwMYZYgEcBH3g4d-8gVNSDjilWWzoPT2TNn7fAUpzaOdtfukjXeo9-XsjJbpoGRZbDTFa-ouYxQrepftOkuRRwLfLVxjHIlA1zdnBEQ_imelU0tOWs8YKxidr3PsjrfnSd8rdply3jhwlspouhg4Ng35h7GXu6pVVn3Scvxn-ygmw" - } - } - ], - "Variables": {} -} diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestClient_Decrypt.json b/sdk/keyvault/azkeys/testdata/recordings/TestClient_EncryptDecrypt.json similarity index 66% rename from sdk/keyvault/azkeys/testdata/recordings/TestClient_Decrypt.json rename to sdk/keyvault/azkeys/testdata/recordings/TestClient_EncryptDecrypt.json index 562504805662..d83cf387ad2a 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestClient_Decrypt.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestClient_EncryptDecrypt.json @@ -1,17 +1,16 @@ { "Entries": [ { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key89075156/create?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4012487705/create?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key89075156/create?api-version=7.3-preview", + ":path": "/keys/key4012487705/create?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:26 GMT", + "Date": "Mon, 20 Dec 2021 18:45:43 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "50d06b1b-59c6-46f7-99d7-c47b476eead4", + "x-ms-request-id": "d638b21d-fab3-4610-9e76-9ea495cb10ae", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -40,12 +39,12 @@ } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key89075156/create?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4012487705/create?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key89075156/create?api-version=7.3-preview", + ":path": "/keys/key4012487705/create?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -60,9 +59,9 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "685", + "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:27 GMT", + "Date": "Mon, 20 Dec 2021 18:45:44 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1f897cde-d69d-4b18-be96-40515ccfbac5", + "x-ms-request-id": "f7123014-f990-4e95-9c75-3dde4b9e4698", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7", + "kid": "https://fakekvurl.vault.azure.net/keys/key4012487705/b2cce3c11384482b89135466190bf081", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,30 +84,29 @@ "wrapKey", "unwrapKey" ], - "n": "yFhGI0tecUXgT4Qk37OOTtq4bG19EMxRhywg8P4qhS6A2IHH1h5KVe5D7Dy3DQsUyIgTST93lwHPgXKvTFDY_qqCpL2e0K3hE-xIrIYIeLP73tB7IwD0V-Tg4nJYzOoxEWDnmn7a0fXBEipPRqjJ5iJMilE2EbGPOIX2eRC-KFhC6_TYCQVHEfbClgP0WtfbKFA_aaKVkQCHlqhAuMvq9Q5oYz4YTz8xiZVSYEEqtJKXiO483olnCtTiSwRDiz_7bTHeylnlYeHzGUMTZVUtAuZNcvwTRQZmkTqLip4LWlIZffYQeYM8H53wIIZGz_usMiNpAJGzRkPE--6YJu0RQQ", + "n": "0Z6eSymgnJq1v_AHMlPLmPjFjDCe1fVMOv0XPSp8ftV8pwtosVQZJ79xgDeB29TDYUufiIz1dKB9fMToEm8r_IvIkug6YdRFVH87tfkM5MRH5R7TuhKvjaQ-xqqIulgTVZYL3UgZscBp5UVL-si5bgJYDaJLgFFErvgpCeNYtayJDY5tGAelQ5Zj4Z0nUKVZ70xbW7N0TeA7uK40N294GP-Q1dnTAFb_jcoksCW8iNso0bdzfrO8o0cGZTqe10FMu4AUUNBiOOYzojIOTQKcVzUBI0f2hwlVLn27noHe5OR8VL7iB38b5OVPDRgZKX-PSGK5Y3c6yeSrTWgxidjJIQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639001126, - "updated": 1639001126, + "created": 1640025944, + "updated": 1640025944, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7/encrypt?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4012487705/b2cce3c11384482b89135466190bf081/encrypt?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7/encrypt?api-version=7.3-preview", + ":path": "/keys/key4012487705/b2cce3c11384482b89135466190bf081/encrypt?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -117,7 +115,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:27 GMT", + "Date": "Mon, 20 Dec 2021 18:45:44 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -126,7 +124,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0727149a-15e8-4743-899e-cb5f8d7156a9", + "x-ms-request-id": "ea49cc3b-612c-47b6-a1e8-b3d7259002c1", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -137,12 +135,12 @@ } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7/encrypt?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4012487705/b2cce3c11384482b89135466190bf081/encrypt?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7/encrypt?api-version=7.3-preview", + ":path": "/keys/key4012487705/b2cce3c11384482b89135466190bf081/encrypt?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -158,9 +156,9 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "444", + "Content-Length": "446", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:27 GMT", + "Date": "Mon, 20 Dec 2021 18:45:44 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -168,21 +166,21 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "74d9e9fc-d4ae-461b-b89c-e97aa7b5b538", + "x-ms-request-id": "ea743fff-111d-4535-91d8-361201bc715e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "kid": "https://rosebud.vault.azure.net/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7", - "value": "UrbUKNSMh6XNG9rN-rv_17kxRKrOOM7PO0NawBjAWjUTL-kHZzRwhzZ7V1rQWGSaQRGJzfdJccFbRznyT7jOHyNNKpbLSQ1v7gt8UaPoDZUa_Z91namstiLf4koRg37sWbJSZvOyTuyG2-sD1zDNgu0ldx0TxDMgjBZ0Wv3u353OkzhLxkfNuIDptfyts3aOGGOBp4oVD1bl48rePOkvo-95AGuDfKRuFGvXD_9CfGxe4REcC7ciUNlHzwZlijsYEAUApd6JodNmO3F8ZaIVXAXTb1uY8upqUlAiPEp5g9O_YOuc5UTESn8Xg63_eHyBTVO6Iwj6LltV-zPeWzmI_A" + "kid": "https://rosebud.vault.azure.net/keys/key4012487705/b2cce3c11384482b89135466190bf081", + "value": "ldOik7A278OmYxZtRjPhn_WmvJELZ051dWi2rV3TgblpKY6KHccTYrY5yvTp_vkEQKaorQn5npzGOg-5-4-ytjghW1OeLWUxC1HbaUX2SWVS0HR3pYewDtIgNtTfGTzmxLWHfxZVPPRu9GyGEYNBxUwwgwUVbvOZdc9idTHZ-DxM75wZiiqt2gPx7RRrFKIq-vnZrrrmpGStkhGJ-exyakwmO5-b5_BhwtGzObWO0UxDOfr3s0vXAqs4eVp-lLp53SHM46LcwxKUPNzSM0dK6_9XwzCAcFzgLHAjia7WmoRvBY9y8TrCYIM_52nDfq9Wr3xxSbgjyrkislCmN1Gytg" } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7/decrypt?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key4012487705/b2cce3c11384482b89135466190bf081/decrypt?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7/decrypt?api-version=7.3-preview", + ":path": "/keys/key4012487705/b2cce3c11384482b89135466190bf081/decrypt?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -193,14 +191,14 @@ }, "RequestBody": { "alg": "RSA-OAEP", - "value": "UrbUKNSMh6XNG9rN-rv_17kxRKrOOM7PO0NawBjAWjUTL-kHZzRwhzZ7V1rQWGSaQRGJzfdJccFbRznyT7jOHyNNKpbLSQ1v7gt8UaPoDZUa_Z91namstiLf4koRg37sWbJSZvOyTuyG2-sD1zDNgu0ldx0TxDMgjBZ0Wv3u353OkzhLxkfNuIDptfyts3aOGGOBp4oVD1bl48rePOkvo-95AGuDfKRuFGvXD_9CfGxe4REcC7ciUNlHzwZlijsYEAUApd6JodNmO3F8ZaIVXAXTb1uY8upqUlAiPEp5g9O_YOuc5UTESn8Xg63_eHyBTVO6Iwj6LltV-zPeWzmI_A" + "value": "ldOik7A278OmYxZtRjPhn_WmvJELZ051dWi2rV3TgblpKY6KHccTYrY5yvTp_vkEQKaorQn5npzGOg-5-4-ytjghW1OeLWUxC1HbaUX2SWVS0HR3pYewDtIgNtTfGTzmxLWHfxZVPPRu9GyGEYNBxUwwgwUVbvOZdc9idTHZ-DxM75wZiiqt2gPx7RRrFKIq-vnZrrrmpGStkhGJ-exyakwmO5-b5_BhwtGzObWO0UxDOfr3s0vXAqs4eVp-lLp53SHM46LcwxKUPNzSM0dK6_9XwzCAcFzgLHAjia7WmoRvBY9y8TrCYIM_52nDfq9Wr3xxSbgjyrkislCmN1Gytg" }, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "114", + "Content-Length": "116", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:27 GMT", + "Date": "Mon, 20 Dec 2021 18:45:44 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -208,11 +206,11 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "07b5ff48-f631-476a-921d-ae383b502a90", + "x-ms-request-id": "49bdf412-697e-4368-bacb-ccdf081a8ed9", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "kid": "https://rosebud.vault.azure.net/keys/key89075156/0b29f1d3760f4407aeb996868c9a02a7", + "kid": "https://rosebud.vault.azure.net/keys/key4012487705/b2cce3c11384482b89135466190bf081", "value": "cGxhaW50ZXh0" } } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestClient_SignVerify.json b/sdk/keyvault/azkeys/testdata/recordings/TestClient_SignVerify.json index e115ed6a66f0..202b4656c381 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestClient_SignVerify.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestClient_SignVerify.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:29 GMT", + "Date": "Mon, 20 Dec 2021 18:45:45 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2db5dc83-f6fb-4d89-a310-1fea8ab88161", + "x-ms-request-id": "994767a9-8333-4a7a-b19e-781d7b72d6f1", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:29 GMT", + "Date": "Mon, 20 Dec 2021 18:45:45 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1ea19173-1083-4f3c-85b9-4041081a4833", + "x-ms-request-id": "5100c0fb-6219-4409-b346-85869e230c1a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670", + "kid": "https://fakekvurl.vault.azure.net/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,30 +84,29 @@ "wrapKey", "unwrapKey" ], - "n": "tOuwyx7yawpMkzQ1n0skQTLtCjBdSoyAoiqmTFuvNi0GvAztViB3S60jROKz8mFHqSfIi9rfu_9UAggsZi-Dw3GP6fLfSF_089awzIFVeLqIpz6lgvC3SCnGtzhpNQcoSnqaOKOrR3Qlx2TDseUdQfPgmhIA4UmQTZSs7oXDEiz9TBak5GQZ7w4d_PwJtkLkf3DfYk_myjFQzfpWoCkPZ6J7iqsZS5TK2cxHus8Wvhs0S9aFgMADkPiFopanwBzQn2pzT7CeHABbW8eEYjq2JvpolnngvQehOQ3TsfQdd_OhZhE6lX085EmCHBLRRkCYDEEfKlRquy0D5p1y7PbcKQ", + "n": "qbou69aN-0UejsQJz6iDyxY104ReWd8vcJHthdfnwdypCDm1F0PeW7FQvn8TTI-QZHevRLlWLO9pb3YfkBMk7q2WeCU0La4et6SeYlVoRPk2omQI4TJp6SoLK62Jms1qyQaTQHgpK5u2Fdr3pxfWrT7QxAk73SaIzb9KstzXzIPlbEcIG5x8XvmvXo89bqMV3V_29pf0rhV1hPbrokV2JH5aw4rfTrlBvKzeqIxnEFUDG4vq0nWWgXoq8WFuJtW0HWrjSCtHSnD728wOFwvi2WlJcNv5-c1t94b4waoC7yfe0t8m9ppeipzF-qBot3nJ1evJEbf46j8yEVzm4kguaQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639001130, - "updated": 1639001130, + "created": 1640025946, + "updated": 1640025946, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670/sign?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e/sign?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670/sign?api-version=7.3-preview", + ":path": "/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e/sign?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -117,7 +115,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:29 GMT", + "Date": "Mon, 20 Dec 2021 18:45:46 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -126,7 +124,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e40b30c6-4614-4d9a-bfdd-cd940ebf2800", + "x-ms-request-id": "4f521e66-b5ed-4df8-bec8-e31bdfa30d7c", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -137,12 +135,12 @@ } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670/sign?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e/sign?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670/sign?api-version=7.3-preview", + ":path": "/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e/sign?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -160,7 +158,7 @@ "Cache-Control": "no-cache", "Content-Length": "446", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:30 GMT", + "Date": "Mon, 20 Dec 2021 18:45:46 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -168,21 +166,21 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "902da9f3-a505-4800-b3e8-3b507fbaefe5", + "x-ms-request-id": "4d3ea102-d515-4993-a208-287956cb2dfa", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "kid": "https://rosebud.vault.azure.net/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670", - "value": "M1guY2j9XHlHpLPYXD79L1CaTcy3B6XnHE3Fq6QvAzxMP8yngdXlMBVZ42iMKJwdivLS4pFUIH8hCV4IKgU9w-rAGhfzgsuIVErWb82aTbUF-I2j2EQha3HCKmhrw1L-s2jJrN1q60J9_tl_Dti6XCT8jRKS4RACUQedsPUTunFIcqTnaVnAn2PyeB_J5NCrLnk4uLrJYQie6XBc3QkW-Q8FMXvxqX1TBDF29JLuGhU9S1TQD0M8xrRk32U2fNI4xVmB2tkxhrEt7isUB6Q3DLLbVhh_m0ULJddNC35ZaAB9ly6f6UJHFb96V-9cnVBvBEob-vY0f0byUVNuoCU0Uw" + "kid": "https://rosebud.vault.azure.net/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e", + "value": "eS9aprz86UjbB8ytwI_UCNCwVW9OQdrlp4usVAf_3hoMbZPlTpQVt12iU7-V1e1BaFotsKsYp2c7fizK2yZlS_T8Pmv0oyo0hN5AW5_6wmEOX65m5BUNH8N_oVHy_FsHFftoehAOPi9pIg2KxWi9fvrKFATsrDXz96hnY9FpjiycgySZ5Z_9ibyvTyyXcd8iwCJukv40R85Vxal5EDzGHGB9btQIFFX23_moZ3bTeSp0ZsAMfoJoKsv0xfz5M-vIQi1uFjey5XHCKp1wpJSJF4MZpr2pObNWch99eWgBq--Sa8JwA820n6CJtgmKYPVlR64Oo3q_BVzmt7TRS3J_Nw" } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670/verify?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e/verify?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key1932710079/c722bd810dc74c9fad10dafc81a69670/verify?api-version=7.3-preview", + ":path": "/keys/key1932710079/6e646628a3514a2eabae24aa4e09623e/verify?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -194,14 +192,14 @@ "RequestBody": { "alg": "RS256", "digest": "ltYuKr0-Qt5fUDMPuO_ExVmYNSeAd7IemqCzPB3wehw", - "value": "M1guY2j9XHlHpLPYXD79L1CaTcy3B6XnHE3Fq6QvAzxMP8yngdXlMBVZ42iMKJwdivLS4pFUIH8hCV4IKgU9w-rAGhfzgsuIVErWb82aTbUF-I2j2EQha3HCKmhrw1L-s2jJrN1q60J9_tl_Dti6XCT8jRKS4RACUQedsPUTunFIcqTnaVnAn2PyeB_J5NCrLnk4uLrJYQie6XBc3QkW-Q8FMXvxqX1TBDF29JLuGhU9S1TQD0M8xrRk32U2fNI4xVmB2tkxhrEt7isUB6Q3DLLbVhh_m0ULJddNC35ZaAB9ly6f6UJHFb96V-9cnVBvBEob-vY0f0byUVNuoCU0Uw" + "value": "eS9aprz86UjbB8ytwI_UCNCwVW9OQdrlp4usVAf_3hoMbZPlTpQVt12iU7-V1e1BaFotsKsYp2c7fizK2yZlS_T8Pmv0oyo0hN5AW5_6wmEOX65m5BUNH8N_oVHy_FsHFftoehAOPi9pIg2KxWi9fvrKFATsrDXz96hnY9FpjiycgySZ5Z_9ibyvTyyXcd8iwCJukv40R85Vxal5EDzGHGB9btQIFFX23_moZ3bTeSp0ZsAMfoJoKsv0xfz5M-vIQi1uFjey5XHCKp1wpJSJF4MZpr2pObNWch99eWgBq--Sa8JwA820n6CJtgmKYPVlR64Oo3q_BVzmt7TRS3J_Nw" }, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "14", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:30 GMT", + "Date": "Mon, 20 Dec 2021 18:45:46 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -209,7 +207,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0a63261b-aacf-4185-9b67-3b7bdb4fd08b", + "x-ms-request-id": "183480f2-b7da-4cd2-9242-9ec42f8d0a52", "X-Powered-By": "ASP.NET" }, "ResponseBody": { diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestClient_WrapUnwrap.json b/sdk/keyvault/azkeys/testdata/recordings/TestClient_WrapUnwrap.json index eba8e95a484f..ee332a791d14 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestClient_WrapUnwrap.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestClient_WrapUnwrap.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:28 GMT", + "Date": "Mon, 20 Dec 2021 18:45:44 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "11625193-0c3f-4ae0-b08f-87a1f83e34f5", + "x-ms-request-id": "34d401f4-7052-486e-9e11-98e8d719cb71", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:28 GMT", + "Date": "Mon, 20 Dec 2021 18:45:45 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f7923f06-5ad8-40df-a953-64931e07258b", + "x-ms-request-id": "eee575c0-6385-45b2-a86f-26c54694c13a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key2218739472/345a7eff79d74b529975cf289e42dfae", + "kid": "https://fakekvurl.vault.azure.net/keys/key2218739472/3d73553fe7244152bbc5114827430578", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,30 +84,29 @@ "wrapKey", "unwrapKey" ], - "n": "z9mH8tcE5J_6fjoUO_T97BOKHQNme_RwC6u-OizSqPlBdUVutP9DVKR7gXD69zbO_JLoLh47eLbUtI0c8w_T_QrTJoWhYn_uLsFd8BAFoe0B0_cpMee-v1uyjpK7aJOiGmvhMdz3rXrDhr3pwBtkZDzBtxNXfIo4vuIKfM7KCkI5Jn49pyxs_BDPrhgGaVrqFk4tZQLz3CnGGsEV0jT3HTa4_5iBP2vkSzGmkEgcCFkBCpkwuTL2K2TgSZh-gegEqbOLA-cQMMWJndMpuFtk15PiCEIQS_0rJTbz4TF1yAC_2jYOQbj_ATusY2dUVi8bBfgTXLeUaSWokHWYFaBwOQ", + "n": "s-1StJ5tNo7-jZADKQJO9f2qlTCoqMGDdLaTtsC9X1xd8xx1dpg8W6Q3pCVqm6HsOMLq74ANa11UoBTl-MoAINgC1HJwnSrgFGgChcEQSXZZuypKTf28DTe_0kudzcApXXCfwsky-5le1pCkOhRdXr4wDx11S5nKvUU7YJxBFa6SZfqi45Cxkj-WRvdqns-c0WT0Aqnox60ZZTJu8KuMVYjiPWwg0jhvcaUnpfR1qmNo5zrrsLAEBNjV427jRMh8GwpJhPTbYW-Lwzi1m8jVsFPSf67KHsSCeJDAi9JfJRhwfysNZIo1gx5_hCg_S_aoRztF9mD8rhlM5W2Rg_09dQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639001128, - "updated": 1639001128, + "created": 1640025945, + "updated": 1640025945, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key2218739472/345a7eff79d74b529975cf289e42dfae/wrapkey?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key2218739472/3d73553fe7244152bbc5114827430578/wrapkey?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key2218739472/345a7eff79d74b529975cf289e42dfae/wrapkey?api-version=7.3-preview", + ":path": "/keys/key2218739472/3d73553fe7244152bbc5114827430578/wrapkey?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -117,7 +115,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:28 GMT", + "Date": "Mon, 20 Dec 2021 18:45:45 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -126,7 +124,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c7c46d2c-36aa-42e6-8824-ed0d86e8b03e", + "x-ms-request-id": "2812ecb1-4518-403c-91a9-b90039d7d8cc", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -137,12 +135,12 @@ } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key2218739472/345a7eff79d74b529975cf289e42dfae/wrapkey?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key2218739472/3d73553fe7244152bbc5114827430578/wrapkey?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key2218739472/345a7eff79d74b529975cf289e42dfae/wrapkey?api-version=7.3-preview", + ":path": "/keys/key2218739472/3d73553fe7244152bbc5114827430578/wrapkey?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -160,7 +158,7 @@ "Cache-Control": "no-cache", "Content-Length": "446", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:29 GMT", + "Date": "Mon, 20 Dec 2021 18:45:45 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -168,21 +166,21 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f92a6978-d6eb-4a90-a97a-47129aa5ed19", + "x-ms-request-id": "27e953f2-8d2b-4dce-b4b2-623fbf9db176", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "kid": "https://rosebud.vault.azure.net/keys/key2218739472/345a7eff79d74b529975cf289e42dfae", - "value": "iV4NgVBRB3NdvkoKW6LUPqZaB2UiS1tKoIELX3_BCgGDJ4XQWa7xVlN16EyUE3cr6CxWp5gFYTgnW_TcpnM_pUxay1MOsn0lQMyJ4mtIhbVdOmKXi9OdRoyvwm677QId51HE43C8iMc99a9Z8AxP1JmT8HOxqoyaTltLOrMMnDzQ9o-t2EiZ3y8f3vu31t4Mn0_SrwQGMFCw7y-Cm1jHzZepbD9yZ4O2k2zdaRlvhZ3A1odWSwJGL3kNNj4ejfgc8X25bCVRvmBXqNRaaDpR4yIUUSdxorWS3txq_yqKAaqws-uaQcGaGXlhwACn9u_MJ60OKv_Zp-UPuzNgAxOhGA" + "kid": "https://rosebud.vault.azure.net/keys/key2218739472/3d73553fe7244152bbc5114827430578", + "value": "AjxLLyEdWpA9YV5drOGKBl6sB3yTuYw6iuu7rR3-dIsTlne9bL3spiQ9n_2t_YqFOtyuxt1fiYOebMRnI-K4s91IUkTwX4kWw8bW05rhcwu4s5otoLWo8O0LYsiaYZKPtYWWAwM0K-61HYwEHryaYorwsMk6Sqk35Rex1cZM8cHMHCoNy4KED7yAvamos6cf0hitViF6kzWIzViPV1YnBtJcJkgy9BAh5CpGEF_YWCX63AkrQQWYzigLPtqisGB9hzX04ouPqulSwPJ_lQ7IXFwT0RItoAI7BX2ruMLIg6WM0qCa6DBqFterDn7s5OhujuR9t6DhjM7S6upTkhdO8A" } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key2218739472/345a7eff79d74b529975cf289e42dfae/unwrapkey?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key2218739472/3d73553fe7244152bbc5114827430578/unwrapkey?api-version=7.3-preview", "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", ":method": "POST", - ":path": "/keys/key2218739472/345a7eff79d74b529975cf289e42dfae/unwrapkey?api-version=7.3-preview", + ":path": "/keys/key2218739472/3d73553fe7244152bbc5114827430578/unwrapkey?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -193,14 +191,14 @@ }, "RequestBody": { "alg": "RSA-OAEP", - "value": "iV4NgVBRB3NdvkoKW6LUPqZaB2UiS1tKoIELX3_BCgGDJ4XQWa7xVlN16EyUE3cr6CxWp5gFYTgnW_TcpnM_pUxay1MOsn0lQMyJ4mtIhbVdOmKXi9OdRoyvwm677QId51HE43C8iMc99a9Z8AxP1JmT8HOxqoyaTltLOrMMnDzQ9o-t2EiZ3y8f3vu31t4Mn0_SrwQGMFCw7y-Cm1jHzZepbD9yZ4O2k2zdaRlvhZ3A1odWSwJGL3kNNj4ejfgc8X25bCVRvmBXqNRaaDpR4yIUUSdxorWS3txq_yqKAaqws-uaQcGaGXlhwACn9u_MJ60OKv_Zp-UPuzNgAxOhGA" + "value": "AjxLLyEdWpA9YV5drOGKBl6sB3yTuYw6iuu7rR3-dIsTlne9bL3spiQ9n_2t_YqFOtyuxt1fiYOebMRnI-K4s91IUkTwX4kWw8bW05rhcwu4s5otoLWo8O0LYsiaYZKPtYWWAwM0K-61HYwEHryaYorwsMk6Sqk35Rex1cZM8cHMHCoNy4KED7yAvamos6cf0hitViF6kzWIzViPV1YnBtJcJkgy9BAh5CpGEF_YWCX63AkrQQWYzigLPtqisGB9hzX04ouPqulSwPJ_lQ7IXFwT0RItoAI7BX2ruMLIg6WM0qCa6DBqFterDn7s5OhujuR9t6DhjM7S6upTkhdO8A" }, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "371", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 08 Dec 2021 22:05:29 GMT", + "Date": "Mon, 20 Dec 2021 18:45:45 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -208,11 +206,11 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c1f00930-9602-44a2-8a89-14c225f962ba", + "x-ms-request-id": "2a176ec1-9669-4fc4-8fa6-2ddc14772b40", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "kid": "https://rosebud.vault.azure.net/keys/key2218739472/345a7eff79d74b529975cf289e42dfae", + "kid": "https://rosebud.vault.azure.net/keys/key2218739472/3d73553fe7244152bbc5114827430578", "value": "NTA2M2U2YWFhODQ1ZjE1MDIwMDU0Nzk0NGZkMTk5Njc5Yzk4ZWQ2Zjk5ZGEwYTBiMmRhZmVhZjFmNDY4NDQ5NmZkNTMyYzFjMjI5OTY4Y2I5ZGVlNDQ5NTdmY2VmN2NjZWY1OWNlZGEwYjM2MmU1NmJjZDc4ZmQzZmFlZTU3ODFjNjIzYzBiYjIyYjM1YmVhYmRlMDY2NGZkMzBlMGU4MjRhYmEzZGQxYjBhZmZmYzRhM2Q5NTVlZGUyMGNmNmE4NTRkNTJjZmQ" } } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_HSM.json index 7473236c2e2d..a732ef8ca2a5 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "1bba253a-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "87353fc4-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "1" }, "ResponseBody": null @@ -59,17 +58,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1bdf224a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "304" + "x-ms-request-id": "874cdb66-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "257" }, "ResponseBody": { "attributes": { - "created": 1637185283, + "created": 1640018423, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185283 + "updated": 1640018423 }, "key": { "crv": "P-256", @@ -77,10 +76,47 @@ "verify", "sign" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/06c580a6d4014e723712a1ff1eb05d2f", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/31cb9e8542970f92284df39a82a8f08e", "kty": "EC-HSM", - "x": "-MG6Rxsfb7F8ZjDlpQc3FPIKWpiSIOMNBStJK7W7yFs", - "y": "ECRycsr4sexMflwUOcv6hD1Za-WCtMd6FsWNXdYyZt4" + "x": "2DjfSaEMa0Rnv8c9dQ8MIps_gk2AvzWcCYTMpY_AOts", + "y": "wbdINEtdWqaHfQiVQFwcpvaQIVchg-fQN8z-UE8GP5A" + } + } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/key%21@%23$/create?api-version=7.3-preview", + "RequestMethod": "POST", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "POST", + ":path": "/keys/key%21@%23$/create?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "12", + "Content-Type": "application/json", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": { + "kty": "EC" + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "128", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "877eca04-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Invalid key identifier or name (Activity ID: 877eca04-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -109,32 +145,32 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1c1792c4-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "141" + "x-ms-request-id": "878924f4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "153" }, "ResponseBody": { "attributes": { - "created": 1637185283, + "created": 1640018423, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185283 + "updated": 1640018423 }, - "deletedDate": 1637185283, + "deletedDate": 1640018424, "key": { "crv": "P-256", "key_ops": [ "verify", "sign" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/06c580a6d4014e723712a1ff1eb05d2f", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/31cb9e8542970f92284df39a82a8f08e", "kty": "EC-HSM", - "x": "-MG6Rxsfb7F8ZjDlpQc3FPIKWpiSIOMNBStJK7W7yFs", - "y": "ECRycsr4sexMflwUOcv6hD1Za-WCtMd6FsWNXdYyZt4" + "x": "2DjfSaEMa0Rnv8c9dQ8MIps_gk2AvzWcCYTMpY_AOts", + "y": "wbdINEtdWqaHfQiVQFwcpvaQIVchg-fQN8z-UE8GP5A" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1053998307", - "scheduledPurgeDate": 1637790083 + "scheduledPurgeDate": 1640623224 } }, { @@ -160,35 +196,35 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1c373c46-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "39" + "x-ms-request-id": "87aafd18-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "35" }, "ResponseBody": { "attributes": { - "created": 1637185283, + "created": 1640018423, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185283 + "updated": 1640018423 }, - "deletedDate": 1637185283, + "deletedDate": 1640018424, "key": { "crv": "P-256", "key_ops": [ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/06c580a6d4014e723712a1ff1eb05d2f", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/31cb9e8542970f92284df39a82a8f08e", "kty": "EC-HSM", - "x": "-MG6Rxsfb7F8ZjDlpQc3FPIKWpiSIOMNBStJK7W7yFs", - "y": "ECRycsr4sexMflwUOcv6hD1Za-WCtMd6FsWNXdYyZt4" + "x": "2DjfSaEMa0Rnv8c9dQ8MIps_gk2AvzWcCYTMpY_AOts", + "y": "wbdINEtdWqaHfQiVQFwcpvaQIVchg-fQN8z-UE8GP5A" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1053998307", - "scheduledPurgeDate": 1637790083 + "scheduledPurgeDate": 1640623224 } }, { @@ -214,35 +250,35 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1c47a270-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "37" + "x-ms-request-id": "87baa024-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "33" }, "ResponseBody": { "attributes": { - "created": 1637185283, + "created": 1640018423, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185283 + "updated": 1640018423 }, - "deletedDate": 1637185283, + "deletedDate": 1640018424, "key": { "crv": "P-256", "key_ops": [ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/06c580a6d4014e723712a1ff1eb05d2f", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1053998307/31cb9e8542970f92284df39a82a8f08e", "kty": "EC-HSM", - "x": "-MG6Rxsfb7F8ZjDlpQc3FPIKWpiSIOMNBStJK7W7yFs", - "y": "ECRycsr4sexMflwUOcv6hD1Za-WCtMd6FsWNXdYyZt4" + "x": "2DjfSaEMa0Rnv8c9dQ8MIps_gk2AvzWcCYTMpY_AOts", + "y": "wbdINEtdWqaHfQiVQFwcpvaQIVchg-fQN8z-UE8GP5A" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1053998307", - "scheduledPurgeDate": 1637790083 + "scheduledPurgeDate": 1640623224 } }, { @@ -270,8 +306,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1c576f52-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "102" + "x-ms-request-id": "87c9df30-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "109" }, "ResponseBody": null } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_NON-HSM.json index 6283b3bc2675..f9990f25eb17 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestCreateECKey/TestCreateECKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:15:46 GMT", + "Date": "Mon, 20 Dec 2021 16:40:20 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "01f4791b-1350-476e-9cd4-043d1a71c491", + "x-ms-request-id": "3e78a0cc-b5b4-41b3-af64-e0ccdba0f45d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "398", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:15:47 GMT", + "Date": "Mon, 20 Dec 2021 16:40:21 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,25 +69,25 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2474e827-f98f-4d60-ab4f-dd5289f1ca48", + "x-ms-request-id": "152267ae-6e74-4407-8ea0-7aff74e5836f", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3984012801/4a19151c6c7a4473b2a5b0aecd5f83b9", + "kid": "https://fakekvurl.vault.azure.net/keys/key3984012801/8a029726110c4e549ad3175b20fba3f9", "kty": "EC", "key_ops": [ "sign", "verify" ], "crv": "P-256", - "x": "hxSWDNRcNjqg1LsYtz1CPM91lRR0kclcK-O5R141sIw", - "y": "IqMv53QyW8Ko_OK5ZPGP8mTeVJUGPaULVsh-VdpR0U4" + "x": "V0dlK-s9ao_VJWzB0tbaQJvyBkz8ItVK8OUmOoK7PtI", + "y": "fjs4jdLq-hdxy3Bw9iYPG8YjRcpOAy8A9P97kXtEMgQ" }, "attributes": { "enabled": true, - "created": 1639070148, - "updated": 1639070148, + "created": 1640018421, + "updated": 1640018421, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -117,7 +116,7 @@ "Cache-Control": "no-cache", "Content-Length": "95", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:15:47 GMT", + "Date": "Mon, 20 Dec 2021 16:40:21 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -125,7 +124,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4af70e02-173d-4191-840f-1eac63756b51", + "x-ms-request-id": "b8f21b6b-4845-47b4-ae0a-055a81321ba3", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -134,6 +133,329 @@ "message": "The request URI contains an invalid name: key!@#$" } } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key3984012801?api-version=7.3-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "DELETE", + ":path": "/keys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "530", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:40:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "28fe5328-a95d-4cb9-a74b-2342cefe1941", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801", + "deletedDate": 1640018421, + "scheduledPurgeDate": 1640623221, + "key": { + "kid": "https://fakekvurl.vault.azure.net/keys/key3984012801/8a029726110c4e549ad3175b20fba3f9", + "kty": "EC", + "key_ops": [ + "sign", + "verify" + ], + "crv": "P-256", + "x": "V0dlK-s9ao_VJWzB0tbaQJvyBkz8ItVK8OUmOoK7PtI", + "y": "fjs4jdLq-hdxy3Bw9iYPG8YjRcpOAy8A9P97kXtEMgQ" + }, + "attributes": { + "enabled": true, + "created": 1640018421, + "updated": 1640018421, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801?api-version=7.3-preview", + "RequestMethod": "GET", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "GET", + ":path": "/deletedkeys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "81", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:40:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "1f890a16-6d7c-4101-b427-5300f0c483ab", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: key3984012801" + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801?api-version=7.3-preview", + "RequestMethod": "GET", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "GET", + ":path": "/deletedkeys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "81", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:40:21 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "888f5e9b-2dd5-4509-9a6b-16539dd7b8f9", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: key3984012801" + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801?api-version=7.3-preview", + "RequestMethod": "GET", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "GET", + ":path": "/deletedkeys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "81", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:40:22 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "afa560da-a9ae-416f-bcff-436d228ed1c0", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: key3984012801" + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801?api-version=7.3-preview", + "RequestMethod": "GET", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "GET", + ":path": "/deletedkeys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "81", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:40:22 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "17158af3-2668-40cc-9d7b-94dfd6def810", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: key3984012801" + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801?api-version=7.3-preview", + "RequestMethod": "GET", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "GET", + ":path": "/deletedkeys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "81", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:40:22 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "addc84e4-5b46-4556-adf9-26579c432656", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: key3984012801" + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801?api-version=7.3-preview", + "RequestMethod": "GET", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "GET", + ":path": "/deletedkeys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "530", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:40:23 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "72234e54-d25c-41fa-bcff-30ea82b45f53", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801", + "deletedDate": 1640018421, + "scheduledPurgeDate": 1640623221, + "key": { + "kid": "https://fakekvurl.vault.azure.net/keys/key3984012801/8a029726110c4e549ad3175b20fba3f9", + "kty": "EC", + "key_ops": [ + "sign", + "verify" + ], + "crv": "P-256", + "x": "V0dlK-s9ao_VJWzB0tbaQJvyBkz8ItVK8OUmOoK7PtI", + "y": "fjs4jdLq-hdxy3Bw9iYPG8YjRcpOAy8A9P97kXtEMgQ" + }, + "attributes": { + "enabled": true, + "created": 1640018421, + "updated": 1640018421, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3984012801?api-version=7.3-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "DELETE", + ":path": "/deletedkeys/key3984012801?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 204, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Date": "Mon, 20 Dec 2021 16:40:23 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "74abba59-6e5f-42ae-a4e4-7c9962fcb33c", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": null } ], "Variables": {} diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_HSM.json index e755ea088a4a..4448ee21f69b 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,8 +24,8 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "0d33fea0-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "0" + "x-ms-request-id": "846215b0-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "1" }, "ResponseBody": null }, @@ -59,17 +58,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0d5cd06e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "831" + "x-ms-request-id": "848033c4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "218" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, "key": { "e": "AQAB", @@ -81,9 +80,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/266d7a50d6704e312c334340c17d83ea", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/1045fb186d2f421985a788315ddd3bbc", "kty": "RSA-HSM", - "n": "xjL7bDEiONOnKL5q9276KMnMthc_jE3KWVrLsTIPL3CkIPbJWoN-8MO0tsWAGa2M_4gGGuigNDIxx1d2oW27TXZdc3kKm04zbKxtNCSd2F1VUoh-aaX47kp94mtG707Q7fvakNr8EUlwa7TwsjvGGO0QJ5EPWmYMKPGno0ay-QIlAR8up8hVM9ygQOPa58-go1AK0NRndEZ5LPCQCZdxZZJ3jzMg342j8xPTQDGs-R3bzENB04yaGoBoWOsxvFZtQCcKUvACnx1rgIKUME5AGxyrzriGbtzKINpdU7X2s_UfIN2YEizRinTFDk1mTgAfW_dC9D3EeCo1Gy_CdvBZSQ" + "n": "5OW7wE5qkSpGg4FSW9TAipvBNavR--DH7B-6dl1C-AC7jb4SPxChWlQ53qnBXsniwCGeERgqs3ZZwque0cloWnjEBFLnt6_RuHW_DtduRfmMyFxAbEHyCeuGo83wGbQ-Bgs4nUBxZKOAJJg_kY4SHQCR5HbxaePNjc9kXk9w5BkOxwsoWXDzEdNDYeLN8n2Kb8WPeGO3zAgwj6LT3olvBie6abbSTSRrI-Fw0qj6uEBkoXB2EU0aCKVWjYBzkbpr0CQcDDMEnqDYdoT1gH_hkcoBJ5wHPNVsbe0bESqD5oTM49gBnlW13u9fxdr9Yxj7_CxoY6jl0ujJVTwyQiVspw" } } }, @@ -116,17 +115,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0de64b6e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "210" + "x-ms-request-id": "84ac1638-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "219" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, "key": { "e": "AQAB", @@ -138,9 +137,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/76db08d9f27c076d1b50fbb39d386f56", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/72597b604d560ce014b491bbdc926dd9", "kty": "RSA-HSM", - "n": "tAfOCO8EOLhyzcSC_tczfi6qE-7Bsk1ePglV_6ATFNX1IWkoDP_1-n7NL9opaZE-ec-SbrjOkzDxaDOphvL-fFTHrF27ekK0FIVws96CJhg8496pAu6QcW4mqAQhzdFTbm0V6Y53lPaIkH3V8wfXd6ZWlXNle6KGtBObTYKf6aqklcYD055B8epBnlG2Xzedv-fyyehv3u69BXKda4dmndwRAHfNUa8Xpsocc98ogF_fM5R1-19ux5fk83KiUIhYjj2rd8QmkeZ1mZ-A_udCEThFhzCznNqg77lGQzNsUFkmnob3lMpcU6We47_W28dziUm6TRRWa80uWEi0O5YJvQ" + "n": "l1w0y62nES272IxoyyroQtP53e2UXZS1kbusG96COtxjX2MFBSf4-9Fmd8IoButRybrpCvEhIspueyaNelZ-YIMgW5ub2moIBfNgdPPsaAqSZjZoibYxSYO5BSdMc28cpBMnLrINsncj0NG1FU_bF6JLnnrINkhuN-oJEOZQ9E5v1iwR3wLd7EZK_PUAzVj_e1SPhD8TUza_P7_if8H9MPoZ8XRAWXtmp-UgWJUxmwQXuqTBbIrqSVchK1j4zZhuF3a28FDwSz_sLqgAUazfkjCQkJSlYw_eGPTWEy2-pMwb30FrUCJrBRCvwfHiT3f4uq0W3i_k56bV56mzk_ysDw" } } }, @@ -169,19 +168,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0e1075ce-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "150" + "x-ms-request-id": "84d7c706-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "143" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, - "deletedDate": 1637185260, + "deletedDate": 1640018419, "key": { "e": "AQAB", "key_ops": [ @@ -192,12 +191,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/266d7a50d6704e312c334340c17d83ea", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/1045fb186d2f421985a788315ddd3bbc", "kty": "RSA-HSM", - "n": "xjL7bDEiONOnKL5q9276KMnMthc_jE3KWVrLsTIPL3CkIPbJWoN-8MO0tsWAGa2M_4gGGuigNDIxx1d2oW27TXZdc3kKm04zbKxtNCSd2F1VUoh-aaX47kp94mtG707Q7fvakNr8EUlwa7TwsjvGGO0QJ5EPWmYMKPGno0ay-QIlAR8up8hVM9ygQOPa58-go1AK0NRndEZ5LPCQCZdxZZJ3jzMg342j8xPTQDGs-R3bzENB04yaGoBoWOsxvFZtQCcKUvACnx1rgIKUME5AGxyrzriGbtzKINpdU7X2s_UfIN2YEizRinTFDk1mTgAfW_dC9D3EeCo1Gy_CdvBZSQ" + "n": "5OW7wE5qkSpGg4FSW9TAipvBNavR--DH7B-6dl1C-AC7jb4SPxChWlQ53qnBXsniwCGeERgqs3ZZwque0cloWnjEBFLnt6_RuHW_DtduRfmMyFxAbEHyCeuGo83wGbQ-Bgs4nUBxZKOAJJg_kY4SHQCR5HbxaePNjc9kXk9w5BkOxwsoWXDzEdNDYeLN8n2Kb8WPeGO3zAgwj6LT3olvBie6abbSTSRrI-Fw0qj6uEBkoXB2EU0aCKVWjYBzkbpr0CQcDDMEnqDYdoT1gH_hkcoBJ5wHPNVsbe0bESqD5oTM49gBnlW13u9fxdr9Yxj7_CxoY6jl0ujJVTwyQiVspw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2103710935", - "scheduledPurgeDate": 1637790060 + "scheduledPurgeDate": 1640623219 } }, { @@ -223,22 +222,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0e319bfa-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "33" + "x-ms-request-id": "84f7fc06-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "35" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, - "deletedDate": 1637185260, + "deletedDate": 1640018419, "key": { "e": "AQAB", "key_ops": [ @@ -249,12 +248,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/266d7a50d6704e312c334340c17d83ea", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/1045fb186d2f421985a788315ddd3bbc", "kty": "RSA-HSM", - "n": "xjL7bDEiONOnKL5q9276KMnMthc_jE3KWVrLsTIPL3CkIPbJWoN-8MO0tsWAGa2M_4gGGuigNDIxx1d2oW27TXZdc3kKm04zbKxtNCSd2F1VUoh-aaX47kp94mtG707Q7fvakNr8EUlwa7TwsjvGGO0QJ5EPWmYMKPGno0ay-QIlAR8up8hVM9ygQOPa58-go1AK0NRndEZ5LPCQCZdxZZJ3jzMg342j8xPTQDGs-R3bzENB04yaGoBoWOsxvFZtQCcKUvACnx1rgIKUME5AGxyrzriGbtzKINpdU7X2s_UfIN2YEizRinTFDk1mTgAfW_dC9D3EeCo1Gy_CdvBZSQ" + "n": "5OW7wE5qkSpGg4FSW9TAipvBNavR--DH7B-6dl1C-AC7jb4SPxChWlQ53qnBXsniwCGeERgqs3ZZwque0cloWnjEBFLnt6_RuHW_DtduRfmMyFxAbEHyCeuGo83wGbQ-Bgs4nUBxZKOAJJg_kY4SHQCR5HbxaePNjc9kXk9w5BkOxwsoWXDzEdNDYeLN8n2Kb8WPeGO3zAgwj6LT3olvBie6abbSTSRrI-Fw0qj6uEBkoXB2EU0aCKVWjYBzkbpr0CQcDDMEnqDYdoT1gH_hkcoBJ5wHPNVsbe0bESqD5oTM49gBnlW13u9fxdr9Yxj7_CxoY6jl0ujJVTwyQiVspw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2103710935", - "scheduledPurgeDate": 1637790060 + "scheduledPurgeDate": 1640623219 } }, { @@ -280,22 +279,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0e415040-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "31" + "x-ms-request-id": "85079f8a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "33" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, - "deletedDate": 1637185260, + "deletedDate": 1640018419, "key": { "e": "AQAB", "key_ops": [ @@ -306,12 +305,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/266d7a50d6704e312c334340c17d83ea", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935/1045fb186d2f421985a788315ddd3bbc", "kty": "RSA-HSM", - "n": "xjL7bDEiONOnKL5q9276KMnMthc_jE3KWVrLsTIPL3CkIPbJWoN-8MO0tsWAGa2M_4gGGuigNDIxx1d2oW27TXZdc3kKm04zbKxtNCSd2F1VUoh-aaX47kp94mtG707Q7fvakNr8EUlwa7TwsjvGGO0QJ5EPWmYMKPGno0ay-QIlAR8up8hVM9ygQOPa58-go1AK0NRndEZ5LPCQCZdxZZJ3jzMg342j8xPTQDGs-R3bzENB04yaGoBoWOsxvFZtQCcKUvACnx1rgIKUME5AGxyrzriGbtzKINpdU7X2s_UfIN2YEizRinTFDk1mTgAfW_dC9D3EeCo1Gy_CdvBZSQ" + "n": "5OW7wE5qkSpGg4FSW9TAipvBNavR--DH7B-6dl1C-AC7jb4SPxChWlQ53qnBXsniwCGeERgqs3ZZwque0cloWnjEBFLnt6_RuHW_DtduRfmMyFxAbEHyCeuGo83wGbQ-Bgs4nUBxZKOAJJg_kY4SHQCR5HbxaePNjc9kXk9w5BkOxwsoWXDzEdNDYeLN8n2Kb8WPeGO3zAgwj6LT3olvBie6abbSTSRrI-Fw0qj6uEBkoXB2EU0aCKVWjYBzkbpr0CQcDDMEnqDYdoT1gH_hkcoBJ5wHPNVsbe0bESqD5oTM49gBnlW13u9fxdr9Yxj7_CxoY6jl0ujJVTwyQiVspw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2103710935", - "scheduledPurgeDate": 1637790060 + "scheduledPurgeDate": 1640623219 } }, { @@ -339,8 +338,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0e503786-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "110" + "x-ms-request-id": "851709ca-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "114" }, "ResponseBody": null }, @@ -369,19 +368,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0e6afbac-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "147" + "x-ms-request-id": "8532f676-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "143" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, - "deletedDate": 1637185260, + "deletedDate": 1640018420, "key": { "e": "AQAB", "key_ops": [ @@ -392,12 +391,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/76db08d9f27c076d1b50fbb39d386f56", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/72597b604d560ce014b491bbdc926dd9", "kty": "RSA-HSM", - "n": "tAfOCO8EOLhyzcSC_tczfi6qE-7Bsk1ePglV_6ATFNX1IWkoDP_1-n7NL9opaZE-ec-SbrjOkzDxaDOphvL-fFTHrF27ekK0FIVws96CJhg8496pAu6QcW4mqAQhzdFTbm0V6Y53lPaIkH3V8wfXd6ZWlXNle6KGtBObTYKf6aqklcYD055B8epBnlG2Xzedv-fyyehv3u69BXKda4dmndwRAHfNUa8Xpsocc98ogF_fM5R1-19ux5fk83KiUIhYjj2rd8QmkeZ1mZ-A_udCEThFhzCznNqg77lGQzNsUFkmnob3lMpcU6We47_W28dziUm6TRRWa80uWEi0O5YJvQ" + "n": "l1w0y62nES272IxoyyroQtP53e2UXZS1kbusG96COtxjX2MFBSf4-9Fmd8IoButRybrpCvEhIspueyaNelZ-YIMgW5ub2moIBfNgdPPsaAqSZjZoibYxSYO5BSdMc28cpBMnLrINsncj0NG1FU_bF6JLnnrINkhuN-oJEOZQ9E5v1iwR3wLd7EZK_PUAzVj_e1SPhD8TUza_P7_if8H9MPoZ8XRAWXtmp-UgWJUxmwQXuqTBbIrqSVchK1j4zZhuF3a28FDwSz_sLqgAUazfkjCQkJSlYw_eGPTWEy2-pMwb30FrUCJrBRCvwfHiT3f4uq0W3i_k56bV56mzk_ysDw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2103710935hsm", - "scheduledPurgeDate": 1637790060 + "scheduledPurgeDate": 1640623220 } }, { @@ -423,22 +422,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0e8b8d40-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "33" + "x-ms-request-id": "8553236a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "37" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, - "deletedDate": 1637185260, + "deletedDate": 1640018420, "key": { "e": "AQAB", "key_ops": [ @@ -449,12 +448,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/76db08d9f27c076d1b50fbb39d386f56", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/72597b604d560ce014b491bbdc926dd9", "kty": "RSA-HSM", - "n": "tAfOCO8EOLhyzcSC_tczfi6qE-7Bsk1ePglV_6ATFNX1IWkoDP_1-n7NL9opaZE-ec-SbrjOkzDxaDOphvL-fFTHrF27ekK0FIVws96CJhg8496pAu6QcW4mqAQhzdFTbm0V6Y53lPaIkH3V8wfXd6ZWlXNle6KGtBObTYKf6aqklcYD055B8epBnlG2Xzedv-fyyehv3u69BXKda4dmndwRAHfNUa8Xpsocc98ogF_fM5R1-19ux5fk83KiUIhYjj2rd8QmkeZ1mZ-A_udCEThFhzCznNqg77lGQzNsUFkmnob3lMpcU6We47_W28dziUm6TRRWa80uWEi0O5YJvQ" + "n": "l1w0y62nES272IxoyyroQtP53e2UXZS1kbusG96COtxjX2MFBSf4-9Fmd8IoButRybrpCvEhIspueyaNelZ-YIMgW5ub2moIBfNgdPPsaAqSZjZoibYxSYO5BSdMc28cpBMnLrINsncj0NG1FU_bF6JLnnrINkhuN-oJEOZQ9E5v1iwR3wLd7EZK_PUAzVj_e1SPhD8TUza_P7_if8H9MPoZ8XRAWXtmp-UgWJUxmwQXuqTBbIrqSVchK1j4zZhuF3a28FDwSz_sLqgAUazfkjCQkJSlYw_eGPTWEy2-pMwb30FrUCJrBRCvwfHiT3f4uq0W3i_k56bV56mzk_ysDw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2103710935hsm", - "scheduledPurgeDate": 1637790060 + "scheduledPurgeDate": 1640623220 } }, { @@ -480,22 +479,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0e9b325e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "39" + "x-ms-request-id": "856340c4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "42" }, "ResponseBody": { "attributes": { - "created": 1637185259, + "created": 1640018419, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185259 + "updated": 1640018419 }, - "deletedDate": 1637185260, + "deletedDate": 1640018420, "key": { "e": "AQAB", "key_ops": [ @@ -506,12 +505,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/76db08d9f27c076d1b50fbb39d386f56", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2103710935hsm/72597b604d560ce014b491bbdc926dd9", "kty": "RSA-HSM", - "n": "tAfOCO8EOLhyzcSC_tczfi6qE-7Bsk1ePglV_6ATFNX1IWkoDP_1-n7NL9opaZE-ec-SbrjOkzDxaDOphvL-fFTHrF27ekK0FIVws96CJhg8496pAu6QcW4mqAQhzdFTbm0V6Y53lPaIkH3V8wfXd6ZWlXNle6KGtBObTYKf6aqklcYD055B8epBnlG2Xzedv-fyyehv3u69BXKda4dmndwRAHfNUa8Xpsocc98ogF_fM5R1-19ux5fk83KiUIhYjj2rd8QmkeZ1mZ-A_udCEThFhzCznNqg77lGQzNsUFkmnob3lMpcU6We47_W28dziUm6TRRWa80uWEi0O5YJvQ" + "n": "l1w0y62nES272IxoyyroQtP53e2UXZS1kbusG96COtxjX2MFBSf4-9Fmd8IoButRybrpCvEhIspueyaNelZ-YIMgW5ub2moIBfNgdPPsaAqSZjZoibYxSYO5BSdMc28cpBMnLrINsncj0NG1FU_bF6JLnnrINkhuN-oJEOZQ9E5v1iwR3wLd7EZK_PUAzVj_e1SPhD8TUza_P7_if8H9MPoZ8XRAWXtmp-UgWJUxmwQXuqTBbIrqSVchK1j4zZhuF3a28FDwSz_sLqgAUazfkjCQkJSlYw_eGPTWEy2-pMwb30FrUCJrBRCvwfHiT3f4uq0W3i_k56bV56mzk_ysDw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2103710935hsm", - "scheduledPurgeDate": 1637790060 + "scheduledPurgeDate": 1640623220 } }, { @@ -539,10 +538,47 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "0eab5db4-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "110" + "x-ms-request-id": "85744d10-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "115" }, "ResponseBody": null + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/invalidName%21@%23$/create?api-version=7.3-preview", + "RequestMethod": "POST", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "POST", + ":path": "/keys/invalidName%21@%23$/create?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "13", + "Content-Type": "application/json", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": { + "kty": "RSA" + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "128", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "859073c8-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "1" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Invalid key identifier or name (Activity ID: 859073c8-61b3-11ec-985f-000d3aec06d7)" + } + } } ], "Variables": {} diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_NON-HSM.json index a82c89a30662..b6de6e4af096 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestCreateKeyRSA/TestCreateKeyRSA_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:22 GMT", + "Date": "Mon, 20 Dec 2021 16:40:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ba06dcff-b2e4-455e-a505-bbcdb88f1e75", + "x-ms-request-id": "76b3f178-8efb-4e30-a7cf-faebad726e52", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:22 GMT", + "Date": "Mon, 20 Dec 2021 16:40:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0ad41c7a-1d52-4e66-9d6f-84dd055a7d98", + "x-ms-request-id": "56d590c6-c200-4ce1-976c-18a7ef94b8a2", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573/0261e4ab1bcd42a582e934d32ac49f35", + "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573/dc98f8b074d146338700f3c4eff46882", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "x1_rRC4ZYqlkl_Cbu8D1rUgnDx_zpmPgSqW-XDiHzrXaEQHoL91eMqO29-scSvFJOjBo_5KfC1Pe6Zc7LE7m4v7jq7b28MP5HBtojWS_gUg0PjqvV4EWTBMEjwONk8nhMdA-VbEzw-FvGgl4S-Lv55JbbVUWFFYSosp7XbGZJgPZrQaRapR2tACUgsrgT9YF8DGpTvcstkbKBUiQDrHQwUmUpkh54KDsCFu0XDMlWXbXMfFHVsrkHij4-7MJ08MqsH43TxihyAIJK_u0-0qh2eLrcMVdWYL4RNUmTq7_egL05YPEg0l88x1eerUUZGBlANo2qJChs2y2SpBdLyRSLQ", + "n": "rUoIghOelh092hicNLeWagAwNqNOfuvCI3VSwk4m6oOW2g4qk58_vF_5Q5T47r_wXMt2dx3rBwPoUVU44qXuuGbU4Qrx1MN3dgb8nr-RjyeqiSpXZxhi8myMllUmTYsvfHaOs8LUMPnaIoJxaI1jXcZaWKzhlPW_z8NTgxn4f6UXaWjEgMN3-M8oDQNM8pVdBYVU6Fsx2j9rgjIomfNTZK6FRBdvBzJXb6KV5eEhMcs3imGI7EB3TsKneHwf-npAiCW8BK46m8r411kYKbjOVUYrELsNAcEfNcEbaH9xj6oaYLbcpGA_LA1iF8UQ7hkBWlj_BsHk7ngNzNIN9RXE3Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639066223, - "updated": 1639066223, + "created": 1640018415, + "updated": 1640018415, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -120,7 +119,7 @@ "Cache-Control": "no-cache", "Content-Length": "696", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:23 GMT", + "Date": "Mon, 20 Dec 2021 16:40:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -128,12 +127,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "5eb33442-d88f-4230-b230-585ab541725d", + "x-ms-request-id": "5d2aeeff-009c-4c6a-996e-63c1edae90a5", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573hsm/4bdd2368fbbf4e0595a25d0d0402e77b", + "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573hsm/fe6a007f75d24c51872aab1c136fce37", "kty": "RSA-HSM", "key_ops": [ "encrypt", @@ -143,13 +142,13 @@ "wrapKey", "unwrapKey" ], - "n": "vD0usovYQmKw8QrS1YkJ6xPt8vaHoe3H-fFbkeynKk_2gtzZe9JiS4mioETKW75WcRJYVuwMgq9crSTzzvPBU0OvjoAAxk_8tdDkbasNZdJs-yq-EZG4jM1aVg5fS_x-y-ey6VL8uHCUf6xC3uclyCntaKlXRJjCk55fWoUNEiyBSKCAZ16pH58OMLdyi8lrBWWgsBd-Z7CxVKDHHIghdzsMtO6H2tv_NHTnuCo64iWn3FuFpHy7qbew3DOmz29UmwPR7UYYZKBNSK5FfGdEfXUZ941shb6RWDoX6pj40EKEq2xs53xLZb6YRjKz11-tJl1tnCgfegzMSGjpx2YSdw", + "n": "lmRpmJLTe3VWZ4xwRNWauo-KwBMnPfwtHwEEEwpIbDzOGHMdzQdmgCGOkzcgdQsOzDdk6zn7bg6-B-QIaLsTcSSkx1FgdvymP_IAHNjc9mcPMNziA-rEc8TTRP-W-tNqpNayoXd8DEYLFmb7mtyV7XgGLWT1X33wtVbdJINa-sofzLzi6sNTUvelXHhovRSm_BlC6ZAD21583v1rzUwcRQTm0FVHlQvlVDmim5Ni8CoLXD6Yha1Km8g85yWKnvN1IJ-7u2Lovv7fLLy1a3fnAwjhGye2OC7kMjG_6BzQCnpQwN2wzgbKgV74CoOVqQQbnanPkjov4BGmZbWiXZ9Dkw", "e": "AAEAAQ" }, "attributes": { "enabled": true, - "created": 1639066223, - "updated": 1639066223, + "created": 1640018415, + "updated": 1640018415, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -174,7 +173,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:23 GMT", + "Date": "Mon, 20 Dec 2021 16:40:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -182,15 +181,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4b22c5e2-f68f-40b7-ae73-9b62694fcf5f", + "x-ms-request-id": "beb2f29c-aaa8-4267-8585-7644c32038d8", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3359961573", - "deletedDate": 1639066224, - "scheduledPurgeDate": 1639671024, + "deletedDate": 1640018416, + "scheduledPurgeDate": 1640623216, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573/0261e4ab1bcd42a582e934d32ac49f35", + "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573/dc98f8b074d146338700f3c4eff46882", "kty": "RSA", "key_ops": [ "encrypt", @@ -200,13 +199,13 @@ "wrapKey", "unwrapKey" ], - "n": "x1_rRC4ZYqlkl_Cbu8D1rUgnDx_zpmPgSqW-XDiHzrXaEQHoL91eMqO29-scSvFJOjBo_5KfC1Pe6Zc7LE7m4v7jq7b28MP5HBtojWS_gUg0PjqvV4EWTBMEjwONk8nhMdA-VbEzw-FvGgl4S-Lv55JbbVUWFFYSosp7XbGZJgPZrQaRapR2tACUgsrgT9YF8DGpTvcstkbKBUiQDrHQwUmUpkh54KDsCFu0XDMlWXbXMfFHVsrkHij4-7MJ08MqsH43TxihyAIJK_u0-0qh2eLrcMVdWYL4RNUmTq7_egL05YPEg0l88x1eerUUZGBlANo2qJChs2y2SpBdLyRSLQ", + "n": "rUoIghOelh092hicNLeWagAwNqNOfuvCI3VSwk4m6oOW2g4qk58_vF_5Q5T47r_wXMt2dx3rBwPoUVU44qXuuGbU4Qrx1MN3dgb8nr-RjyeqiSpXZxhi8myMllUmTYsvfHaOs8LUMPnaIoJxaI1jXcZaWKzhlPW_z8NTgxn4f6UXaWjEgMN3-M8oDQNM8pVdBYVU6Fsx2j9rgjIomfNTZK6FRBdvBzJXb6KV5eEhMcs3imGI7EB3TsKneHwf-npAiCW8BK46m8r411kYKbjOVUYrELsNAcEfNcEbaH9xj6oaYLbcpGA_LA1iF8UQ7hkBWlj_BsHk7ngNzNIN9RXE3Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639066223, - "updated": 1639066223, + "created": 1640018415, + "updated": 1640018415, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -231,7 +230,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:23 GMT", + "Date": "Mon, 20 Dec 2021 16:40:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -239,7 +238,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6d12bbae-2aa9-4793-9c88-f8c53042f873", + "x-ms-request-id": "eb73bc16-0682-40ab-bea9-448117c78673", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -268,7 +267,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:23 GMT", + "Date": "Mon, 20 Dec 2021 16:40:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -276,44 +275,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ae94803b-2c40-4957-a0ee-c020e8044d79", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key3359961573" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3359961573?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key3359961573?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:24 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "25602369-cf66-4a74-bc9c-18370e0a18d7", + "x-ms-request-id": "91b24d1d-0a4d-4685-9f9c-5faefa71bef2", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -342,7 +304,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -350,15 +312,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "35d6061c-778f-4135-9278-8babd8bf5c2c", + "x-ms-request-id": "143bad1b-9def-4892-8196-4e0810df62c0", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3359961573", - "deletedDate": 1639066224, - "scheduledPurgeDate": 1639671024, + "deletedDate": 1640018416, + "scheduledPurgeDate": 1640623216, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573/0261e4ab1bcd42a582e934d32ac49f35", + "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573/dc98f8b074d146338700f3c4eff46882", "kty": "RSA", "key_ops": [ "encrypt", @@ -368,13 +330,13 @@ "wrapKey", "unwrapKey" ], - "n": "x1_rRC4ZYqlkl_Cbu8D1rUgnDx_zpmPgSqW-XDiHzrXaEQHoL91eMqO29-scSvFJOjBo_5KfC1Pe6Zc7LE7m4v7jq7b28MP5HBtojWS_gUg0PjqvV4EWTBMEjwONk8nhMdA-VbEzw-FvGgl4S-Lv55JbbVUWFFYSosp7XbGZJgPZrQaRapR2tACUgsrgT9YF8DGpTvcstkbKBUiQDrHQwUmUpkh54KDsCFu0XDMlWXbXMfFHVsrkHij4-7MJ08MqsH43TxihyAIJK_u0-0qh2eLrcMVdWYL4RNUmTq7_egL05YPEg0l88x1eerUUZGBlANo2qJChs2y2SpBdLyRSLQ", + "n": "rUoIghOelh092hicNLeWagAwNqNOfuvCI3VSwk4m6oOW2g4qk58_vF_5Q5T47r_wXMt2dx3rBwPoUVU44qXuuGbU4Qrx1MN3dgb8nr-RjyeqiSpXZxhi8myMllUmTYsvfHaOs8LUMPnaIoJxaI1jXcZaWKzhlPW_z8NTgxn4f6UXaWjEgMN3-M8oDQNM8pVdBYVU6Fsx2j9rgjIomfNTZK6FRBdvBzJXb6KV5eEhMcs3imGI7EB3TsKneHwf-npAiCW8BK46m8r411kYKbjOVUYrELsNAcEfNcEbaH9xj6oaYLbcpGA_LA1iF8UQ7hkBWlj_BsHk7ngNzNIN9RXE3Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639066223, - "updated": 1639066223, + "created": 1640018415, + "updated": 1640018415, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -397,7 +359,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 16:10:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -405,7 +367,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a4672900-c03d-42a4-a829-152c1dbf422a", + "x-ms-request-id": "3c7291bc-2287-47b3-9a47-8860871b82d1", "X-Powered-By": "ASP.NET" }, "ResponseBody": null @@ -429,7 +391,7 @@ "Cache-Control": "no-cache", "Content-Length": "831", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -437,15 +399,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2efdfb57-a2d1-4ada-8d94-0c7539642c17", + "x-ms-request-id": "45d70399-99f0-48ec-b269-fc0162d121cc", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3359961573hsm", - "deletedDate": 1639066225, - "scheduledPurgeDate": 1639671025, + "deletedDate": 1640018417, + "scheduledPurgeDate": 1640623217, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573hsm/4bdd2368fbbf4e0595a25d0d0402e77b", + "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573hsm/fe6a007f75d24c51872aab1c136fce37", "kty": "RSA-HSM", "key_ops": [ "encrypt", @@ -455,13 +417,13 @@ "wrapKey", "unwrapKey" ], - "n": "vD0usovYQmKw8QrS1YkJ6xPt8vaHoe3H-fFbkeynKk_2gtzZe9JiS4mioETKW75WcRJYVuwMgq9crSTzzvPBU0OvjoAAxk_8tdDkbasNZdJs-yq-EZG4jM1aVg5fS_x-y-ey6VL8uHCUf6xC3uclyCntaKlXRJjCk55fWoUNEiyBSKCAZ16pH58OMLdyi8lrBWWgsBd-Z7CxVKDHHIghdzsMtO6H2tv_NHTnuCo64iWn3FuFpHy7qbew3DOmz29UmwPR7UYYZKBNSK5FfGdEfXUZ941shb6RWDoX6pj40EKEq2xs53xLZb6YRjKz11-tJl1tnCgfegzMSGjpx2YSdw", + "n": "lmRpmJLTe3VWZ4xwRNWauo-KwBMnPfwtHwEEEwpIbDzOGHMdzQdmgCGOkzcgdQsOzDdk6zn7bg6-B-QIaLsTcSSkx1FgdvymP_IAHNjc9mcPMNziA-rEc8TTRP-W-tNqpNayoXd8DEYLFmb7mtyV7XgGLWT1X33wtVbdJINa-sofzLzi6sNTUvelXHhovRSm_BlC6ZAD21583v1rzUwcRQTm0FVHlQvlVDmim5Ni8CoLXD6Yha1Km8g85yWKnvN1IJ-7u2Lovv7fLLy1a3fnAwjhGye2OC7kMjG_6BzQCnpQwN2wzgbKgV74CoOVqQQbnanPkjov4BGmZbWiXZ9Dkw", "e": "AAEAAQ" }, "attributes": { "enabled": true, - "created": 1639066223, - "updated": 1639066223, + "created": 1640018415, + "updated": 1640018415, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -486,81 +448,7 @@ "Cache-Control": "no-cache", "Content-Length": "84", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:24 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "780f7568-dc16-4e99-8044-e0299ea87d6f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key3359961573hsm" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3359961573hsm?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key3359961573hsm?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "84", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:24 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "70010498-d8d1-4173-90cf-77324b2f87a4", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key3359961573hsm" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3359961573hsm?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key3359961573hsm?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "84", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:26 GMT", + "Date": "Mon, 20 Dec 2021 16:40:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -568,7 +456,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "fb1692ff-277a-4438-9cff-6d620fc03e4b", + "x-ms-request-id": "8f2fed65-e52b-4b2f-8561-aba163d1d91d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -597,7 +485,7 @@ "Cache-Control": "no-cache", "Content-Length": "84", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:26 GMT", + "Date": "Mon, 20 Dec 2021 16:40:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -605,7 +493,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "48be7504-f06a-4bd6-98e8-40d4600db189", + "x-ms-request-id": "ed30e104-fba0-41b5-9ba2-72f1606e5259", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -634,7 +522,7 @@ "Cache-Control": "no-cache", "Content-Length": "84", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:26 GMT", + "Date": "Mon, 20 Dec 2021 16:40:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -642,7 +530,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d845dfa4-9336-4e14-aa9f-07eacb61465e", + "x-ms-request-id": "c664cebe-5e19-445b-ad15-7945504f0a3b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -671,7 +559,7 @@ "Cache-Control": "no-cache", "Content-Length": "831", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:27 GMT", + "Date": "Mon, 20 Dec 2021 16:40:17 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -679,15 +567,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "5701e1ae-f6e1-40de-b125-a78dff325d81", + "x-ms-request-id": "74a6e73e-094f-4c1f-aa5e-96fd0bed30a9", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3359961573hsm", - "deletedDate": 1639066225, - "scheduledPurgeDate": 1639671025, + "deletedDate": 1640018417, + "scheduledPurgeDate": 1640623217, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573hsm/4bdd2368fbbf4e0595a25d0d0402e77b", + "kid": "https://fakekvurl.vault.azure.net/keys/key3359961573hsm/fe6a007f75d24c51872aab1c136fce37", "kty": "RSA-HSM", "key_ops": [ "encrypt", @@ -697,13 +585,13 @@ "wrapKey", "unwrapKey" ], - "n": "vD0usovYQmKw8QrS1YkJ6xPt8vaHoe3H-fFbkeynKk_2gtzZe9JiS4mioETKW75WcRJYVuwMgq9crSTzzvPBU0OvjoAAxk_8tdDkbasNZdJs-yq-EZG4jM1aVg5fS_x-y-ey6VL8uHCUf6xC3uclyCntaKlXRJjCk55fWoUNEiyBSKCAZ16pH58OMLdyi8lrBWWgsBd-Z7CxVKDHHIghdzsMtO6H2tv_NHTnuCo64iWn3FuFpHy7qbew3DOmz29UmwPR7UYYZKBNSK5FfGdEfXUZ941shb6RWDoX6pj40EKEq2xs53xLZb6YRjKz11-tJl1tnCgfegzMSGjpx2YSdw", + "n": "lmRpmJLTe3VWZ4xwRNWauo-KwBMnPfwtHwEEEwpIbDzOGHMdzQdmgCGOkzcgdQsOzDdk6zn7bg6-B-QIaLsTcSSkx1FgdvymP_IAHNjc9mcPMNziA-rEc8TTRP-W-tNqpNayoXd8DEYLFmb7mtyV7XgGLWT1X33wtVbdJINa-sofzLzi6sNTUvelXHhovRSm_BlC6ZAD21583v1rzUwcRQTm0FVHlQvlVDmim5Ni8CoLXD6Yha1Km8g85yWKnvN1IJ-7u2Lovv7fLLy1a3fnAwjhGye2OC7kMjG_6BzQCnpQwN2wzgbKgV74CoOVqQQbnanPkjov4BGmZbWiXZ9Dkw", "e": "AAEAAQ" }, "attributes": { "enabled": true, - "created": 1639066223, - "updated": 1639066223, + "created": 1640018415, + "updated": 1640018415, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -726,7 +614,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 16:10:27 GMT", + "Date": "Mon, 20 Dec 2021 16:40:17 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -734,7 +622,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "89bf7f0d-f7c6-4e49-95ae-8f99b09f2953", + "x-ms-request-id": "d66cb426-5bd7-4159-9248-7599252c5625", "X-Powered-By": "ASP.NET" }, "ResponseBody": null @@ -762,7 +650,7 @@ "Cache-Control": "no-cache", "Content-Length": "103", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 16:10:27 GMT", + "Date": "Mon, 20 Dec 2021 16:40:17 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -770,7 +658,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "51b6d15f-82e9-4cf3-8c92-a73026fd23fe", + "x-ms-request-id": "adafb268-4cf7-4ffb-8421-2091a4853b48", "X-Powered-By": "ASP.NET" }, "ResponseBody": { diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestCreateOCTKey/TestCreateOCTKey_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestCreateOCTKey/TestCreateOCTKey_HSM.json index d90d0f87760f..eb3b84a591c2 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestCreateOCTKey/TestCreateOCTKey_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestCreateOCTKey/TestCreateOCTKey_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "1c7786f2-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "87eac498-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "0" }, "ResponseBody": null @@ -60,17 +59,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1c9def40-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "171" + "x-ms-request-id": "8806ff82-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "172" }, "ResponseBody": { "attributes": { - "created": 1637185284, + "created": 1640018425, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185284 + "updated": 1640018425 }, "key": { "key_ops": [ @@ -82,7 +81,7 @@ "encrypt", "decrypt" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/023b051612f105ad314b8be1655cc970", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/dd474e0b703646a08491a6faaebe905c", "kty": "oct-HSM" } } @@ -112,19 +111,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1cc21f50-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "113" + "x-ms-request-id": "882bd366-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "116" }, "ResponseBody": { "attributes": { - "created": 1637185284, + "created": 1640018425, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185284 + "updated": 1640018425 }, - "deletedDate": 1637185284, + "deletedDate": 1640018425, "key": { "key_ops": [ "deriveKey", @@ -135,11 +134,11 @@ "verify", "sign" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/023b051612f105ad314b8be1655cc970", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/dd474e0b703646a08491a6faaebe905c", "kty": "oct-HSM" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key900305795", - "scheduledPurgeDate": 1637790084 + "scheduledPurgeDate": 1640623225 } }, { @@ -165,22 +164,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1cdd8fb0-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "31" + "x-ms-request-id": "8847e9f2-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "37" }, "ResponseBody": { "attributes": { - "created": 1637185284, + "created": 1640018425, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185284 + "updated": 1640018425 }, - "deletedDate": 1637185284, + "deletedDate": 1640018425, "key": { "key_ops": [ "decrypt", @@ -191,11 +190,11 @@ "wrapKey", "deriveKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/023b051612f105ad314b8be1655cc970", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/dd474e0b703646a08491a6faaebe905c", "kty": "oct-HSM" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key900305795", - "scheduledPurgeDate": 1637790084 + "scheduledPurgeDate": 1640623225 } }, { @@ -221,22 +220,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1cec9bcc-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "31" + "x-ms-request-id": "8859efa8-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "29" }, "ResponseBody": { "attributes": { - "created": 1637185284, + "created": 1640018425, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185284 + "updated": 1640018425 }, - "deletedDate": 1637185284, + "deletedDate": 1640018425, "key": { "key_ops": [ "decrypt", @@ -247,11 +246,11 @@ "wrapKey", "deriveKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/023b051612f105ad314b8be1655cc970", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key900305795/dd474e0b703646a08491a6faaebe905c", "kty": "oct-HSM" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key900305795", - "scheduledPurgeDate": 1637790084 + "scheduledPurgeDate": 1640623225 } }, { @@ -279,8 +278,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "1cfb9136-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "109" + "x-ms-request-id": "88688f5e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "108" }, "ResponseBody": null } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_HSM.json index 2af667add043..109508500fcc 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "2a123154-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "90b0b344-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "0" }, "ResponseBody": null @@ -60,17 +59,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2a2e489e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "233" + "x-ms-request-id": "90ce381a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "224" }, "ResponseBody": { "attributes": { - "created": 1637185307, + "created": 1640018439, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185307 + "updated": 1640018439 }, "key": { "e": "AQAB", @@ -82,9 +81,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/1c011fc01e8204799f2b353680a512ba", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/9aa2ce84db664fa6917efe3691f1fac3", "kty": "RSA-HSM", - "n": "kfl80WHzENGTjxCPRgl43hIHExnAH3hZ28yYj4e7TiNZHIsm0D7z-hPFvJOmm4zvCTqLNyDKreXnvDMbJVSeaKeVyB-P0QPLxFFlX4RiRDPHuL9IW_f2Cb0O1U7hChCfvcahLEW-kLo7pkMSoPE6Lk6IjGJ22WSz7qHUU5aJr5aj03V-3qVp5iqL1tYUfogp4EFFmnro_YVmxtvVzSddxYM03vB59u8pnlUeZSeazz-HdWQkYyE2l3n-Wq_l_Jm5-CTjDRv_yrOwDoX2k_bcgzVOJ77A4ks-cOeq06QD5KUJZukb4w6A_q0f-cT6yozq5eArGsncuZrVAQE5Xl8Gew" + "n": "j5y4rvyT40kLl0vMRRdP_nGCg8Lr1K2mpYF8kPcdYdD7AlNwTUxAmkU9eUEV6AwL4HFGwBniepoi9bSn8-m4PCiJKdl4I5oQp1oS2iujdnX49qP1PP7_v50RhBe8huhekkN01BisurqnyZS2aCzQfhso2fIR4EUeh51m3voAIfXDELuRmxlgK8b9JJ14kDjXmL1y7ePPXEWgIx1OWRqDLMH0EjUutGB7W8CdYWZEjD1-vgWvM0ApWLa0LPJxQkZfj0WvsPRK7eFhUT0RuWd_GCAo30gpEfWKx1p2A92-givC3SPapg3S0UHr4AzbMHPGwar9dECB35Pa52UB4dXLvw" } } }, @@ -113,19 +112,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2a5c0e5a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "133" + "x-ms-request-id": "90fac7d6-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "142" }, "ResponseBody": { "attributes": { - "created": 1637185307, + "created": 1640018439, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185307 + "updated": 1640018439 }, - "deletedDate": 1637185307, + "deletedDate": 1640018440, "key": { "e": "AQAB", "key_ops": [ @@ -136,12 +135,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/1c011fc01e8204799f2b353680a512ba", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/9aa2ce84db664fa6917efe3691f1fac3", "kty": "RSA-HSM", - "n": "kfl80WHzENGTjxCPRgl43hIHExnAH3hZ28yYj4e7TiNZHIsm0D7z-hPFvJOmm4zvCTqLNyDKreXnvDMbJVSeaKeVyB-P0QPLxFFlX4RiRDPHuL9IW_f2Cb0O1U7hChCfvcahLEW-kLo7pkMSoPE6Lk6IjGJ22WSz7qHUU5aJr5aj03V-3qVp5iqL1tYUfogp4EFFmnro_YVmxtvVzSddxYM03vB59u8pnlUeZSeazz-HdWQkYyE2l3n-Wq_l_Jm5-CTjDRv_yrOwDoX2k_bcgzVOJ77A4ks-cOeq06QD5KUJZukb4w6A_q0f-cT6yozq5eArGsncuZrVAQE5Xl8Gew" + "n": "j5y4rvyT40kLl0vMRRdP_nGCg8Lr1K2mpYF8kPcdYdD7AlNwTUxAmkU9eUEV6AwL4HFGwBniepoi9bSn8-m4PCiJKdl4I5oQp1oS2iujdnX49qP1PP7_v50RhBe8huhekkN01BisurqnyZS2aCzQfhso2fIR4EUeh51m3voAIfXDELuRmxlgK8b9JJ14kDjXmL1y7ePPXEWgIx1OWRqDLMH0EjUutGB7W8CdYWZEjD1-vgWvM0ApWLa0LPJxQkZfj0WvsPRK7eFhUT0RuWd_GCAo30gpEfWKx1p2A92-givC3SPapg3S0UHr4AzbMHPGwar9dECB35Pa52UB4dXLvw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1365154215", - "scheduledPurgeDate": 1637790107 + "scheduledPurgeDate": 1640623240 } }, { @@ -167,22 +166,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2a7aa91e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "38" + "x-ms-request-id": "911aaeb6-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "34" }, "ResponseBody": { "attributes": { - "created": 1637185307, + "created": 1640018439, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185307 + "updated": 1640018439 }, - "deletedDate": 1637185307, + "deletedDate": 1640018440, "key": { "e": "AQAB", "key_ops": [ @@ -193,12 +192,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/1c011fc01e8204799f2b353680a512ba", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/9aa2ce84db664fa6917efe3691f1fac3", "kty": "RSA-HSM", - "n": "kfl80WHzENGTjxCPRgl43hIHExnAH3hZ28yYj4e7TiNZHIsm0D7z-hPFvJOmm4zvCTqLNyDKreXnvDMbJVSeaKeVyB-P0QPLxFFlX4RiRDPHuL9IW_f2Cb0O1U7hChCfvcahLEW-kLo7pkMSoPE6Lk6IjGJ22WSz7qHUU5aJr5aj03V-3qVp5iqL1tYUfogp4EFFmnro_YVmxtvVzSddxYM03vB59u8pnlUeZSeazz-HdWQkYyE2l3n-Wq_l_Jm5-CTjDRv_yrOwDoX2k_bcgzVOJ77A4ks-cOeq06QD5KUJZukb4w6A_q0f-cT6yozq5eArGsncuZrVAQE5Xl8Gew" + "n": "j5y4rvyT40kLl0vMRRdP_nGCg8Lr1K2mpYF8kPcdYdD7AlNwTUxAmkU9eUEV6AwL4HFGwBniepoi9bSn8-m4PCiJKdl4I5oQp1oS2iujdnX49qP1PP7_v50RhBe8huhekkN01BisurqnyZS2aCzQfhso2fIR4EUeh51m3voAIfXDELuRmxlgK8b9JJ14kDjXmL1y7ePPXEWgIx1OWRqDLMH0EjUutGB7W8CdYWZEjD1-vgWvM0ApWLa0LPJxQkZfj0WvsPRK7eFhUT0RuWd_GCAo30gpEfWKx1p2A92-givC3SPapg3S0UHr4AzbMHPGwar9dECB35Pa52UB4dXLvw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1365154215", - "scheduledPurgeDate": 1637790107 + "scheduledPurgeDate": 1640623240 } }, { @@ -224,22 +223,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2a8abfac-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "35" + "x-ms-request-id": "912a53e8-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "28" }, "ResponseBody": { "attributes": { - "created": 1637185307, + "created": 1640018439, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185307 + "updated": 1640018439 }, - "deletedDate": 1637185307, + "deletedDate": 1640018440, "key": { "e": "AQAB", "key_ops": [ @@ -250,12 +249,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/1c011fc01e8204799f2b353680a512ba", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1365154215/9aa2ce84db664fa6917efe3691f1fac3", "kty": "RSA-HSM", - "n": "kfl80WHzENGTjxCPRgl43hIHExnAH3hZ28yYj4e7TiNZHIsm0D7z-hPFvJOmm4zvCTqLNyDKreXnvDMbJVSeaKeVyB-P0QPLxFFlX4RiRDPHuL9IW_f2Cb0O1U7hChCfvcahLEW-kLo7pkMSoPE6Lk6IjGJ22WSz7qHUU5aJr5aj03V-3qVp5iqL1tYUfogp4EFFmnro_YVmxtvVzSddxYM03vB59u8pnlUeZSeazz-HdWQkYyE2l3n-Wq_l_Jm5-CTjDRv_yrOwDoX2k_bcgzVOJ77A4ks-cOeq06QD5KUJZukb4w6A_q0f-cT6yozq5eArGsncuZrVAQE5Xl8Gew" + "n": "j5y4rvyT40kLl0vMRRdP_nGCg8Lr1K2mpYF8kPcdYdD7AlNwTUxAmkU9eUEV6AwL4HFGwBniepoi9bSn8-m4PCiJKdl4I5oQp1oS2iujdnX49qP1PP7_v50RhBe8huhekkN01BisurqnyZS2aCzQfhso2fIR4EUeh51m3voAIfXDELuRmxlgK8b9JJ14kDjXmL1y7ePPXEWgIx1OWRqDLMH0EjUutGB7W8CdYWZEjD1-vgWvM0ApWLa0LPJxQkZfj0WvsPRK7eFhUT0RuWd_GCAo30gpEfWKx1p2A92-givC3SPapg3S0UHr4AzbMHPGwar9dECB35Pa52UB4dXLvw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1365154215", - "scheduledPurgeDate": 1637790107 + "scheduledPurgeDate": 1640623240 } }, { @@ -281,14 +280,14 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", - "x-ms-request-id": "2a9a5b2e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "19" + "x-ms-build-version": "1.0.20211206-1-be739728-develop", + "x-ms-request-id": "9139085c-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "17" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/key1365154215 (Activity ID: 2a9a5b2e-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/key1365154215 (Activity ID: 9139085c-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -317,8 +316,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2aa7d452-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "108" + "x-ms-request-id": "914628e8-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "113" }, "ResponseBody": null }, @@ -345,14 +344,14 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", - "x-ms-request-id": "2ac2b484-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "31" + "x-ms-build-version": "1.0.20211206-1-be739728-develop", + "x-ms-request-id": "9161b874-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "27" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1365154215 (Activity ID: 2ac2b484-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1365154215 (Activity ID: 9161b874-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -379,14 +378,47 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", - "x-ms-request-id": "2ad21aaa-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "35" + "x-ms-build-version": "1.0.20211206-1-be739728-develop", + "x-ms-request-id": "91701734-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "31" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1365154215 (Activity ID: 91701734-61b3-11ec-985f-000d3aec06d7)" + } + } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/nonexistent?api-version=7.3-preview", + "RequestMethod": "DELETE", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "DELETE", + ":path": "/keys/nonexistent?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "168", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "917f9bd2-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "18" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1365154215 (Activity ID: 2ad21aaa-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/nonexistent (Activity ID: 917f9bd2-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -413,13 +445,13 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "2ae1bc6c-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "918ccf0a-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "15" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/key1365154215 (Activity ID: 2ae1bc6c-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/key1365154215 (Activity ID: 918ccf0a-61b3-11ec-985f-000d3aec06d7)" } } } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_NON-HSM.json index da2994caa0f5..77f73934679f 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestDeleteKey/TestDeleteKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:45 GMT", + "Date": "Mon, 20 Dec 2021 16:40:37 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2af61702-b7c2-4a90-8505-8d798ed76044", + "x-ms-request-id": "e313e44a-775b-44d9-bff0-7fdab32c6485", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -63,7 +62,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:46 GMT", + "Date": "Mon, 20 Dec 2021 16:40:37 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -71,12 +70,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "5f3bcc02-be88-40f6-8726-d3f27adccab0", + "x-ms-request-id": "79cb61a3-34bc-489d-b7e2-63e4629f329f", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key2367977013/ca20bf7b7a974e889411ccc0adb9900b", + "kid": "https://fakekvurl.vault.azure.net/keys/key2367977013/0c31dc46cf0147f7bc1d365a6497994f", "kty": "RSA", "key_ops": [ "encrypt", @@ -86,13 +85,13 @@ "wrapKey", "unwrapKey" ], - "n": "pnyqj4_Lcx9m0znTQNvSs-kNElT5e757iH_T650_S_Iv6obLKFoVVjLfkHuYjaPxaAuhBcI5nJFNklEdX070nyu4k4ROBUpBw-6yA2tXWAuycffWDYUc_SoPjV4DF8GAjAY0z7PeB1yEKFY_Jw1l6kTPNZdy58Be9Zp_2s1yOS44tnzDNIu2EBYp8YIA6_qBkoTDM7HwqrljwHGUD_YJ65pRxt5Ut5IFWYKxH9CBkDlB2W796EnOAB_PsDQIri1o1POSZdBs1rTaUjn9ZiSErv0Y7tmYv6ozmU2843ajmDaBPxFyPkLnyfZUhjo0M79tB6VJR-cHwzi1R88LNTtA0Q", + "n": "tbucaVI6JUrVCyfp2MwRHRHvnyorwpyjxoHBJydac2oCjaijgXOl8D4yBW-dg-fykYXYD91ouIvlObRUSRM95rZ0aGYdFV84Mgs0RVzio_1uXZfwaVs3Wo_pyhkaghdwvLrVP3rMSjfb9c1kB0RKK2N0tiYrAZ9NJ0K8eK9qkbMQPgx0aiui9qKhL_iKJCJbjPnSgpVUbncE3D2DIWPPh9BXucprFFUQt5Bu2PhHW3EDJkk0ECMlmZx3wIVQ5O4TWMPWODg8Ss4uNFI-gEPuHv2uRgp5eJgHpNyf5A0gJvEwM7tGA00OKElmDbg8h936xrqG64xLnieNLe3auA3ADQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639071706, - "updated": 1639071706, + "created": 1640018437, + "updated": 1640018437, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -117,7 +116,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:46 GMT", + "Date": "Mon, 20 Dec 2021 16:40:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -125,15 +124,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "084f5a8c-a5a1-436a-b92e-29eb1540661a", + "x-ms-request-id": "abb2b412-683c-4961-8224-e10fdfe2f87a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013", - "deletedDate": 1639071707, - "scheduledPurgeDate": 1639676507, + "deletedDate": 1640018438, + "scheduledPurgeDate": 1640623238, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key2367977013/ca20bf7b7a974e889411ccc0adb9900b", + "kid": "https://fakekvurl.vault.azure.net/keys/key2367977013/0c31dc46cf0147f7bc1d365a6497994f", "kty": "RSA", "key_ops": [ "encrypt", @@ -143,13 +142,13 @@ "wrapKey", "unwrapKey" ], - "n": "pnyqj4_Lcx9m0znTQNvSs-kNElT5e757iH_T650_S_Iv6obLKFoVVjLfkHuYjaPxaAuhBcI5nJFNklEdX070nyu4k4ROBUpBw-6yA2tXWAuycffWDYUc_SoPjV4DF8GAjAY0z7PeB1yEKFY_Jw1l6kTPNZdy58Be9Zp_2s1yOS44tnzDNIu2EBYp8YIA6_qBkoTDM7HwqrljwHGUD_YJ65pRxt5Ut5IFWYKxH9CBkDlB2W796EnOAB_PsDQIri1o1POSZdBs1rTaUjn9ZiSErv0Y7tmYv6ozmU2843ajmDaBPxFyPkLnyfZUhjo0M79tB6VJR-cHwzi1R88LNTtA0Q", + "n": "tbucaVI6JUrVCyfp2MwRHRHvnyorwpyjxoHBJydac2oCjaijgXOl8D4yBW-dg-fykYXYD91ouIvlObRUSRM95rZ0aGYdFV84Mgs0RVzio_1uXZfwaVs3Wo_pyhkaghdwvLrVP3rMSjfb9c1kB0RKK2N0tiYrAZ9NJ0K8eK9qkbMQPgx0aiui9qKhL_iKJCJbjPnSgpVUbncE3D2DIWPPh9BXucprFFUQt5Bu2PhHW3EDJkk0ECMlmZx3wIVQ5O4TWMPWODg8Ss4uNFI-gEPuHv2uRgp5eJgHpNyf5A0gJvEwM7tGA00OKElmDbg8h936xrqG64xLnieNLe3auA3ADQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639071706, - "updated": 1639071706, + "created": 1640018437, + "updated": 1640018437, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -174,4928 +173,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:46 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4e333873-1f9e-4551-b67a-951cba402df3", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:46 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d75d6aec-e576-4e9f-a1c9-7bfefc0f2807", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4cdc7a7b-9d09-49ab-85fc-46d15801aa32", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "be934b08-9d0e-405d-8880-3059b2825dc6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3cd167f6-6692-4d98-ad4b-7360a1df5287", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:48 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "02185ac5-5522-461e-ae64-689dc535e25e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:48 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "28c3d6fa-5838-4d79-bf33-52ff0a15547b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:48 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c24e317f-387e-49d9-a4dd-cf011d2d9226", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:49 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0a23239b-390d-4197-a6e8-54dbb8de10b1", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:49 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "573577d1-e4c3-4d93-9c1a-fe88197fbf85", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:49 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "69c4240b-2775-4fa8-b8a4-1d985e1c1bb4", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:51 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7b2943b0-23de-47dc-b605-29e0261acb78", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:51 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "04d1b62b-4f76-4063-a8ea-e73f9a9df2a4", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:51 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3df9d0ea-3609-4529-a81f-5c8ddac456f0", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:52 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b11dc69d-0f4d-431f-9b94-d17870f5fd9b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:52 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d7e1d91e-3ebd-4458-9eec-dcab9c3726f1", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:52 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2a7f0a2c-9383-44b1-bf92-12a60efd7918", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:53 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "aa26e42b-269a-4de4-ae75-310350ace1eb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:53 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "924aefe5-3024-4b11-9149-5b079d9121e6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:53 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "607fbcfa-211c-4389-93be-9df5711e6eb2", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:54 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "edd6c54c-1c15-4c6b-baaa-e2d02bbc9394", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:54 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "576e80df-0f1f-49eb-bd64-89fe88221603", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:54 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "01cb1401-3134-4433-a6af-3addaf0ae125", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:55 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "221ae7da-031b-4109-be68-7fcbf2133b92", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:55 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c6e34bb6-27e2-459b-ba7d-7f0163b24041", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:55 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "cd8dec6f-a75c-4451-aeba-d530647c0f31", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:56 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "fcd3a01d-f315-4f2e-8319-fb837a52dc0b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:56 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "286b4e90-2554-4ec9-89a0-b5f5204841d4", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:56 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "15a0d575-f12e-4534-8888-fb919e88834a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:57 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4aa3546e-3244-445f-ab8c-cb787fadaf30", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:57 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ead7396d-dbc4-4a27-9f95-5db4e36cdfc5", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:57 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7dd2ef07-ce18-4d23-a0a5-b15785115613", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "14f90d24-6297-4771-989d-061067dd69aa", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4e4f3435-4637-4d7d-931b-f40e03b76e60", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "04851a92-659e-4e4c-9922-5d4c67fc114e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4de212ad-b120-4549-8019-925b9c0daa22", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:41:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "bc80c087-dcc2-405f-92a5-96f60a5f7d1f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:00 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "bea1cda9-b252-4b31-902c-fdecf683a343", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:00 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6769410b-59b4-4f6a-a050-2028c6b61ec6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:00 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ea43cf16-b008-46ac-ae63-7fab44dba6d6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:01 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c70f30a2-18ed-448a-a461-3bff1c5abedb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:01 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "286e99b2-61d8-401e-8c35-a909e3ebfa50", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:01 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d1f93728-7cae-4078-85b6-0c8a461e133e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:02 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a968977f-f222-49b7-9d35-e62bd952ab59", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:02 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "df8b9af8-8888-421e-a4e2-2d0856e3a064", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:03 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "8bc4ecd9-154d-41d8-a5b9-ba3f8e726704", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:03 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e01edbca-04ed-4c90-8299-2f32149c8ed8", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:03 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "97d2a07d-4365-42f4-8ed1-9389c50acacb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "784372a5-a54c-4ac6-8b8c-524a0771e188", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b1cf125d-473a-4762-a98b-99292a19df13", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a9df64b7-344d-4e3c-848f-85605a888493", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:05 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "40930838-be51-4133-97f9-ad4e5fdfea9a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:05 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0df1f089-6e33-41ea-8612-1580d5b429bd", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:05 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f846a8c5-ef52-41f0-a205-b2c72ea85640", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:06 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b26d9f7e-497f-4fe2-89cd-4787f718b71f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:06 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "8b5d6d13-a3bd-4d02-940e-78a35040506a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:06 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b07ed38f-08dd-4bb4-bb5e-90a78758d27e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:08 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "66b67e2b-e729-4481-ac7e-dacfac6e1c48", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:08 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "9e21dde5-0480-44ad-8305-58229a98d812", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:08 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "fdc31e3a-2336-4727-b3c6-b054505464bc", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:09 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e25efff0-68d6-47cb-91cb-e8be35cb9ad1", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:09 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a5995502-d47c-49d9-a789-3b58f314dc4d", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:09 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "55784d8c-f4c2-40a1-8124-cfa2931a405c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:10 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4b24b79a-2404-4dcd-be3b-2a6445264a39", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:10 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e77613b2-6ad5-4c32-8f4f-35d85800036b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:10 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "eda4d04a-1b03-4c4a-9d57-0902e3aeee5c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:11 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "432bad65-03df-45c3-9d06-30e9b294f8c0", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:11 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "60194fa3-e422-4721-a72f-82841e0f78fc", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:11 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "438400b1-6fb8-4cb0-9d98-1f031cbc8135", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d76e0d78-dea9-411a-b5d6-2f1508fa23bb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "652b7e53-13f0-4b45-9070-7b71a94ab400", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "5f0750b4-0699-4f48-961e-820b81dd4cce", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "592cc419-1b20-4513-82c4-3fe68e87d904", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b637fd98-388c-4755-a543-a43e9005226a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "42e54232-4956-422e-8e2c-530056af2a1b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:14 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "be14f521-cc72-4a3f-8964-4e5e47193664", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:14 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2956897a-5feb-4b6e-9377-dc3903125d61", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:14 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "8b23a06f-cc80-4e3f-b00c-a9d761b7f5c8", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "da07ecfd-9ecd-4725-9a27-75300232fdd6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "294f82a4-7936-4e27-bfc0-e50976aab982", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f99483ab-a696-49db-8e90-1cb2a5fac467", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:16 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "03dfafff-fdaa-4f4f-874d-6b42f5c0784c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:16 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b0132cda-1be8-44dc-b3cb-1ab9890d2a3e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:16 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e3d99bf0-170c-44a5-b60c-def76b6fb02c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:17 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a4caa80d-1b95-47be-82b7-126bf898185b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:17 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3319fd78-5802-4b61-99b7-8b50c0a67ac4", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:17 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ce34f986-0f83-4b27-b8f2-8422adedbdca", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:18 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e5d7fe48-551d-4d7b-9674-91a7c008fbcb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:18 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "35a1f808-220a-46ef-85bc-60763cb4a58f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:18 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a41e3234-8b15-4060-a3f0-e5d3bfccccbe", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "64265ccb-56bb-4893-bcc3-e7d167952fde", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b2e4300b-f9c7-49ec-b4ee-c0ef3fa3dd6f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "fd1fe26c-4fb3-4f6f-a1a1-834cf39fbc65", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:21 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "41541268-a12b-46df-8897-3cdd295968e9", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:21 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c32ba7dd-43a1-4a63-bc71-12f15a0ab648", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:21 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3ca9a346-a307-43ad-9dc3-acc395b9caa7", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:22 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a3cb09b8-6ab0-4f44-9b87-2ce508a2bef5", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:22 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ac006f8e-78f1-4e8b-8633-7120046851f0", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:22 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7f3ac619-6587-4f24-82b8-5e04e4ebc36f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:23 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2016eecb-5ca3-4af7-ae3a-15c4fdba072d", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:23 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "fb75d9cd-a589-452b-87a5-cc21fae1ab5e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:23 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "9c517192-b5b0-45ed-b349-057494268673", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:24 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "dffdc04a-90c2-4036-a896-4cae8fe0a573", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:24 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "16954847-89c5-42cc-a7c4-42f9cfa54379", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:24 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3020e8d5-fbb2-43ab-9eed-ce57dffe1303", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:25 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b2c1927b-cd8c-459a-9229-7dbd6a911040", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:25 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "48a3e3e9-ec3d-4591-b8d2-d0d743603487", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:25 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "00b0c7a8-080b-455c-a023-eb7cb6f091d6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b4824f22-0137-41fc-b2fc-69af939ececc", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d8b0c602-f2dd-4a99-9754-a626fed95a52", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "82451e4f-7eff-4c14-a7c9-1d0b381a1ffa", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:27 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0f042872-c8b1-496d-8283-22b0e356014a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:27 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c4ccfb8f-2062-4108-88d2-97e103f859c4", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:27 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "01e895dc-a882-46e4-b4d0-3d62b54dd9a8", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:28 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a19c8228-ea93-49c8-8521-9dce732567ff", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:28 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1da00e55-0880-4ab7-8770-b1b48cb36df9", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:29 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "68b815c0-0b82-47c6-aed9-fb61dd3d8114", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:29 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "39fdceb2-a9dc-4263-91cb-8889da6d2967", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:29 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "cea43909-33b6-42da-a893-4209c62f0c23", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2453081c-ca7a-4f95-b7ef-d6b389595e09", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0df9e8fc-cbc4-4521-b9a7-767322ac477f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:30 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f37d3d5a-7a8d-4dc4-a240-b0dc4f1b0feb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:31 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "071130d5-ec16-4a35-b8e8-3385185b2f67", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:31 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2f68408c-b64b-4acc-b05e-7d990d237a07", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:31 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7c47f537-cbdc-4104-af40-5d892c05d48e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:32 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "909d53a4-8d6f-4fb9-a760-183682b6b43a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:32 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "55a4d269-b5f7-4332-b110-a081d76966cb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:32 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "be588b2c-2669-477a-83f6-f063cab393d2", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:33 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "4722b271-2857-43ad-9329-ff40fd44a46e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:33 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "91b614e4-5d9f-449b-b5e7-23fabb397872", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:33 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0e80f400-6f22-4e1b-ae3e-67bc95eeb232", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "37ad8c9b-3e61-47de-818a-c98e9f777b27", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "84ff8bc0-a4ec-40e5-ab99-3ee278f3455f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key2367977013" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key2367977013?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:34 GMT", + "Date": "Mon, 20 Dec 2021 16:40:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5103,7 +181,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ecd4fc9a-1e9f-484d-9285-bb3340ac6841", + "x-ms-request-id": "d6f2b8d0-8611-4cd1-8e2a-9edbb8b981af", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -5132,7 +210,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5140,7 +218,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c3187ad1-de7c-40fa-9b76-00d09813f633", + "x-ms-request-id": "16ec16e3-d171-4b79-9d6e-851c6ff7e4bb", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -5169,7 +247,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5177,15 +255,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "88cd6b99-676d-463c-98cf-f1f55dae37fc", + "x-ms-request-id": "26f39baa-7682-4082-8d8a-a8feb0eeeedc", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key2367977013", - "deletedDate": 1639071707, - "scheduledPurgeDate": 1639676507, + "deletedDate": 1640018438, + "scheduledPurgeDate": 1640623238, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key2367977013/ca20bf7b7a974e889411ccc0adb9900b", + "kid": "https://fakekvurl.vault.azure.net/keys/key2367977013/0c31dc46cf0147f7bc1d365a6497994f", "kty": "RSA", "key_ops": [ "encrypt", @@ -5195,13 +273,13 @@ "wrapKey", "unwrapKey" ], - "n": "pnyqj4_Lcx9m0znTQNvSs-kNElT5e757iH_T650_S_Iv6obLKFoVVjLfkHuYjaPxaAuhBcI5nJFNklEdX070nyu4k4ROBUpBw-6yA2tXWAuycffWDYUc_SoPjV4DF8GAjAY0z7PeB1yEKFY_Jw1l6kTPNZdy58Be9Zp_2s1yOS44tnzDNIu2EBYp8YIA6_qBkoTDM7HwqrljwHGUD_YJ65pRxt5Ut5IFWYKxH9CBkDlB2W796EnOAB_PsDQIri1o1POSZdBs1rTaUjn9ZiSErv0Y7tmYv6ozmU2843ajmDaBPxFyPkLnyfZUhjo0M79tB6VJR-cHwzi1R88LNTtA0Q", + "n": "tbucaVI6JUrVCyfp2MwRHRHvnyorwpyjxoHBJydac2oCjaijgXOl8D4yBW-dg-fykYXYD91ouIvlObRUSRM95rZ0aGYdFV84Mgs0RVzio_1uXZfwaVs3Wo_pyhkaghdwvLrVP3rMSjfb9c1kB0RKK2N0tiYrAZ9NJ0K8eK9qkbMQPgx0aiui9qKhL_iKJCJbjPnSgpVUbncE3D2DIWPPh9BXucprFFUQt5Bu2PhHW3EDJkk0ECMlmZx3wIVQ5O4TWMPWODg8Ss4uNFI-gEPuHv2uRgp5eJgHpNyf5A0gJvEwM7tGA00OKElmDbg8h936xrqG64xLnieNLe3auA3ADQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639071706, - "updated": 1639071706, + "created": 1640018437, + "updated": 1640018437, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -5226,7 +304,7 @@ "Cache-Control": "no-cache", "Content-Length": "301", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5234,7 +312,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "28e5a50d-4082-4cfe-a191-515e1fdae4a1", + "x-ms-request-id": "e5246edd-f1d3-47df-a028-8429e7b8efd4", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -5261,7 +339,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 17:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5269,7 +347,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "fa9a0d6f-a424-4cf3-ae89-9dbf2f810372", + "x-ms-request-id": "192938c2-4364-4046-8d02-2f1fdec5246e", "X-Powered-By": "ASP.NET" }, "ResponseBody": null @@ -5293,7 +371,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5301,7 +379,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ba03f55a-79a8-4b5f-9b81-0a06e4019721", + "x-ms-request-id": "2796d24a-7d57-4729-9b77-5f63eac92b02", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -5330,7 +408,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:39 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5338,7 +416,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1f702e57-8218-410d-825a-f1ec0cde88d4", + "x-ms-request-id": "a9bb890c-95c1-4dd4-ac91-809ffa953926", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -5367,7 +445,7 @@ "Cache-Control": "no-cache", "Content-Length": "299", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:39 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5375,7 +453,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "aa42dd9d-7a5a-4a51-9d12-575bd103a960", + "x-ms-request-id": "a21ec50b-04d2-4070-a0c3-ccf23b60527b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -5404,7 +482,7 @@ "Cache-Control": "no-cache", "Content-Length": "301", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:42:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:39 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -5412,7 +490,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6c73d687-5525-4a24-880c-279fd2231a0f", + "x-ms-request-id": "1d83cf01-400e-4c65-ba1e-26051beacd19", "X-Powered-By": "ASP.NET" }, "ResponseBody": { diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestGetDeletedKey/TestGetDeletedKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestGetDeletedKey/TestGetDeletedKey_NON-HSM.json index 22841675a6ac..4f45e6b642ba 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestGetDeletedKey/TestGetDeletedKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestGetDeletedKey/TestGetDeletedKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1b92e3e9-cc2a-4453-83d0-9a74a871fbb6", + "x-ms-request-id": "048ea7c8-e74f-4518-a12d-65a84c8dec70", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "691", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "561636bd-7530-4a14-be8d-5e8d8f9f9a6a", + "x-ms-request-id": "492c2fc2-668b-4a79-9552-e9d8afc18351", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/ca2a9a66dc5c40b3b70519c47b32bc5e", + "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/f1716b3e1d80455e83ffb5cb7cf359c7", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "x--rY924YbYUmUst-siAzOpLR7Kfq-Qz6hs-tlWWfkYTS9mNmz7ufPIDh8BVvWd6AQPcNhXEOSeyYUrfvWm2P9ZCepu56pHYotPk2_MtHHbFwRBVF_lGZ07RDoCTZlWJlrMPRotiMqpi4LT5cR4YfysvE-N9rklYe8kZF94YfdrwG2tNXZM6Uysqo2ESAd2j_ONSogpkdfikxj8X9wT3HEX-9vrOH7SIGr3pmSRWz_ue8SdIYvhFKgUAaZ94d7yYxD7Gh_z2YgWRi_M5jnZreiR-ucGlqVjwNW82yf6ujKWj06N3JQw9BQmTNKg135IAP3darM1VNtizOSJv6l3EXQ", + "n": "segZ3nHJ66Y-iHLf_gJ5nYthRUfj4e6ZKMpzO7_4IxPw_iC5udf4U-0iNC2rvZgY9SMWyq3zXEKo92WPkAyB2BVP3ln0dGn10KqyVy7LUQ13AmnNaBOHh5HAXjtf5304m7sFsgGZWI884zPLfLilc_yAJL2YGPMola4k2j4WIBtuUo6-HdNEDR_elvvePChlesjpUNUM29YOucaCkCHxrbf38F0qN7V4ELPEn6TpPqOvHce1tc5PR5L7fq-e4VM3T7UkaBaGqjeKnCMlkK1h7KKf4i0UN1Vsh3Y744jhIeM1VfpXckAEIe4d4JPw5reXMsKjEbtghJKoAh1curAMgQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639064862, - "updated": 1639064862, + "created": 1640018487, + "updated": 1640018487, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -116,7 +115,7 @@ "Cache-Control": "no-cache", "Content-Length": "827", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -124,15 +123,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "448a1e17-4b18-4fc7-bc3f-97a7dcbb29eb", + "x-ms-request-id": "86accbcf-f96f-4d60-be12-885466e72f1b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/keyName2187501853", - "deletedDate": 1639064862, - "scheduledPurgeDate": 1639669662, + "deletedDate": 1640018488, + "scheduledPurgeDate": 1640623288, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/ca2a9a66dc5c40b3b70519c47b32bc5e", + "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/f1716b3e1d80455e83ffb5cb7cf359c7", "kty": "RSA", "key_ops": [ "encrypt", @@ -142,13 +141,13 @@ "wrapKey", "unwrapKey" ], - "n": "x--rY924YbYUmUst-siAzOpLR7Kfq-Qz6hs-tlWWfkYTS9mNmz7ufPIDh8BVvWd6AQPcNhXEOSeyYUrfvWm2P9ZCepu56pHYotPk2_MtHHbFwRBVF_lGZ07RDoCTZlWJlrMPRotiMqpi4LT5cR4YfysvE-N9rklYe8kZF94YfdrwG2tNXZM6Uysqo2ESAd2j_ONSogpkdfikxj8X9wT3HEX-9vrOH7SIGr3pmSRWz_ue8SdIYvhFKgUAaZ94d7yYxD7Gh_z2YgWRi_M5jnZreiR-ucGlqVjwNW82yf6ujKWj06N3JQw9BQmTNKg135IAP3darM1VNtizOSJv6l3EXQ", + "n": "segZ3nHJ66Y-iHLf_gJ5nYthRUfj4e6ZKMpzO7_4IxPw_iC5udf4U-0iNC2rvZgY9SMWyq3zXEKo92WPkAyB2BVP3ln0dGn10KqyVy7LUQ13AmnNaBOHh5HAXjtf5304m7sFsgGZWI884zPLfLilc_yAJL2YGPMola4k2j4WIBtuUo6-HdNEDR_elvvePChlesjpUNUM29YOucaCkCHxrbf38F0qN7V4ELPEn6TpPqOvHce1tc5PR5L7fq-e4VM3T7UkaBaGqjeKnCMlkK1h7KKf4i0UN1Vsh3Y744jhIeM1VfpXckAEIe4d4JPw5reXMsKjEbtghJKoAh1curAMgQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639064862, - "updated": 1639064862, + "created": 1640018487, + "updated": 1640018487, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -173,7 +172,7 @@ "Cache-Control": "no-cache", "Content-Length": "85", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -181,7 +180,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3e0c78a6-640e-41a0-bef7-4e1efb918905", + "x-ms-request-id": "a4fd86ed-5f55-4967-b1cc-3189f99646c3", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -210,7 +209,7 @@ "Cache-Control": "no-cache", "Content-Length": "85", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -218,7 +217,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7f9e3f47-ad5e-49c5-b871-96c870b76bb9", + "x-ms-request-id": "14bd2027-6b80-48a9-96e3-e2364b65220e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -247,7 +246,7 @@ "Cache-Control": "no-cache", "Content-Length": "827", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:43 GMT", + "Date": "Mon, 20 Dec 2021 16:41:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -255,15 +254,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "93bae2d0-5f29-4d7f-8c8a-3df6b3a0e63f", + "x-ms-request-id": "3a151b94-eced-4cdd-b187-1918fd85b794", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/keyName2187501853", - "deletedDate": 1639064862, - "scheduledPurgeDate": 1639669662, + "deletedDate": 1640018488, + "scheduledPurgeDate": 1640623288, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/ca2a9a66dc5c40b3b70519c47b32bc5e", + "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/f1716b3e1d80455e83ffb5cb7cf359c7", "kty": "RSA", "key_ops": [ "encrypt", @@ -273,13 +272,13 @@ "wrapKey", "unwrapKey" ], - "n": "x--rY924YbYUmUst-siAzOpLR7Kfq-Qz6hs-tlWWfkYTS9mNmz7ufPIDh8BVvWd6AQPcNhXEOSeyYUrfvWm2P9ZCepu56pHYotPk2_MtHHbFwRBVF_lGZ07RDoCTZlWJlrMPRotiMqpi4LT5cR4YfysvE-N9rklYe8kZF94YfdrwG2tNXZM6Uysqo2ESAd2j_ONSogpkdfikxj8X9wT3HEX-9vrOH7SIGr3pmSRWz_ue8SdIYvhFKgUAaZ94d7yYxD7Gh_z2YgWRi_M5jnZreiR-ucGlqVjwNW82yf6ujKWj06N3JQw9BQmTNKg135IAP3darM1VNtizOSJv6l3EXQ", + "n": "segZ3nHJ66Y-iHLf_gJ5nYthRUfj4e6ZKMpzO7_4IxPw_iC5udf4U-0iNC2rvZgY9SMWyq3zXEKo92WPkAyB2BVP3ln0dGn10KqyVy7LUQ13AmnNaBOHh5HAXjtf5304m7sFsgGZWI884zPLfLilc_yAJL2YGPMola4k2j4WIBtuUo6-HdNEDR_elvvePChlesjpUNUM29YOucaCkCHxrbf38F0qN7V4ELPEn6TpPqOvHce1tc5PR5L7fq-e4VM3T7UkaBaGqjeKnCMlkK1h7KKf4i0UN1Vsh3Y744jhIeM1VfpXckAEIe4d4JPw5reXMsKjEbtghJKoAh1curAMgQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639064862, - "updated": 1639064862, + "created": 1640018487, + "updated": 1640018487, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -304,7 +303,7 @@ "Cache-Control": "no-cache", "Content-Length": "827", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:45 GMT", + "Date": "Mon, 20 Dec 2021 16:41:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -312,15 +311,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c37d1016-8b60-4255-9fba-24bfad1d53cd", + "x-ms-request-id": "9e74319a-0637-41b2-92f4-68469aabf551", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/keyName2187501853", - "deletedDate": 1639064862, - "scheduledPurgeDate": 1639669662, + "deletedDate": 1640018488, + "scheduledPurgeDate": 1640623288, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/ca2a9a66dc5c40b3b70519c47b32bc5e", + "kid": "https://fakekvurl.vault.azure.net/keys/keyName2187501853/f1716b3e1d80455e83ffb5cb7cf359c7", "kty": "RSA", "key_ops": [ "encrypt", @@ -330,13 +329,13 @@ "wrapKey", "unwrapKey" ], - "n": "x--rY924YbYUmUst-siAzOpLR7Kfq-Qz6hs-tlWWfkYTS9mNmz7ufPIDh8BVvWd6AQPcNhXEOSeyYUrfvWm2P9ZCepu56pHYotPk2_MtHHbFwRBVF_lGZ07RDoCTZlWJlrMPRotiMqpi4LT5cR4YfysvE-N9rklYe8kZF94YfdrwG2tNXZM6Uysqo2ESAd2j_ONSogpkdfikxj8X9wT3HEX-9vrOH7SIGr3pmSRWz_ue8SdIYvhFKgUAaZ94d7yYxD7Gh_z2YgWRi_M5jnZreiR-ucGlqVjwNW82yf6ujKWj06N3JQw9BQmTNKg135IAP3darM1VNtizOSJv6l3EXQ", + "n": "segZ3nHJ66Y-iHLf_gJ5nYthRUfj4e6ZKMpzO7_4IxPw_iC5udf4U-0iNC2rvZgY9SMWyq3zXEKo92WPkAyB2BVP3ln0dGn10KqyVy7LUQ13AmnNaBOHh5HAXjtf5304m7sFsgGZWI884zPLfLilc_yAJL2YGPMola4k2j4WIBtuUo6-HdNEDR_elvvePChlesjpUNUM29YOucaCkCHxrbf38F0qN7V4ELPEn6TpPqOvHce1tc5PR5L7fq-e4VM3T7UkaBaGqjeKnCMlkK1h7KKf4i0UN1Vsh3Y744jhIeM1VfpXckAEIe4d4JPw5reXMsKjEbtghJKoAh1curAMgQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639064862, - "updated": 1639064862, + "created": 1640018487, + "updated": 1640018487, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -359,7 +358,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 15:47:45 GMT", + "Date": "Mon, 20 Dec 2021 16:41:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -367,7 +366,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f28e29bd-1fb7-42e3-90a0-3ded584b579d", + "x-ms-request-id": "d1cfc52c-b701-4a04-9f5d-89db78935c45", "X-Powered-By": "ASP.NET" }, "ResponseBody": null @@ -391,7 +390,7 @@ "Cache-Control": "no-cache", "Content-Length": "305", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 15:47:45 GMT", + "Date": "Mon, 20 Dec 2021 16:41:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -399,7 +398,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "8c1fbec1-e168-41dd-889e-81f7a01e93fa", + "x-ms-request-id": "c9983ec1-88d9-4e42-82f1-155e6277a70f", "X-Powered-By": "ASP.NET" }, "ResponseBody": { diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_HSM.json index 87061a3d2ba7..ad544c79c5cf 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "27a2ae12-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "8f1b6c72-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "0" }, "ResponseBody": null @@ -60,17 +59,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "27cb188e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "214" + "x-ms-request-id": "8f3b1392-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "225" }, "ResponseBody": { "attributes": { - "created": 1637185303, + "created": 1640018437, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185303 + "updated": 1640018437 }, "key": { "e": "AQAB", @@ -82,9 +81,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1478960915/acb1314d31f106f73ff53504ef20d455", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1478960915/0aee0f0fb9b00bb22a62c9d75432a7ea", "kty": "RSA-HSM", - "n": "iXIF8vSchRC-sjiNj1VYQX221hnFkgp91IwXLNsQLFlUuL1W_SXzILGHz7P10J4UgNwvo1p1kQ1kk15JiMGVoVgwbAOdmyk263WoNXZ322G13Qp-Ip4vDs1apt6fDWIOgpNdEJmh-_mYKpiJ_UsFpBsLUeu2tN3RxTh-n7Egw-QpeoTVb8M6bKZmyPjnXIdPXK9umWp-74cicqOSTT43bUjEDLm0ywJg_b_EaI2gxPIjzjmo029vNH0I-J-uTCndZPY1tQd0Ttl4HE4aBwDPu6oeeuAhxH6xVh9Dhh-bGHAsiykMMV0kek8jk9PkplOktgYVYRl_bcyxGYAhtATMWQ" + "n": "qffwvarAn2ZHrrJZb9XQPagjZuFRBm9iJYJStyqshMpeewiQ0f8bxZovPFcC7_igXGxg50OrNkut20qngw2sp5mloB9oKGeEi9YrnnBqQpXnvmJs2nny7Z4W_FT0BA2J1QL8a2WQV8cbxKhoUk7yRAB4jUsX5Mbq3Zyi3tG_XmDdZn2Hq8F_Obyx0oxbOpRDu3J7qhjbmqMeh3GJB305gyd25IBzHdRSi2ybL7IFwBYciMyUR25p8yDCaCEVw4R2pTLwLX4FDNzEyDaIHCxHbfkl7i6HSqICkfZAYrNEThKDsZFejCE0L1N5xgPQhBR3wcgXK_0uJH3DAe8NKq1e9Q" } } }, @@ -111,20 +110,20 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "27f628bc-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "63" + "x-ms-request-id": "8f67c478-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "66" }, "ResponseBody": { "attributes": { - "created": 1637185303, + "created": 1640018437, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185303 + "updated": 1640018437 }, "key": { "e": "AQAB", @@ -136,9 +135,47 @@ "encrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1478960915/acb1314d31f106f73ff53504ef20d455", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1478960915/0aee0f0fb9b00bb22a62c9d75432a7ea", "kty": "RSA-HSM", - "n": "iXIF8vSchRC-sjiNj1VYQX221hnFkgp91IwXLNsQLFlUuL1W_SXzILGHz7P10J4UgNwvo1p1kQ1kk15JiMGVoVgwbAOdmyk263WoNXZ322G13Qp-Ip4vDs1apt6fDWIOgpNdEJmh-_mYKpiJ_UsFpBsLUeu2tN3RxTh-n7Egw-QpeoTVb8M6bKZmyPjnXIdPXK9umWp-74cicqOSTT43bUjEDLm0ywJg_b_EaI2gxPIjzjmo029vNH0I-J-uTCndZPY1tQd0Ttl4HE4aBwDPu6oeeuAhxH6xVh9Dhh-bGHAsiykMMV0kek8jk9PkplOktgYVYRl_bcyxGYAhtATMWQ" + "n": "qffwvarAn2ZHrrJZb9XQPagjZuFRBm9iJYJStyqshMpeewiQ0f8bxZovPFcC7_igXGxg50OrNkut20qngw2sp5mloB9oKGeEi9YrnnBqQpXnvmJs2nny7Z4W_FT0BA2J1QL8a2WQV8cbxKhoUk7yRAB4jUsX5Mbq3Zyi3tG_XmDdZn2Hq8F_Obyx0oxbOpRDu3J7qhjbmqMeh3GJB305gyd25IBzHdRSi2ybL7IFwBYciMyUR25p8yDCaCEVw4R2pTLwLX4FDNzEyDaIHCxHbfkl7i6HSqICkfZAYrNEThKDsZFejCE0L1N5xgPQhBR3wcgXK_0uJH3DAe8NKq1e9Q" + } + } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/invalidkey%5B%5D%28%29/create?api-version=7.3-preview", + "RequestMethod": "POST", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "POST", + ":path": "/keys/invalidkey%5B%5D%28%29/create?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "26", + "Content-Type": "application/json", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": { + "key_ops": [], + "kty": "RSA" + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "128", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "8f7c9f10-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "Invalid key identifier or name (Activity ID: 8f7c9f10-61b3-11ec-985f-000d3aec06d7)" } } } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_NON-HSM.json index 458c5a58ae29..68bc9c481b6a 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestGetKey/TestGetKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:14:13 GMT", + "Date": "Mon, 20 Dec 2021 16:40:36 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6874f4e0-62b8-486a-b128-8375bfedbbe3", + "x-ms-request-id": "d32370e3-06c5-472f-8884-7f852f534510", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -63,7 +62,7 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:14:14 GMT", + "Date": "Mon, 20 Dec 2021 16:40:36 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -71,12 +70,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ef9fcb63-145a-4429-94db-4a118bf04e86", + "x-ms-request-id": "61080dc7-82a3-4b65-89fb-67079b4aff8c", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key398251057/3f53df0991b4486c8a13e52f18575617", + "kid": "https://fakekvurl.vault.azure.net/keys/key398251057/8651a342d3b84013b96ba317afae8fd5", "kty": "RSA", "key_ops": [ "encrypt", @@ -86,13 +85,13 @@ "wrapKey", "unwrapKey" ], - "n": "5Jypojn0rUgHQDk5AK7z9yz7tZrArjJMdiND-Jf8OHtx6rTJAGEmbb5dZJ2apvUHb34tbV87WSFYSuKeAbH4O39bSy5ZsXsj6dgVruL37Rby4LIbqhlqKI_8CUWiqL04NASNVfBrox2fye97eeCCxNNSycMXczLAUVG3DEkHMQvncMbDAvkF81w_oB5nCPrZFkONi1UuV_W8fs_IHxICdS7dJunYKvULzwfAugMPEGnQX6sTljGRR11hesw3HmFU5NvI29MnE99NEZ6CKPFJuXUiHxyg3urMkq4KIcQ4YN9DSxoDTNCOGo-7M8PxcYM3OIqtTxwaZU2LX4JnSRC9mQ", + "n": "6MvkR-2LtIdTzlyG2BE_YKicqHXXU1dqR60mzeB5E-gOibsDBB5123Q33S1gRoriAkGcRbw0ChVsNMsMS2anWiUCEKk9AjbkUGEUG1ulmzmKVWFG9jhcA5tU5v52Y8yOFocs_Rfk9dlHa5hukNjOEy3UjDfgSS6UiqLrPyP_r24_aTdp_Y3xcrLJXVLffhzpqp-h61TJdZmbtpksc_ba4SW5HDlLniE_FYfc_ZlkDz71TMvXKXaonMNJGoSFywqckc0uKI49-4Ifg2ID0967sieQ9ecAtllCfRZjHP9qZ-MN4oys0Z4CQgvSQXGAjAmVyUXr9Grq9kpXkO7xnhGKKQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070054, - "updated": 1639070054, + "created": 1640018436, + "updated": 1640018436, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -117,7 +116,7 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:14:14 GMT", + "Date": "Mon, 20 Dec 2021 16:40:36 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -125,12 +124,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1fe29292-9c5d-4e39-aa91-86b9da1ee1b4", + "x-ms-request-id": "6baa96e2-3d5d-4786-8885-95830b1fff46", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key398251057/3f53df0991b4486c8a13e52f18575617", + "kid": "https://fakekvurl.vault.azure.net/keys/key398251057/8651a342d3b84013b96ba317afae8fd5", "kty": "RSA", "key_ops": [ "encrypt", @@ -140,13 +139,13 @@ "wrapKey", "unwrapKey" ], - "n": "5Jypojn0rUgHQDk5AK7z9yz7tZrArjJMdiND-Jf8OHtx6rTJAGEmbb5dZJ2apvUHb34tbV87WSFYSuKeAbH4O39bSy5ZsXsj6dgVruL37Rby4LIbqhlqKI_8CUWiqL04NASNVfBrox2fye97eeCCxNNSycMXczLAUVG3DEkHMQvncMbDAvkF81w_oB5nCPrZFkONi1UuV_W8fs_IHxICdS7dJunYKvULzwfAugMPEGnQX6sTljGRR11hesw3HmFU5NvI29MnE99NEZ6CKPFJuXUiHxyg3urMkq4KIcQ4YN9DSxoDTNCOGo-7M8PxcYM3OIqtTxwaZU2LX4JnSRC9mQ", + "n": "6MvkR-2LtIdTzlyG2BE_YKicqHXXU1dqR60mzeB5E-gOibsDBB5123Q33S1gRoriAkGcRbw0ChVsNMsMS2anWiUCEKk9AjbkUGEUG1ulmzmKVWFG9jhcA5tU5v52Y8yOFocs_Rfk9dlHa5hukNjOEy3UjDfgSS6UiqLrPyP_r24_aTdp_Y3xcrLJXVLffhzpqp-h61TJdZmbtpksc_ba4SW5HDlLniE_FYfc_ZlkDz71TMvXKXaonMNJGoSFywqckc0uKI49-4Ifg2ID0967sieQ9ecAtllCfRZjHP9qZ-MN4oys0Z4CQgvSQXGAjAmVyUXr9Grq9kpXkO7xnhGKKQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070054, - "updated": 1639070054, + "created": 1640018436, + "updated": 1640018436, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -176,7 +175,7 @@ "Cache-Control": "no-cache", "Content-Length": "102", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:14:14 GMT", + "Date": "Mon, 20 Dec 2021 16:40:36 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -184,7 +183,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d5692c04-e4c3-4695-bacd-c3c4e0bab38f", + "x-ms-request-id": "c771c862-6a0a-4bf9-b5ac-74fe03e3f165", "X-Powered-By": "ASP.NET" }, "ResponseBody": { diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestGetKeyRotationPolicy/TestGetKeyRotationPolicy_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestGetKeyRotationPolicy/TestGetKeyRotationPolicy_NON-HSM.json index f0012a672973..60f6e6c06a2e 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestGetKeyRotationPolicy/TestGetKeyRotationPolicy_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestGetKeyRotationPolicy/TestGetKeyRotationPolicy_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:57 GMT", + "Date": "Mon, 20 Dec 2021 16:41:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -28,8 +27,8 @@ "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "c6883833-faaf-4c9f-898d-2e16b6ea7832", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "3c9c9651-0166-4f91-ac0b-b1e6c8fbfc67", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,20 +61,20 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:57 GMT", + "Date": "Mon, 20 Dec 2021 16:41:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7fd649e4-d5e9-42dd-b5c4-4d2f00d65f0d", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "6453d376-8c87-4888-891a-e6eef4bb8479", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key1507363465/695bb1337a224460bd55742ae3289748", + "kid": "https://fakekvurl.vault.azure.net/keys/key1507363465/58735d530d2b476ebbf7cac48abda68f", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "pfpZR4EC3_1PeYI4OTlc2rlr6JMRh4vhOBQbPYj5QnqZAixjC-_bfVyY5bp0Wb92Z3CIVc9sM1jqBq2AZz4eLzxB7VB9gxuOSEMiTvfRYJLz-D-CkyAicX9GxqtzzLrYJNvxmUJ8L2EK-dD9OlDvHMAH7405S05BR20-LjX55egLuLNIGwftsaNA0W-l-eHsYRM8aOd9ODwqTAIgyFPWqAsUv623AdnpC9erKIVugsjTfem5YC3rS6RRhDtXQysBEB7y4lViu__tLRi-4ky4bpXA0gWjcb7FZeXWgwmPEyuzVenKOtXr43A1VdouPzgRgeUurt0T9R8u2Wo593drsQ", + "n": "3-i3Ytc3-aUCwRVoFKuopfB75cZchjDRnVztu-NyH79S1P5qZfAcxat5gJ3VmCcHN8n4MA5rR_H3hzWMmCefylPsTok8U5LTg6aDxcOmw3nYePgGSr48ug28rofHEqtz8RNdyflPeH9FHqU2tM_UrnV1e-vKENLi8nWaNT9bd_ULTGhWMidiKCs8p9AWq1EBo2sBVBoU5-oYlxbkGNvIfhaMmwaqAN1E1GnXgbc73SOQdGCfT4Eis2ebmye1WYb-AsED5EijV6s6UnahdPJ45f4oZX32bREX02AlHBArJ7LwPDTe_VSYhBY-pB3yuhGaxzTqoW9RfAP66SyopRCtHQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185377, - "updated": 1637185377, + "created": 1640018493, + "updated": 1640018493, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -116,15 +115,15 @@ "Cache-Control": "no-cache", "Content-Length": "106", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:57 GMT", + "Date": "Mon, 20 Dec 2021 16:41:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "79f392ea-e934-4d7b-91f1-c136a42b2d3b", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "6c23088e-cb8a-4cce-a62f-0718a13b3e54", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -160,23 +159,23 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:57 GMT", + "Date": "Mon, 20 Dec 2021 16:41:34 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "2552c1ab-3018-4da7-863e-dd6ed5fd9a1b", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "68d18af3-4b88-4cf0-b0d7-8f50a7c5bee5", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465", - "deletedDate": 1637185378, - "scheduledPurgeDate": 1637790178, + "deletedDate": 1640018494, + "scheduledPurgeDate": 1640623294, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key1507363465/695bb1337a224460bd55742ae3289748", + "kid": "https://fakekvurl.vault.azure.net/keys/key1507363465/58735d530d2b476ebbf7cac48abda68f", "kty": "RSA", "key_ops": [ "encrypt", @@ -186,13 +185,13 @@ "wrapKey", "unwrapKey" ], - "n": "pfpZR4EC3_1PeYI4OTlc2rlr6JMRh4vhOBQbPYj5QnqZAixjC-_bfVyY5bp0Wb92Z3CIVc9sM1jqBq2AZz4eLzxB7VB9gxuOSEMiTvfRYJLz-D-CkyAicX9GxqtzzLrYJNvxmUJ8L2EK-dD9OlDvHMAH7405S05BR20-LjX55egLuLNIGwftsaNA0W-l-eHsYRM8aOd9ODwqTAIgyFPWqAsUv623AdnpC9erKIVugsjTfem5YC3rS6RRhDtXQysBEB7y4lViu__tLRi-4ky4bpXA0gWjcb7FZeXWgwmPEyuzVenKOtXr43A1VdouPzgRgeUurt0T9R8u2Wo593drsQ", + "n": "3-i3Ytc3-aUCwRVoFKuopfB75cZchjDRnVztu-NyH79S1P5qZfAcxat5gJ3VmCcHN8n4MA5rR_H3hzWMmCefylPsTok8U5LTg6aDxcOmw3nYePgGSr48ug28rofHEqtz8RNdyflPeH9FHqU2tM_UrnV1e-vKENLi8nWaNT9bd_ULTGhWMidiKCs8p9AWq1EBo2sBVBoU5-oYlxbkGNvIfhaMmwaqAN1E1GnXgbc73SOQdGCfT4Eis2ebmye1WYb-AsED5EijV6s6UnahdPJ45f4oZX32bREX02AlHBArJ7LwPDTe_VSYhBY-pB3yuhGaxzTqoW9RfAP66SyopRCtHQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185377, - "updated": 1637185377, + "created": 1640018493, + "updated": 1640018493, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -217,348 +216,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "31ae99a1-1805-4f4c-bbad-89ca38684a90", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7a15895a-ade5-443e-8a36-031f9090cf63", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "ff66b1f6-20f5-4257-8d21-46b9a813dce6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:58 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "5ec7d6a8-7071-4b5b-ad3a-23238339af48", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "a054f165-7ab2-4230-9542-d87b6e37d010", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "5de988f3-2f7f-4000-a3bf-250a3cbf177f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:59 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "71f2e70f-55c5-4edf-8e6c-4493c3f5c611", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:00 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4abb460d-2256-4cd1-acf3-f1d76b65293b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:00 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "2d62ea0a-85fe-4c01-a352-d8add6dc5d34", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1507363465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1507363465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:00 GMT", + "Date": "Mon, 20 Dec 2021 16:41:34 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "ecf27044-4f04-4db3-b398-e9862a459186", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "0b20eef5-613b-4975-99ac-5024c98ae545", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -587,15 +253,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:01 GMT", + "Date": "Mon, 20 Dec 2021 16:41:34 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "01a5bb9a-fc82-4015-8c98-38661718325b", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "115e4839-8f80-4cbc-8790-0e3cde9c9f7e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -624,15 +290,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:01 GMT", + "Date": "Mon, 20 Dec 2021 16:41:34 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "f824a50e-46a9-453a-8d79-dce405e5a31c", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "8752a850-a368-49be-941b-e7e4c271ff36", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -661,23 +327,23 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:01 GMT", + "Date": "Mon, 20 Dec 2021 16:41:34 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "727a52a9-824e-4fb5-86e2-24e8b872dde6", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "7a0775cf-1133-4109-92ea-a116bd2a93d1", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key1507363465", - "deletedDate": 1637185378, - "scheduledPurgeDate": 1637790178, + "deletedDate": 1640018494, + "scheduledPurgeDate": 1640623294, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key1507363465/695bb1337a224460bd55742ae3289748", + "kid": "https://fakekvurl.vault.azure.net/keys/key1507363465/58735d530d2b476ebbf7cac48abda68f", "kty": "RSA", "key_ops": [ "encrypt", @@ -687,13 +353,13 @@ "wrapKey", "unwrapKey" ], - "n": "pfpZR4EC3_1PeYI4OTlc2rlr6JMRh4vhOBQbPYj5QnqZAixjC-_bfVyY5bp0Wb92Z3CIVc9sM1jqBq2AZz4eLzxB7VB9gxuOSEMiTvfRYJLz-D-CkyAicX9GxqtzzLrYJNvxmUJ8L2EK-dD9OlDvHMAH7405S05BR20-LjX55egLuLNIGwftsaNA0W-l-eHsYRM8aOd9ODwqTAIgyFPWqAsUv623AdnpC9erKIVugsjTfem5YC3rS6RRhDtXQysBEB7y4lViu__tLRi-4ky4bpXA0gWjcb7FZeXWgwmPEyuzVenKOtXr43A1VdouPzgRgeUurt0T9R8u2Wo593drsQ", + "n": "3-i3Ytc3-aUCwRVoFKuopfB75cZchjDRnVztu-NyH79S1P5qZfAcxat5gJ3VmCcHN8n4MA5rR_H3hzWMmCefylPsTok8U5LTg6aDxcOmw3nYePgGSr48ug28rofHEqtz8RNdyflPeH9FHqU2tM_UrnV1e-vKENLi8nWaNT9bd_ULTGhWMidiKCs8p9AWq1EBo2sBVBoU5-oYlxbkGNvIfhaMmwaqAN1E1GnXgbc73SOQdGCfT4Eis2ebmye1WYb-AsED5EijV6s6UnahdPJ45f4oZX32bREX02AlHBArJ7LwPDTe_VSYhBY-pB3yuhGaxzTqoW9RfAP66SyopRCtHQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185377, - "updated": 1637185377, + "created": 1640018493, + "updated": 1640018493, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -716,15 +382,15 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Wed, 17 Nov 2021 21:43:02 GMT", + "Date": "Mon, 20 Dec 2021 16:41:35 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "258e3bfd-7e20-45af-b48e-3abc1bd595e9", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "49869a1a-742b-46f4-99ed-5bc2e110ec06", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestGetRandomBytes/TestGetRandomBytes_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestGetRandomBytes/TestGetRandomBytes_HSM.json index 2eb1b3cab322..84dc02555339 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestGetRandomBytes/TestGetRandomBytes_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestGetRandomBytes/TestGetRandomBytes_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "52459468-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "acfef2e0-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "0" }, "ResponseBody": null @@ -59,11 +58,48 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "52682dde-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "ad2074ce-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "1" }, "ResponseBody": { - "value": "qJd_Hk4Wac0-k62RlbssIIJYjAIfL89XxAQw94kDuobejgjc2j_XoiNHsdP7_W5XzezrUzwsDlRG0CGB4Hb024jxY4Z4xZUV0NZNPwGsTBq9FsBtHQylpsmN0YWAlAkiFRFXCA" + "value": "XaIS3waclBp-dm7CdScmgd7Ig_RqnlV-W8zMl0_61VzglD2Lo90oXPgsumLOCurraIMzozq0LlvjmPXOAiWndZSK8PK6Jb09_0hX0QoOdveSQJl4XKUHQeDuja0pVuLzQImbNQ" + } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/rng?api-version=7.3-preview", + "RequestMethod": "POST", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "POST", + ":path": "/rng?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "12", + "Content-Type": "application/json", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": { + "count": -1 + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "168", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "ad2b07cc-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "0" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "GetRandomBytesRequest: count cannot be greater than 128 or less than 1 (Activity ID: ad2b07cc-61b3-11ec-985f-000d3aec06d7)" + } } } ], diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_HSM.json index 0df20a49f7b1..3116aa8ebdad 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "51eaf062-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "ac9a36b6-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "0" }, "ResponseBody": null @@ -77,17 +76,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "520e4936-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "254" + "x-ms-request-id": "acbb562a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "280" }, "ResponseBody": { "attributes": { - "created": 1637185374, + "created": 1640018486, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185374 + "updated": 1640018486 }, "key": { "e": "AQAB", @@ -99,11 +98,48 @@ "verify", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/importedKey/a2095d06fc4202ee0e018125d29f792c", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/importedKey/4e1ee0fb18a00c4fa029af86ac5e85a9", "kty": "RSA-HSM", "n": "oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ" } } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/invalid?api-version=7.3-preview", + "RequestMethod": "PUT", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "PUT", + ":path": "/keys/invalid?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "10", + "Content-Type": "application/json", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": { + "key": {} + }, + "StatusCode": 400, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "126", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "acf07e9a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "1" + }, + "ResponseBody": { + "error": { + "code": "BadParameter", + "message": "JSON Web Key: kty is missing (Activity ID: acf07e9a-61b3-11ec-985f-000d3aec06d7)" + } + } } ], "Variables": {} diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_NON-HSM.json index de44bbf213a0..efa04c445157 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestImportKey/TestImportKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:59:04 GMT", + "Date": "Mon, 20 Dec 2021 16:41:25 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d1fd125e-8da7-4998-95b3-b67fecad4d19", + "x-ms-request-id": "3fa251d8-3193-45ec-b82d-b28f46093533", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -78,9 +77,9 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "685", + "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:59:05 GMT", + "Date": "Mon, 20 Dec 2021 16:41:25 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -88,12 +87,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "eca487c2-4108-4ccc-99dc-2a06d04d90a3", + "x-ms-request-id": "fa184d1b-1a45-48a4-b6d6-3e659f63f88a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/importedKey/4623912e81b54f72935c3f492822bbf9", + "kid": "https://fakekvurl.vault.azure.net/keys/importedKey/7ff364788c7140b5af7542a7c801fd50", "kty": "RSA", "key_ops": [ "encrypt", @@ -103,13 +102,13 @@ "wrapKey", "unwrapKey" ], - "n": "oJFNACNKxoOyG0wV1b7Yh73JWcLlevVK5zTo8Acg13XSdeRVIH43hM7rYKUKRlXdcqepTScejuj3lZpmnKbndb8OI7ra6ZG0Up2XhSi0vZBSHTLdJlZ5a6gra7_HZoyPXutQU3R_0ZkxnSmoRA0I9EEtUn_5MR7acYJZILR7HEaxGrPpHXMWQH6Jx_NA97haNAQs5RdDsn1HGEA9NMe0OK9hgb4F5NEeuYXTglPX_pv1P8LxsALSLS15P6eaUEtqtC0EkoBNcHHXJ6Bs86iJOqVCsVA_gyspY3G2cH1NxuNy-P5n2N7RyQj95FzgO8CGpxSH-nXkOqDgZ5qg0g7-NQ", + "n": "AKCRTQAjSsaDshtMFdW-2Ie9yVnC5Xr1Suc06PAHINd10nXkVSB-N4TO62ClCkZV3XKnqU0nHo7o95WaZpym53W_DiO62umRtFKdl4UotL2QUh0y3SZWeWuoK2u_x2aMj17rUFN0f9GZMZ0pqEQNCPRBLVJ_-TEe2nGCWSC0exxGsRqz6R1zFkB-icfzQPe4WjQELOUXQ7J9RxhAPTTHtDivYYG-BeTRHrmF04JT1_6b9T_C8bAC0i0teT-nmlBLarQtBJKATXBx1yegbPOoiTqlQrFQP4MrKWNxtnB9Tcbjcvj-Z9je0ckI_eRc4DvAhqcUh_p15Dqg4GeaoNIO_jU", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639072745, - "updated": 1639072745, + "created": 1640018486, + "updated": 1640018486, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -138,7 +137,7 @@ "Cache-Control": "no-cache", "Content-Length": "101", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:59:05 GMT", + "Date": "Mon, 20 Dec 2021 16:41:25 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -146,7 +145,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c8eb27c6-f4c8-4e00-a891-fad69733c88e", + "x-ms-request-id": "be07c85e-6ab2-4d42-8011-c86e9b5e1495", "X-Powered-By": "ASP.NET" }, "ResponseBody": { diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_HSM.json index c8707b006c71..5f40d0bceb27 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,8 +24,8 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "4b186f4e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "0" + "x-ms-request-id": "a6e12946-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "1" }, "ResponseBody": null }, @@ -59,17 +58,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4b3e3364-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "213" + "x-ms-request-id": "a6f9b89e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "229" }, "ResponseBody": { "attributes": { - "created": 1637185362, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185362 + "updated": 1640018477 }, "key": { "e": "AQAB", @@ -81,9 +80,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/16ab8776c12f4869aed6e2d66feefc5e", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/5209c541e0224439871cfb8a12719437", "kty": "RSA-HSM", - "n": "lqNgg0oYpHpiujdvuYsW4cYaQq9iWxHKOJrwefhMuckRH0kc7cfvU6KAN0_we-hZIHwLMUNx6EZjrYy8DLSW4NoDJ1GEoAczh6x_Ax3bpUd80mjBXvRoQ0Hq8qUiVN1sW9BaIMCM47RlEQEOAr7mu3PbaXh_PI0Vv4ldFlicAQ_24XNDtvAPzr_nRvfEY0Xry0YW8XSEH6KjDWc0Ey95egoHIpkd84MgZdlW3zVONgBni54MVDhAEU3LrLbmUQqL16_l9SnW7eTA5aVeBS2Zv54BJSdBC1tfN4jxRCLpFNCYErl9PevL8EbzGICYxIxpcvUw1gu0ojR2eH82mQo4aQ" + "n": "txdIc09-rj-EHBjy45a_fYzol-56MaseZLaHzESMAegm-c7FQzk0Ke5hoJDoX75zVaPeyy83DQEbE2OrU2gZ5dhZsXLnQsbfVAtgFxAzSoy96wE9z6j_NvT2ZIzKTd8-ayfiyue744N4932P-6te8V0J4P2HjDjT3E8Fa4ChAWrclkZtkkyHnXeQPlKNkmFKyVL_PfbQA0nXVQPYcScl9XB1UzGYyCE42m85F2tnrotwPqQ2tFGdZI9RvRS-95xc1pmiOkO_eJuV47nqKRqlTHXEJ0wf0mEtVqJyF1OoEqmlizvAaaeJ1Wk6hmC1zT5czjDRyCGmh_kSyKR-qRSTzw" } } }, @@ -112,19 +111,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4b68c570-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a72703da-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "138" }, "ResponseBody": { "attributes": { - "created": 1637185362, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185362 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018477, "key": { "e": "AQAB", "key_ops": [ @@ -135,12 +134,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/16ab8776c12f4869aed6e2d66feefc5e", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/5209c541e0224439871cfb8a12719437", "kty": "RSA-HSM", - "n": "lqNgg0oYpHpiujdvuYsW4cYaQq9iWxHKOJrwefhMuckRH0kc7cfvU6KAN0_we-hZIHwLMUNx6EZjrYy8DLSW4NoDJ1GEoAczh6x_Ax3bpUd80mjBXvRoQ0Hq8qUiVN1sW9BaIMCM47RlEQEOAr7mu3PbaXh_PI0Vv4ldFlicAQ_24XNDtvAPzr_nRvfEY0Xry0YW8XSEH6KjDWc0Ey95egoHIpkd84MgZdlW3zVONgBni54MVDhAEU3LrLbmUQqL16_l9SnW7eTA5aVeBS2Zv54BJSdBC1tfN4jxRCLpFNCYErl9PevL8EbzGICYxIxpcvUw1gu0ojR2eH82mQo4aQ" + "n": "txdIc09-rj-EHBjy45a_fYzol-56MaseZLaHzESMAegm-c7FQzk0Ke5hoJDoX75zVaPeyy83DQEbE2OrU2gZ5dhZsXLnQsbfVAtgFxAzSoy96wE9z6j_NvT2ZIzKTd8-ayfiyue744N4932P-6te8V0J4P2HjDjT3E8Fa4ChAWrclkZtkkyHnXeQPlKNkmFKyVL_PfbQA0nXVQPYcScl9XB1UzGYyCE42m85F2tnrotwPqQ2tFGdZI9RvRS-95xc1pmiOkO_eJuV47nqKRqlTHXEJ0wf0mEtVqJyF1OoEqmlizvAaaeJ1Wk6hmC1zT5czjDRyCGmh_kSyKR-qRSTzw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key02135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623277 } }, { @@ -166,22 +165,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4b87f8e6-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "37" + "x-ms-request-id": "a74713f0-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "35" }, "ResponseBody": { "attributes": { - "created": 1637185362, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185362 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018477, "key": { "e": "AQAB", "key_ops": [ @@ -192,12 +191,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/16ab8776c12f4869aed6e2d66feefc5e", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/5209c541e0224439871cfb8a12719437", "kty": "RSA-HSM", - "n": "lqNgg0oYpHpiujdvuYsW4cYaQq9iWxHKOJrwefhMuckRH0kc7cfvU6KAN0_we-hZIHwLMUNx6EZjrYy8DLSW4NoDJ1GEoAczh6x_Ax3bpUd80mjBXvRoQ0Hq8qUiVN1sW9BaIMCM47RlEQEOAr7mu3PbaXh_PI0Vv4ldFlicAQ_24XNDtvAPzr_nRvfEY0Xry0YW8XSEH6KjDWc0Ey95egoHIpkd84MgZdlW3zVONgBni54MVDhAEU3LrLbmUQqL16_l9SnW7eTA5aVeBS2Zv54BJSdBC1tfN4jxRCLpFNCYErl9PevL8EbzGICYxIxpcvUw1gu0ojR2eH82mQo4aQ" + "n": "txdIc09-rj-EHBjy45a_fYzol-56MaseZLaHzESMAegm-c7FQzk0Ke5hoJDoX75zVaPeyy83DQEbE2OrU2gZ5dhZsXLnQsbfVAtgFxAzSoy96wE9z6j_NvT2ZIzKTd8-ayfiyue744N4932P-6te8V0J4P2HjDjT3E8Fa4ChAWrclkZtkkyHnXeQPlKNkmFKyVL_PfbQA0nXVQPYcScl9XB1UzGYyCE42m85F2tnrotwPqQ2tFGdZI9RvRS-95xc1pmiOkO_eJuV47nqKRqlTHXEJ0wf0mEtVqJyF1OoEqmlizvAaaeJ1Wk6hmC1zT5czjDRyCGmh_kSyKR-qRSTzw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key02135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623277 } }, { @@ -223,22 +222,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4b97c38e-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a756b878-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "33" }, "ResponseBody": { "attributes": { - "created": 1637185362, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185362 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018477, "key": { "e": "AQAB", "key_ops": [ @@ -249,12 +248,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/16ab8776c12f4869aed6e2d66feefc5e", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235/5209c541e0224439871cfb8a12719437", "kty": "RSA-HSM", - "n": "lqNgg0oYpHpiujdvuYsW4cYaQq9iWxHKOJrwefhMuckRH0kc7cfvU6KAN0_we-hZIHwLMUNx6EZjrYy8DLSW4NoDJ1GEoAczh6x_Ax3bpUd80mjBXvRoQ0Hq8qUiVN1sW9BaIMCM47RlEQEOAr7mu3PbaXh_PI0Vv4ldFlicAQ_24XNDtvAPzr_nRvfEY0Xry0YW8XSEH6KjDWc0Ey95egoHIpkd84MgZdlW3zVONgBni54MVDhAEU3LrLbmUQqL16_l9SnW7eTA5aVeBS2Zv54BJSdBC1tfN4jxRCLpFNCYErl9PevL8EbzGICYxIxpcvUw1gu0ojR2eH82mQo4aQ" + "n": "txdIc09-rj-EHBjy45a_fYzol-56MaseZLaHzESMAegm-c7FQzk0Ke5hoJDoX75zVaPeyy83DQEbE2OrU2gZ5dhZsXLnQsbfVAtgFxAzSoy96wE9z6j_NvT2ZIzKTd8-ayfiyue744N4932P-6te8V0J4P2HjDjT3E8Fa4ChAWrclkZtkkyHnXeQPlKNkmFKyVL_PfbQA0nXVQPYcScl9XB1UzGYyCE42m85F2tnrotwPqQ2tFGdZI9RvRS-95xc1pmiOkO_eJuV47nqKRqlTHXEJ0wf0mEtVqJyF1OoEqmlizvAaaeJ1Wk6hmC1zT5czjDRyCGmh_kSyKR-qRSTzw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key02135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623277 } }, { @@ -286,17 +285,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4ba6cd0c-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "212" + "x-ms-request-id": "a7663578-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "242" }, "ResponseBody": { "attributes": { - "created": 1637185363, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185363 + "updated": 1640018477 }, "key": { "e": "AQAB", @@ -308,9 +307,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/3d0dfb5651820745ab3eea4b86a958bf", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/6eb8172f52930d9a0f097ebf227b41b3", "kty": "RSA-HSM", - "n": "tMsO3o105Ijx7sBYXfb6JgxqIszK9hHHN8fecDpWn5o7VY73SjLHOXrKzY1ATPdQP7_O8ftXwDFHera79DoDZ-3ypgvRlmunMzGtnVtVGR8J-uTWXAXpOmAks_kIiqI4G7bMmMzoAxPU7C-y4_qJz4QXi3CFYdYsR-VAJ2vwvYVgb6HScP_RMF9A6y941Mq8QyhjCVodF4UugOovcxZZfTPMFBHG66WSCSvQ06GJQvRWgh6k9EpvHmky4_Kf9L8Xdy1v-8iq0Aq-YMOKV5HYJqsqdd6Wu6nnfkTsbliLvr8wfozbHR7_XEKFeJlBpIZuWQNT3PVFhHj8eHgdYsj_Ow" + "n": "ijHx3BoHtsqQ3B0OfDgfa11Zkd7NnrogHrXippTS7d0X_sVjMgc5xJpTWT_TFXZOd5wYW90elxWCAMYUo5oHtFCFt7lHThVx0chl0R5M2iqRNKmh73-3xvmB-4oUNyHA1cpHyEQ6_2_stTeyjv33Q5k5Wt71R8BGr1QJfQWq3huH613DFUS6rEgM2kgwtBLmUe77FkzkTvalHzeUvucvR7Yt6Ce04Ikyr0iZbyzKNt6fnD02IeK1YsZ_EFAPvqdMrfiZjs5_dcXvU4esdPoH7BN49wlIl0W-PjiqgNcKwvvuUk6zq0UVmu-o0NVHIfX3ynyZszDv7s61n3C2HiVZAw" } } }, @@ -339,19 +338,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4bd1be4a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "151" + "x-ms-request-id": "a79587ba-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "146" }, "ResponseBody": { "attributes": { - "created": 1637185363, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185363 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018478, "key": { "e": "AQAB", "key_ops": [ @@ -362,12 +361,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/3d0dfb5651820745ab3eea4b86a958bf", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/6eb8172f52930d9a0f097ebf227b41b3", "kty": "RSA-HSM", - "n": "tMsO3o105Ijx7sBYXfb6JgxqIszK9hHHN8fecDpWn5o7VY73SjLHOXrKzY1ATPdQP7_O8ftXwDFHera79DoDZ-3ypgvRlmunMzGtnVtVGR8J-uTWXAXpOmAks_kIiqI4G7bMmMzoAxPU7C-y4_qJz4QXi3CFYdYsR-VAJ2vwvYVgb6HScP_RMF9A6y941Mq8QyhjCVodF4UugOovcxZZfTPMFBHG66WSCSvQ06GJQvRWgh6k9EpvHmky4_Kf9L8Xdy1v-8iq0Aq-YMOKV5HYJqsqdd6Wu6nnfkTsbliLvr8wfozbHR7_XEKFeJlBpIZuWQNT3PVFhHj8eHgdYsj_Ow" + "n": "ijHx3BoHtsqQ3B0OfDgfa11Zkd7NnrogHrXippTS7d0X_sVjMgc5xJpTWT_TFXZOd5wYW90elxWCAMYUo5oHtFCFt7lHThVx0chl0R5M2iqRNKmh73-3xvmB-4oUNyHA1cpHyEQ6_2_stTeyjv33Q5k5Wt71R8BGr1QJfQWq3huH613DFUS6rEgM2kgwtBLmUe77FkzkTvalHzeUvucvR7Yt6Ce04Ikyr0iZbyzKNt6fnD02IeK1YsZ_EFAPvqdMrfiZjs5_dcXvU4esdPoH7BN49wlIl0W-PjiqgNcKwvvuUk6zq0UVmu-o0NVHIfX3ynyZszDv7s61n3C2HiVZAw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key12135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623278 } }, { @@ -393,22 +392,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4bf2de68-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "108" + "x-ms-request-id": "a7b6387a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "36" }, "ResponseBody": { "attributes": { - "created": 1637185363, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185363 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018478, "key": { "e": "AQAB", "key_ops": [ @@ -419,12 +418,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/3d0dfb5651820745ab3eea4b86a958bf", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/6eb8172f52930d9a0f097ebf227b41b3", "kty": "RSA-HSM", - "n": "tMsO3o105Ijx7sBYXfb6JgxqIszK9hHHN8fecDpWn5o7VY73SjLHOXrKzY1ATPdQP7_O8ftXwDFHera79DoDZ-3ypgvRlmunMzGtnVtVGR8J-uTWXAXpOmAks_kIiqI4G7bMmMzoAxPU7C-y4_qJz4QXi3CFYdYsR-VAJ2vwvYVgb6HScP_RMF9A6y941Mq8QyhjCVodF4UugOovcxZZfTPMFBHG66WSCSvQ06GJQvRWgh6k9EpvHmky4_Kf9L8Xdy1v-8iq0Aq-YMOKV5HYJqsqdd6Wu6nnfkTsbliLvr8wfozbHR7_XEKFeJlBpIZuWQNT3PVFhHj8eHgdYsj_Ow" + "n": "ijHx3BoHtsqQ3B0OfDgfa11Zkd7NnrogHrXippTS7d0X_sVjMgc5xJpTWT_TFXZOd5wYW90elxWCAMYUo5oHtFCFt7lHThVx0chl0R5M2iqRNKmh73-3xvmB-4oUNyHA1cpHyEQ6_2_stTeyjv33Q5k5Wt71R8BGr1QJfQWq3huH613DFUS6rEgM2kgwtBLmUe77FkzkTvalHzeUvucvR7Yt6Ce04Ikyr0iZbyzKNt6fnD02IeK1YsZ_EFAPvqdMrfiZjs5_dcXvU4esdPoH7BN49wlIl0W-PjiqgNcKwvvuUk6zq0UVmu-o0NVHIfX3ynyZszDv7s61n3C2HiVZAw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key12135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623278 } }, { @@ -450,22 +449,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4c0d79bc-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "31" + "x-ms-request-id": "a7c8308e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "38" }, "ResponseBody": { "attributes": { - "created": 1637185363, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185363 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018478, "key": { "e": "AQAB", "key_ops": [ @@ -476,12 +475,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/3d0dfb5651820745ab3eea4b86a958bf", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235/6eb8172f52930d9a0f097ebf227b41b3", "kty": "RSA-HSM", - "n": "tMsO3o105Ijx7sBYXfb6JgxqIszK9hHHN8fecDpWn5o7VY73SjLHOXrKzY1ATPdQP7_O8ftXwDFHera79DoDZ-3ypgvRlmunMzGtnVtVGR8J-uTWXAXpOmAks_kIiqI4G7bMmMzoAxPU7C-y4_qJz4QXi3CFYdYsR-VAJ2vwvYVgb6HScP_RMF9A6y941Mq8QyhjCVodF4UugOovcxZZfTPMFBHG66WSCSvQ06GJQvRWgh6k9EpvHmky4_Kf9L8Xdy1v-8iq0Aq-YMOKV5HYJqsqdd6Wu6nnfkTsbliLvr8wfozbHR7_XEKFeJlBpIZuWQNT3PVFhHj8eHgdYsj_Ow" + "n": "ijHx3BoHtsqQ3B0OfDgfa11Zkd7NnrogHrXippTS7d0X_sVjMgc5xJpTWT_TFXZOd5wYW90elxWCAMYUo5oHtFCFt7lHThVx0chl0R5M2iqRNKmh73-3xvmB-4oUNyHA1cpHyEQ6_2_stTeyjv33Q5k5Wt71R8BGr1QJfQWq3huH613DFUS6rEgM2kgwtBLmUe77FkzkTvalHzeUvucvR7Yt6Ce04Ikyr0iZbyzKNt6fnD02IeK1YsZ_EFAPvqdMrfiZjs5_dcXvU4esdPoH7BN49wlIl0W-PjiqgNcKwvvuUk6zq0UVmu-o0NVHIfX3ynyZszDv7s61n3C2HiVZAw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key12135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623278 } }, { @@ -513,17 +512,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4c1c711a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "198" + "x-ms-request-id": "a7d9562a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "224" }, "ResponseBody": { "attributes": { - "created": 1637185364, + "created": 1640018478, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185364 + "updated": 1640018478 }, "key": { "e": "AQAB", @@ -535,9 +534,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/f3bd23a1d28544d0af7a781ce213815d", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/400246c0117f4e990fb588af6c510bef", "kty": "RSA-HSM", - "n": "34PkaVL7qWXjbr7tRYgbsVUGqWqmosEu5McL4eV-46ZO5Lj8s8vHV1gc_0qR1R23UpH1NnFoziX6cdpnZg2KVNTQTSlpFBTxzNr1l6mOaj_4qkFRuNPnke3NnvY9ybf5bsDIgWdse8IYC28WdyGjSYYPLxPmUcP0o1tHY5h7kG80W2iOWZyJwdftfqt80a4B19H5526ftguDwhIYeOU-EKoQKYMhsXdGKuIIKjASPNQkosj4LT0Ry2teowxmXqwpDuNoMTDsOYiNVQJZPJZd5zgfTQDeBXnibobl6ttTdv3OjBfT_9Tc8M6Quzz84PGVZyMSm6NU6t_bg5hdBr7d5w" + "n": "xtprfEtPd0sZC7u9rqNXPizWQXggSC7H5NzprwyMsMc5eDYpUOnJdfeNC-DhPduIpAF4L1b8LCND4oqc-K8It1mBuqeKGkqhGfTchZmsOhPDtTKhUTZIjA6KKy88m-1mJov5wiXnipGlmtg29j5adxpBJgXU97y5Hwo3Q9qmTrNZiTXs7-yNL_NxElP5uqMOjY3UAcQQE3-wbX4gTIJrSAw86ZCoyFpJUnyxbWrkIsBDekwCCRaaf0h1j9IqHCS5DzCeNSQ_YlP9tRJNdEzj5NvaqbohRrtqb8j4_FlFAW54GEUAO5m4x6mo0vaVNwhj0__ZMTBp-llGfRgsQ-9Wnw" } } }, @@ -566,19 +565,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4c44ccfa-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "137" + "x-ms-request-id": "a805e258-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "139" }, "ResponseBody": { "attributes": { - "created": 1637185364, + "created": 1640018478, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185364 + "updated": 1640018478 }, - "deletedDate": 1637185364, + "deletedDate": 1640018478, "key": { "e": "AQAB", "key_ops": [ @@ -589,12 +588,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/f3bd23a1d28544d0af7a781ce213815d", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/400246c0117f4e990fb588af6c510bef", "kty": "RSA-HSM", - "n": "34PkaVL7qWXjbr7tRYgbsVUGqWqmosEu5McL4eV-46ZO5Lj8s8vHV1gc_0qR1R23UpH1NnFoziX6cdpnZg2KVNTQTSlpFBTxzNr1l6mOaj_4qkFRuNPnke3NnvY9ybf5bsDIgWdse8IYC28WdyGjSYYPLxPmUcP0o1tHY5h7kG80W2iOWZyJwdftfqt80a4B19H5526ftguDwhIYeOU-EKoQKYMhsXdGKuIIKjASPNQkosj4LT0Ry2teowxmXqwpDuNoMTDsOYiNVQJZPJZd5zgfTQDeBXnibobl6ttTdv3OjBfT_9Tc8M6Quzz84PGVZyMSm6NU6t_bg5hdBr7d5w" + "n": "xtprfEtPd0sZC7u9rqNXPizWQXggSC7H5NzprwyMsMc5eDYpUOnJdfeNC-DhPduIpAF4L1b8LCND4oqc-K8It1mBuqeKGkqhGfTchZmsOhPDtTKhUTZIjA6KKy88m-1mJov5wiXnipGlmtg29j5adxpBJgXU97y5Hwo3Q9qmTrNZiTXs7-yNL_NxElP5uqMOjY3UAcQQE3-wbX4gTIJrSAw86ZCoyFpJUnyxbWrkIsBDekwCCRaaf0h1j9IqHCS5DzCeNSQ_YlP9tRJNdEzj5NvaqbohRrtqb8j4_FlFAW54GEUAO5m4x6mo0vaVNwhj0__ZMTBp-llGfRgsQ-9Wnw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key22135889235", - "scheduledPurgeDate": 1637790164 + "scheduledPurgeDate": 1640623278 } }, { @@ -620,22 +619,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4c63e004-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "37" + "x-ms-request-id": "a825958a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "36" }, "ResponseBody": { "attributes": { - "created": 1637185364, + "created": 1640018478, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185364 + "updated": 1640018478 }, - "deletedDate": 1637185364, + "deletedDate": 1640018478, "key": { "e": "AQAB", "key_ops": [ @@ -646,12 +645,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/f3bd23a1d28544d0af7a781ce213815d", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/400246c0117f4e990fb588af6c510bef", "kty": "RSA-HSM", - "n": "34PkaVL7qWXjbr7tRYgbsVUGqWqmosEu5McL4eV-46ZO5Lj8s8vHV1gc_0qR1R23UpH1NnFoziX6cdpnZg2KVNTQTSlpFBTxzNr1l6mOaj_4qkFRuNPnke3NnvY9ybf5bsDIgWdse8IYC28WdyGjSYYPLxPmUcP0o1tHY5h7kG80W2iOWZyJwdftfqt80a4B19H5526ftguDwhIYeOU-EKoQKYMhsXdGKuIIKjASPNQkosj4LT0Ry2teowxmXqwpDuNoMTDsOYiNVQJZPJZd5zgfTQDeBXnibobl6ttTdv3OjBfT_9Tc8M6Quzz84PGVZyMSm6NU6t_bg5hdBr7d5w" + "n": "xtprfEtPd0sZC7u9rqNXPizWQXggSC7H5NzprwyMsMc5eDYpUOnJdfeNC-DhPduIpAF4L1b8LCND4oqc-K8It1mBuqeKGkqhGfTchZmsOhPDtTKhUTZIjA6KKy88m-1mJov5wiXnipGlmtg29j5adxpBJgXU97y5Hwo3Q9qmTrNZiTXs7-yNL_NxElP5uqMOjY3UAcQQE3-wbX4gTIJrSAw86ZCoyFpJUnyxbWrkIsBDekwCCRaaf0h1j9IqHCS5DzCeNSQ_YlP9tRJNdEzj5NvaqbohRrtqb8j4_FlFAW54GEUAO5m4x6mo0vaVNwhj0__ZMTBp-llGfRgsQ-9Wnw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key22135889235", - "scheduledPurgeDate": 1637790164 + "scheduledPurgeDate": 1640623278 } }, { @@ -677,22 +676,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4c7398e6-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a8355cd6-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "34" }, "ResponseBody": { "attributes": { - "created": 1637185364, + "created": 1640018478, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185364 + "updated": 1640018478 }, - "deletedDate": 1637185364, + "deletedDate": 1640018478, "key": { "e": "AQAB", "key_ops": [ @@ -703,12 +702,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/f3bd23a1d28544d0af7a781ce213815d", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235/400246c0117f4e990fb588af6c510bef", "kty": "RSA-HSM", - "n": "34PkaVL7qWXjbr7tRYgbsVUGqWqmosEu5McL4eV-46ZO5Lj8s8vHV1gc_0qR1R23UpH1NnFoziX6cdpnZg2KVNTQTSlpFBTxzNr1l6mOaj_4qkFRuNPnke3NnvY9ybf5bsDIgWdse8IYC28WdyGjSYYPLxPmUcP0o1tHY5h7kG80W2iOWZyJwdftfqt80a4B19H5526ftguDwhIYeOU-EKoQKYMhsXdGKuIIKjASPNQkosj4LT0Ry2teowxmXqwpDuNoMTDsOYiNVQJZPJZd5zgfTQDeBXnibobl6ttTdv3OjBfT_9Tc8M6Quzz84PGVZyMSm6NU6t_bg5hdBr7d5w" + "n": "xtprfEtPd0sZC7u9rqNXPizWQXggSC7H5NzprwyMsMc5eDYpUOnJdfeNC-DhPduIpAF4L1b8LCND4oqc-K8It1mBuqeKGkqhGfTchZmsOhPDtTKhUTZIjA6KKy88m-1mJov5wiXnipGlmtg29j5adxpBJgXU97y5Hwo3Q9qmTrNZiTXs7-yNL_NxElP5uqMOjY3UAcQQE3-wbX4gTIJrSAw86ZCoyFpJUnyxbWrkIsBDekwCCRaaf0h1j9IqHCS5DzCeNSQ_YlP9tRJNdEzj5NvaqbohRrtqb8j4_FlFAW54GEUAO5m4x6mo0vaVNwhj0__ZMTBp-llGfRgsQ-9Wnw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key22135889235", - "scheduledPurgeDate": 1637790164 + "scheduledPurgeDate": 1640623278 } }, { @@ -734,55 +733,55 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4c82e5e4-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a844eba6-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "33" }, "ResponseBody": { "value": [ { "attributes": { - "created": 1637185362, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185362 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018477, "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235", "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key02135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623277 }, { "attributes": { - "created": 1637185363, + "created": 1640018477, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185363 + "updated": 1640018477 }, - "deletedDate": 1637185363, + "deletedDate": 1640018478, "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235", "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key12135889235", - "scheduledPurgeDate": 1637790163 + "scheduledPurgeDate": 1640623278 }, { "attributes": { - "created": 1637185364, + "created": 1640018478, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185364 + "updated": 1640018478 }, - "deletedDate": 1637185364, + "deletedDate": 1640018478, "kid": "https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235", "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/list-del-key22135889235", - "scheduledPurgeDate": 1637790164 + "scheduledPurgeDate": 1640623278 } ] } @@ -810,13 +809,13 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "4c92853a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "16" + "x-ms-request-id": "a866e1fc-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "19" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235 (Activity ID: 4c92853a-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/list-del-key22135889235 (Activity ID: a866e1fc-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -843,13 +842,13 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "4c9ecfb6-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "35" + "x-ms-request-id": "a876240a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "17" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235 (Activity ID: 4c9ecfb6-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/list-del-key12135889235 (Activity ID: a876240a-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -876,13 +875,13 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "4cae5c06-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "17" + "x-ms-request-id": "a885f1d2-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "19" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235 (Activity ID: 4cae5c06-47ef-11ec-bf7c-000d3a5f7959)" + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/list-del-key02135889235 (Activity ID: a885f1d2-61b3-11ec-985f-000d3aec06d7)" } } } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_NON-HSM.json index 092bff706211..14d8881874cd 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestListDeletedKeys/TestListDeletedKeys_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:33 GMT", + "Date": "Mon, 20 Dec 2021 16:41:11 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -28,8 +27,8 @@ "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "475d7090-7f4c-4df2-8457-ca10e15bbb89", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "27e4cc2b-73c9-4134-9138-b9697b721098", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,20 +61,20 @@ "Cache-Control": "no-cache", "Content-Length": "696", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:34 GMT", + "Date": "Mon, 20 Dec 2021 16:41:12 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4a6a92f2-17ae-4828-80e3-163c088a533c", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "23678021-2811-4a89-bbae-87469cf990c9", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key0762797297/3d1eefe673314d56bd3dc34aaa379890", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key0762797297/88536f5d197043a882ae52dba728a6e4", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "oAzsr4xImCuxtN81CGTyD8scCNjzr8941l-jInC9U1ybcQWxzIP3LEUMsJIyIvmv05cyVdv2FbFw5Xo6qxvy94CUUJZnJk7_MWm3xGxUfpgFG1kCL6kYl6Q-6h5ctdCwrS0RnQCMjedP7oIUnrjAfRn8a4Bh9210bIpFSRsRuKVcD-MknbvAt9dPk487DMfU6MbYMojLuQ-Phv0wCTOPibkIe7-16w4DWfEkRrut8zknTtz8nv4GE2Y66kpF1Z0Fbu6sFJpjytur21axazaiA6K7y13K_zjOu8Ed05by3JMOrCeOLTja2ywAwVj0bUuIUeFP3Hj1yGG6rAz1lBH7IQ", + "n": "3mQG--a7zgwO5AN6_lDWf2EPLa0zy8mlOn1fpauISLOFwKgEdttEePgHMvKV8RpaJInfrACT4wBz7e94860-34kEZM8PXwZ-8VwEDxAycGmkpwW8b-0lu54dfEG0UcuxwKIAu_85s0S4zqCAXPL4fy3CKIZsuybTMkpp8EOxMrQwLJ9_BBAt64OzfaZdaSbrtGx-FUvRlzHTDOlTrGjyMfCFK7YtZzj1Wyw7FyECz17IsuGrCZkMtJrf3pO7SDbQP5AYb3r3BeJGraqle8whvcXga4t_Cj44rFMnyYppsv4K0VAYQcmCPw4e0tMwriuTEnuey1lTcDB3H70Y6XX4dQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185354, - "updated": 1637185354, + "created": 1640018472, + "updated": 1640018472, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -116,23 +115,23 @@ "Cache-Control": "no-cache", "Content-Length": "837", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:34 GMT", + "Date": "Mon, 20 Dec 2021 16:41:12 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "dfb49a37-2a97-4020-899f-a8ed469aaf55", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "69dfb3bd-78eb-42fc-b950-c94e56b22936", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key0762797297", - "deletedDate": 1637185355, - "scheduledPurgeDate": 1637790155, + "deletedDate": 1640018472, + "scheduledPurgeDate": 1640623272, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key0762797297/3d1eefe673314d56bd3dc34aaa379890", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key0762797297/88536f5d197043a882ae52dba728a6e4", "kty": "RSA", "key_ops": [ "encrypt", @@ -142,13 +141,13 @@ "wrapKey", "unwrapKey" ], - "n": "oAzsr4xImCuxtN81CGTyD8scCNjzr8941l-jInC9U1ybcQWxzIP3LEUMsJIyIvmv05cyVdv2FbFw5Xo6qxvy94CUUJZnJk7_MWm3xGxUfpgFG1kCL6kYl6Q-6h5ctdCwrS0RnQCMjedP7oIUnrjAfRn8a4Bh9210bIpFSRsRuKVcD-MknbvAt9dPk487DMfU6MbYMojLuQ-Phv0wCTOPibkIe7-16w4DWfEkRrut8zknTtz8nv4GE2Y66kpF1Z0Fbu6sFJpjytur21axazaiA6K7y13K_zjOu8Ed05by3JMOrCeOLTja2ywAwVj0bUuIUeFP3Hj1yGG6rAz1lBH7IQ", + "n": "3mQG--a7zgwO5AN6_lDWf2EPLa0zy8mlOn1fpauISLOFwKgEdttEePgHMvKV8RpaJInfrACT4wBz7e94860-34kEZM8PXwZ-8VwEDxAycGmkpwW8b-0lu54dfEG0UcuxwKIAu_85s0S4zqCAXPL4fy3CKIZsuybTMkpp8EOxMrQwLJ9_BBAt64OzfaZdaSbrtGx-FUvRlzHTDOlTrGjyMfCFK7YtZzj1Wyw7FyECz17IsuGrCZkMtJrf3pO7SDbQP5AYb3r3BeJGraqle8whvcXga4t_Cj44rFMnyYppsv4K0VAYQcmCPw4e0tMwriuTEnuey1lTcDB3H70Y6XX4dQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185354, - "updated": 1637185354, + "created": 1640018472, + "updated": 1640018472, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -173,15 +172,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:34 GMT", + "Date": "Mon, 20 Dec 2021 16:41:12 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "6dd8ba5e-f977-4e79-b92a-fe268f56314c", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "69318c87-216f-4216-bcbd-f730aa3c1a21", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -210,15 +209,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:34 GMT", + "Date": "Mon, 20 Dec 2021 16:41:12 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "33d29a8a-bf4f-40da-b94b-8f94ee82dd22", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "ae8cf5ca-5edc-4f55-b65b-f39c4c988731", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -247,15 +246,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:34 GMT", + "Date": "Mon, 20 Dec 2021 16:41:12 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "316225b5-d9f5-46c9-baf1-0e52d6847a10", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "2cccfc26-0839-40bd-86fd-4df467d01f0d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -284,52 +283,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:41:13 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "303abad2-f31c-4ceb-8a13-1ec98fe89b9c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key0762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key0762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key0762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:36 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "3003e9cd-4eb1-4b89-80c7-71f449583af8", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "0f997c49-adef-4a1f-adbd-bd01404379b7", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -358,23 +320,23 @@ "Cache-Control": "no-cache", "Content-Length": "837", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:41:13 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "6c2be53e-f92a-4b4d-8620-47c425d32b7a", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "2debe8dd-8e8a-4ee1-a574-b912631b3063", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key0762797297", - "deletedDate": 1637185355, - "scheduledPurgeDate": 1637790155, + "deletedDate": 1640018472, + "scheduledPurgeDate": 1640623272, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key0762797297/3d1eefe673314d56bd3dc34aaa379890", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key0762797297/88536f5d197043a882ae52dba728a6e4", "kty": "RSA", "key_ops": [ "encrypt", @@ -384,13 +346,13 @@ "wrapKey", "unwrapKey" ], - "n": "oAzsr4xImCuxtN81CGTyD8scCNjzr8941l-jInC9U1ybcQWxzIP3LEUMsJIyIvmv05cyVdv2FbFw5Xo6qxvy94CUUJZnJk7_MWm3xGxUfpgFG1kCL6kYl6Q-6h5ctdCwrS0RnQCMjedP7oIUnrjAfRn8a4Bh9210bIpFSRsRuKVcD-MknbvAt9dPk487DMfU6MbYMojLuQ-Phv0wCTOPibkIe7-16w4DWfEkRrut8zknTtz8nv4GE2Y66kpF1Z0Fbu6sFJpjytur21axazaiA6K7y13K_zjOu8Ed05by3JMOrCeOLTja2ywAwVj0bUuIUeFP3Hj1yGG6rAz1lBH7IQ", + "n": "3mQG--a7zgwO5AN6_lDWf2EPLa0zy8mlOn1fpauISLOFwKgEdttEePgHMvKV8RpaJInfrACT4wBz7e94860-34kEZM8PXwZ-8VwEDxAycGmkpwW8b-0lu54dfEG0UcuxwKIAu_85s0S4zqCAXPL4fy3CKIZsuybTMkpp8EOxMrQwLJ9_BBAt64OzfaZdaSbrtGx-FUvRlzHTDOlTrGjyMfCFK7YtZzj1Wyw7FyECz17IsuGrCZkMtJrf3pO7SDbQP5AYb3r3BeJGraqle8whvcXga4t_Cj44rFMnyYppsv4K0VAYQcmCPw4e0tMwriuTEnuey1lTcDB3H70Y6XX4dQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185354, - "updated": 1637185354, + "created": 1640018472, + "updated": 1640018472, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -419,20 +381,20 @@ "Cache-Control": "no-cache", "Content-Length": "696", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:36 GMT", + "Date": "Mon, 20 Dec 2021 16:41:13 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "3cea38dd-ff0b-4b5e-8db4-4c23565733ea", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "fa238af3-3508-4fd2-ab45-a2e30bfa1235", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key1762797297/276ae045b3e948059ecaee7d81ef9044", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key1762797297/8d6e8303c73a4256afd808668eba11e7", "kty": "RSA", "key_ops": [ "encrypt", @@ -442,13 +404,13 @@ "wrapKey", "unwrapKey" ], - "n": "ttMgddzvZrZ5dFvPa_PQr9f2VJsNHSnWeVf4YbzbNbza9vKJCaDe3k2q2j2IwLBmVbtA26fqFxv42cqHVTaAoBaIDa0-wUPUTLRCmC-Vysabv2hWn-h1Ft68kb8NTNahYYFZ9fqG1R4QOyo4he7-gAd_32u0hUzubgqjc01J9m_bxNAPfbf1KmYOVVjpTRw1wqM0pwqCUYokGGcaL9PD8k1uNohJ0dlrM6Hac_PnxhryjDx1AZ9tgMRSGJJwVN9Arx_ZttxBdRAn09VmGtdtp5V0LqUmr5IiqJhzn3hK4KsihWVo5BouthM_i8lnpPXJdg0RvzqGfMwJu3TMj1QOsQ", + "n": "5b0DEq3rbnuduKpELIBTwfGivmoTPQwmrrJ7eg2sko0JJptn5td_hLZVQ9ZPevw8GEBXI385HcF_FgTWPN7HEsc3wyERaCyqa1O8hzGj2CFQfsSE9DGbc85xr3btNF4qbE_iLFA2g4GaXDoMmzNWPw3-SL_1_AMP2CSBKhA114ZTkOrWsh7S5JOj5FkqqlHs0hWvLnXpwH3c-2Cxm-kkiEWY_FIE_cSBwf-kGNZXlS1lxWyJDuwIcJpbuzEwYvmqUJH7VKbmOdt6nl573z4DDJ0SszHzQC6PYcaxW0kkNHHRCqx8lg_kVfOfheP8VSOKoo7bLGB24n6KuT8aNIHJkQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185356, - "updated": 1637185356, + "created": 1640018474, + "updated": 1640018474, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -473,23 +435,23 @@ "Cache-Control": "no-cache", "Content-Length": "837", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:37 GMT", + "Date": "Mon, 20 Dec 2021 16:41:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "49a10e9c-d942-4661-adcb-b7aaef898ce8", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "4a497e39-6b0e-4f0a-bfba-c8ed578d6a3d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297", - "deletedDate": 1637185357, - "scheduledPurgeDate": 1637790157, + "deletedDate": 1640018474, + "scheduledPurgeDate": 1640623274, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key1762797297/276ae045b3e948059ecaee7d81ef9044", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key1762797297/8d6e8303c73a4256afd808668eba11e7", "kty": "RSA", "key_ops": [ "encrypt", @@ -499,13 +461,13 @@ "wrapKey", "unwrapKey" ], - "n": "ttMgddzvZrZ5dFvPa_PQr9f2VJsNHSnWeVf4YbzbNbza9vKJCaDe3k2q2j2IwLBmVbtA26fqFxv42cqHVTaAoBaIDa0-wUPUTLRCmC-Vysabv2hWn-h1Ft68kb8NTNahYYFZ9fqG1R4QOyo4he7-gAd_32u0hUzubgqjc01J9m_bxNAPfbf1KmYOVVjpTRw1wqM0pwqCUYokGGcaL9PD8k1uNohJ0dlrM6Hac_PnxhryjDx1AZ9tgMRSGJJwVN9Arx_ZttxBdRAn09VmGtdtp5V0LqUmr5IiqJhzn3hK4KsihWVo5BouthM_i8lnpPXJdg0RvzqGfMwJu3TMj1QOsQ", + "n": "5b0DEq3rbnuduKpELIBTwfGivmoTPQwmrrJ7eg2sko0JJptn5td_hLZVQ9ZPevw8GEBXI385HcF_FgTWPN7HEsc3wyERaCyqa1O8hzGj2CFQfsSE9DGbc85xr3btNF4qbE_iLFA2g4GaXDoMmzNWPw3-SL_1_AMP2CSBKhA114ZTkOrWsh7S5JOj5FkqqlHs0hWvLnXpwH3c-2Cxm-kkiEWY_FIE_cSBwf-kGNZXlS1lxWyJDuwIcJpbuzEwYvmqUJH7VKbmOdt6nl573z4DDJ0SszHzQC6PYcaxW0kkNHHRCqx8lg_kVfOfheP8VSOKoo7bLGB24n6KuT8aNIHJkQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185356, - "updated": 1637185356, + "created": 1640018474, + "updated": 1640018474, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -530,89 +492,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:37 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "a00fc349-f411-4996-b7fe-eb98a21cbc01", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key1762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:37 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "fcbffd59-0239-4a86-b424-79c0e571393d", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key1762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:37 GMT", + "Date": "Mon, 20 Dec 2021 16:41:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "71aa7ede-412c-4df2-8708-3a32901dde3e", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "5754e442-fa45-4bf7-82d8-379b2efe5c5f", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -641,163 +529,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:38 GMT", + "Date": "Mon, 20 Dec 2021 16:41:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "0aa0e5cd-140a-4e6a-aa2b-860715e11380", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key1762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:38 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "75c1ef6f-e9fd-4d05-97fe-07bf9897b2b9", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key1762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:38 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "980bc73b-ed06-4f1b-ad31-82ed95d3b7d0", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key1762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:39 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "9b63b844-ea2f-417d-bd86-d1e6392b1130", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key1762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key1762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:39 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "bde69737-a7c3-4743-a4c7-248c2ad21490", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "87214f94-8e7d-4e6c-b258-14c9d6b92949", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -826,23 +566,23 @@ "Cache-Control": "no-cache", "Content-Length": "837", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:39 GMT", + "Date": "Mon, 20 Dec 2021 16:41:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "62857d74-a7d6-44c0-bd79-e4d73ace7477", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "8a489c02-29b9-491f-95e4-4d8c1af63389", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key1762797297", - "deletedDate": 1637185357, - "scheduledPurgeDate": 1637790157, + "deletedDate": 1640018474, + "scheduledPurgeDate": 1640623274, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key1762797297/276ae045b3e948059ecaee7d81ef9044", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key1762797297/8d6e8303c73a4256afd808668eba11e7", "kty": "RSA", "key_ops": [ "encrypt", @@ -852,13 +592,13 @@ "wrapKey", "unwrapKey" ], - "n": "ttMgddzvZrZ5dFvPa_PQr9f2VJsNHSnWeVf4YbzbNbza9vKJCaDe3k2q2j2IwLBmVbtA26fqFxv42cqHVTaAoBaIDa0-wUPUTLRCmC-Vysabv2hWn-h1Ft68kb8NTNahYYFZ9fqG1R4QOyo4he7-gAd_32u0hUzubgqjc01J9m_bxNAPfbf1KmYOVVjpTRw1wqM0pwqCUYokGGcaL9PD8k1uNohJ0dlrM6Hac_PnxhryjDx1AZ9tgMRSGJJwVN9Arx_ZttxBdRAn09VmGtdtp5V0LqUmr5IiqJhzn3hK4KsihWVo5BouthM_i8lnpPXJdg0RvzqGfMwJu3TMj1QOsQ", + "n": "5b0DEq3rbnuduKpELIBTwfGivmoTPQwmrrJ7eg2sko0JJptn5td_hLZVQ9ZPevw8GEBXI385HcF_FgTWPN7HEsc3wyERaCyqa1O8hzGj2CFQfsSE9DGbc85xr3btNF4qbE_iLFA2g4GaXDoMmzNWPw3-SL_1_AMP2CSBKhA114ZTkOrWsh7S5JOj5FkqqlHs0hWvLnXpwH3c-2Cxm-kkiEWY_FIE_cSBwf-kGNZXlS1lxWyJDuwIcJpbuzEwYvmqUJH7VKbmOdt6nl573z4DDJ0SszHzQC6PYcaxW0kkNHHRCqx8lg_kVfOfheP8VSOKoo7bLGB24n6KuT8aNIHJkQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185356, - "updated": 1637185356, + "created": 1640018474, + "updated": 1640018474, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -887,20 +627,20 @@ "Cache-Control": "no-cache", "Content-Length": "696", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:40 GMT", + "Date": "Mon, 20 Dec 2021 16:41:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "cec1298d-21fb-4ccf-9173-99f24ce7ba9f", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "5dcedc4b-20fa-4263-887e-4a1806d8221a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key2762797297/1f096d055aac45f4b1cfa0941f01f97c", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key2762797297/625f2706806e48cf999119b2755d5f44", "kty": "RSA", "key_ops": [ "encrypt", @@ -910,13 +650,13 @@ "wrapKey", "unwrapKey" ], - "n": "uMkLNBfc7_G5UGR1lYbs3eILPOsJpxaYlA8Z5m8nmDxwKAUT1kMnxi-WGtlQbR2WiE1-kPHtnOd5p5SMAizqXIx0oikr-C0phPZixqWL3KHcRZaqP367m4gDMwFTFsWgZzuahK698ClQv6YajGJQGse4l2hPZC-QtA4ZKtTkoWKgESsbvY2f5RNKBWoiaDdoTapGahnla9tpNVKRkqtoBI-8BYZisCfGf4f7i202-2LcuV2zJnRkcH7m57zl1PT9ZiZkseVG5IgtDLV1MmKDgRak7rzEwga3sDh3SpZRjKNPDjcwL8MEm7j3J6oA8-_C5e2E5Zor9-D7QxwCb7lFaQ", + "n": "uamW9ffdas-WqAwv-P0Yk5v8JfXQCH5fn1_GE08YtTaxCh3bwgZHAlMLXWFtLDg6Z7Q9cmaJeLYUDYTNQNzZkUffv5f-VLrgABtQ4ah4LMp9EW3bom7jXq_LDGcACddfiKi0sYJRDtcYeUH8b7g1rKMxDKgT0MuPa5e-uSfm4xFLKkN0-YIRsO40MwODaRc1al2RgLIxwtr5ph9YNFVWjavdevehz8H8P92_i-DqTbosrR8vYfgiv9H2TWGCzBR5zoGnHDtzePpzRgKlfP02SnLlElqk76qDt85hOTSdMaoPQ10WYIzE_YMbi3GCBncu_-dwYzyT0RiG6qLFAIKeWQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185359, - "updated": 1637185359, + "created": 1640018475, + "updated": 1640018475, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -941,23 +681,23 @@ "Cache-Control": "no-cache", "Content-Length": "837", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:40 GMT", + "Date": "Mon, 20 Dec 2021 16:41:14 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "07d06878-5a26-454b-a293-d123af34371f", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "0d008f88-408d-4689-89e1-4d3d4e5d37d7", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key2762797297", - "deletedDate": 1637185360, - "scheduledPurgeDate": 1637790160, + "deletedDate": 1640018475, + "scheduledPurgeDate": 1640623275, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key2762797297/1f096d055aac45f4b1cfa0941f01f97c", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key2762797297/625f2706806e48cf999119b2755d5f44", "kty": "RSA", "key_ops": [ "encrypt", @@ -967,13 +707,13 @@ "wrapKey", "unwrapKey" ], - "n": "uMkLNBfc7_G5UGR1lYbs3eILPOsJpxaYlA8Z5m8nmDxwKAUT1kMnxi-WGtlQbR2WiE1-kPHtnOd5p5SMAizqXIx0oikr-C0phPZixqWL3KHcRZaqP367m4gDMwFTFsWgZzuahK698ClQv6YajGJQGse4l2hPZC-QtA4ZKtTkoWKgESsbvY2f5RNKBWoiaDdoTapGahnla9tpNVKRkqtoBI-8BYZisCfGf4f7i202-2LcuV2zJnRkcH7m57zl1PT9ZiZkseVG5IgtDLV1MmKDgRak7rzEwga3sDh3SpZRjKNPDjcwL8MEm7j3J6oA8-_C5e2E5Zor9-D7QxwCb7lFaQ", + "n": "uamW9ffdas-WqAwv-P0Yk5v8JfXQCH5fn1_GE08YtTaxCh3bwgZHAlMLXWFtLDg6Z7Q9cmaJeLYUDYTNQNzZkUffv5f-VLrgABtQ4ah4LMp9EW3bom7jXq_LDGcACddfiKi0sYJRDtcYeUH8b7g1rKMxDKgT0MuPa5e-uSfm4xFLKkN0-YIRsO40MwODaRc1al2RgLIxwtr5ph9YNFVWjavdevehz8H8P92_i-DqTbosrR8vYfgiv9H2TWGCzBR5zoGnHDtzePpzRgKlfP02SnLlElqk76qDt85hOTSdMaoPQ10WYIzE_YMbi3GCBncu_-dwYzyT0RiG6qLFAIKeWQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185359, - "updated": 1637185359, + "created": 1640018475, + "updated": 1640018475, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -998,89 +738,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:40 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "a4475e1d-4d40-4c2f-bb5d-9e31a28c77f9", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key2762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key2762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key2762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:40 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "89a4e45f-29cb-494d-bf62-5ea882070105", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: list-del-key2762797297" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key2762797297?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/list-del-key2762797297?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "90", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:40 GMT", + "Date": "Mon, 20 Dec 2021 16:41:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "71b9adc3-9521-4f24-9348-6cd1486b18fe", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "cfa46c63-ed74-4469-a892-cc9ca8583c93", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1109,15 +775,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "b7c28418-62aa-4e15-a199-0049d63441a7", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "192bfba1-8af1-4e32-95e9-8c0c554903a1", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1146,15 +812,15 @@ "Cache-Control": "no-cache", "Content-Length": "90", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "6b6b34ec-43d0-4a00-a4d0-a8ffaf5f6445", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "ee7d2a5b-05cc-472f-8ff1-3b74f6944f6b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1183,23 +849,23 @@ "Cache-Control": "no-cache", "Content-Length": "837", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:15 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "a2ba1c4e-4e4c-4785-92b5-36411cb93b0c", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "dc94cc52-e8e6-4957-a175-4d0b02aacbb9", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/list-del-key2762797297", - "deletedDate": 1637185360, - "scheduledPurgeDate": 1637790160, + "deletedDate": 1640018475, + "scheduledPurgeDate": 1640623275, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key2762797297/1f096d055aac45f4b1cfa0941f01f97c", + "kid": "https://fakekvurl.vault.azure.net/keys/list-del-key2762797297/625f2706806e48cf999119b2755d5f44", "kty": "RSA", "key_ops": [ "encrypt", @@ -1209,13 +875,13 @@ "wrapKey", "unwrapKey" ], - "n": "uMkLNBfc7_G5UGR1lYbs3eILPOsJpxaYlA8Z5m8nmDxwKAUT1kMnxi-WGtlQbR2WiE1-kPHtnOd5p5SMAizqXIx0oikr-C0phPZixqWL3KHcRZaqP367m4gDMwFTFsWgZzuahK698ClQv6YajGJQGse4l2hPZC-QtA4ZKtTkoWKgESsbvY2f5RNKBWoiaDdoTapGahnla9tpNVKRkqtoBI-8BYZisCfGf4f7i202-2LcuV2zJnRkcH7m57zl1PT9ZiZkseVG5IgtDLV1MmKDgRak7rzEwga3sDh3SpZRjKNPDjcwL8MEm7j3J6oA8-_C5e2E5Zor9-D7QxwCb7lFaQ", + "n": "uamW9ffdas-WqAwv-P0Yk5v8JfXQCH5fn1_GE08YtTaxCh3bwgZHAlMLXWFtLDg6Z7Q9cmaJeLYUDYTNQNzZkUffv5f-VLrgABtQ4ah4LMp9EW3bom7jXq_LDGcACddfiKi0sYJRDtcYeUH8b7g1rKMxDKgT0MuPa5e-uSfm4xFLKkN0-YIRsO40MwODaRc1al2RgLIxwtr5ph9YNFVWjavdevehz8H8P92_i-DqTbosrR8vYfgiv9H2TWGCzBR5zoGnHDtzePpzRgKlfP02SnLlElqk76qDt85hOTSdMaoPQ10WYIzE_YMbi3GCBncu_-dwYzyT0RiG6qLFAIKeWQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185359, - "updated": 1637185359, + "created": 1640018475, + "updated": 1640018475, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1240,54 +906,54 @@ "Cache-Control": "no-cache", "Content-Length": "1080", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "69cb747a-b528-48f2-b591-c842fe7b2a58", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "77186eda-1505-4cfd-b257-fbb7b2c4252d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "value": [ { "recoveryId": "https://rosebud.vault.azure.net/deletedkeys/list-del-key0762797297", - "deletedDate": 1637185355, - "scheduledPurgeDate": 1637790155, + "deletedDate": 1640018472, + "scheduledPurgeDate": 1640623272, "kid": "https://rosebud.vault.azure.net/keys/list-del-key0762797297", "attributes": { "enabled": true, - "created": 1637185354, - "updated": 1637185354, + "created": 1640018472, + "updated": 1640018472, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } }, { "recoveryId": "https://rosebud.vault.azure.net/deletedkeys/list-del-key1762797297", - "deletedDate": 1637185357, - "scheduledPurgeDate": 1637790157, + "deletedDate": 1640018474, + "scheduledPurgeDate": 1640623274, "kid": "https://rosebud.vault.azure.net/keys/list-del-key1762797297", "attributes": { "enabled": true, - "created": 1637185356, - "updated": 1637185356, + "created": 1640018474, + "updated": 1640018474, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } }, { "recoveryId": "https://rosebud.vault.azure.net/deletedkeys/list-del-key2762797297", - "deletedDate": 1637185360, - "scheduledPurgeDate": 1637790160, + "deletedDate": 1640018475, + "scheduledPurgeDate": 1640623275, "kid": "https://rosebud.vault.azure.net/keys/list-del-key2762797297", "attributes": { "enabled": true, - "created": 1637185359, - "updated": 1637185359, + "created": 1640018475, + "updated": 1640018475, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1315,15 +981,15 @@ "Cache-Control": "no-cache", "Content-Length": "310", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "52fa7942-861f-4627-b887-c0996ad6ba90", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "4a0f2557-b989-4d93-85dc-d5806a65c8d3", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1352,15 +1018,15 @@ "Cache-Control": "no-cache", "Content-Length": "310", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "e8211e4f-5553-4263-8af4-016086e54705", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "8e475b3d-10e0-4b2b-8a1d-fad575e6dd9a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1389,15 +1055,15 @@ "Cache-Control": "no-cache", "Content-Length": "310", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:16 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "fd9018f6-ad9a-414d-8d54-a493d5748746", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "53bba866-a93c-47f9-ac80-f5c8c8c6befa", "X-Powered-By": "ASP.NET" }, "ResponseBody": { diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_HSM.json index 5f0189a97b1c..5b2bd22628dd 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,8 +24,8 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "4fd6a62c-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "1" + "x-ms-request-id": "aa594e1e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "0" }, "ResponseBody": null }, @@ -59,17 +58,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4ffe4380-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "208" + "x-ms-request-id": "aa902704-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "225" }, "ResponseBody": { "attributes": { - "created": 1637185370, + "created": 1640018483, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185370 + "updated": 1640018483 }, "key": { "e": "AQAB", @@ -81,9 +80,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/03eac1f02f100080954a3b9cc5e16289", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/ddc161944abe0e1d898762c03e3dd087", "kty": "RSA-HSM", - "n": "kcks_smGS8g28DCD2pfe0k-5ujj-azByR0iZv_Djn3JG7b4b8HvaPxm85w-hYr8qsiRmWsmPmxS5dm5gjWVc8XaF_Xl7qXn5Mowh6UnyvYMkxCt68ubrjSXi22i79huwC9BJF7AaQur1Bln80smPvirBOF82FFEeMp-b-aNT-9WZ81Z9IhfOVonocbKVv0cckkKpH-j2z3Ie_SBF8IoNxBaSbtV1r096OGnpO9QyIPYPiTnYXmCKK9Fi2rWxfrbccQOSKGS7w_TCDBIKGiuBNNl-usYUo0t8sMTNpFvIxvwmzZsE3tB-NOIoYuXC2g_Um1HLGxPPlnYWWg0NPFyJvw" + "n": "rlLaB8Ndm8JCkRNDhbgQdHtSYl7UNe0YX5pMw4X_IQg_baOkhAq7JyyX8t3onGbFQsfQbla-JJNnikvTCLY2TGFIYbWAuwj4ONRTtEI3GDMVZcGUydw1-mV1X-Y6S0fyb8qJuif3IgcN-kB-r7bmbbcy-tvChfWHFCd1cdehiV2xWk22taPiYVGOIpkJ9diMmFMsDm16NkdP_mrx1ZeMA-Ha_aOOVaPB50Ul6rSgTslUKxZSwje0cIsvPuRujZIOBvoLAjkEPxWqmMEJOpPte2-bEz9vPYTEcgHOLhLYzrtRJvNH_HJcOwEQvI2NoY8CLGGQ5tIH8Si_5vsSjcL0TQ" } } }, @@ -116,17 +115,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "50285a62-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "284" + "x-ms-request-id": "aabcb684-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "303" }, "ResponseBody": { "attributes": { - "created": 1637185370, + "created": 1640018483, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185370 + "updated": 1640018483 }, "key": { "e": "AQAB", @@ -138,9 +137,9 @@ "decrypt", "unwrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/9a153530ac9b06e694629ddc81544aa6", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/1d56e2806f310d95303fb1d8279cc76f", "kty": "RSA-HSM", - "n": "tUGTFl5KghyDZ8q4Ij_l4og9hdsX3-gSjilDPR5Ns0uXRytzhcVX1GZb-Nl1yhrGxvYYTfPIodzeVT0O6nMAsalrMsjLAfh8KBP0NFJTZNs_iTsYRhCCIX2P0O2XPVg_sxxoYpkltZ7s_XQkHb8SujHjgWRscofr5i4Cm76Y4HGYxeEvDYgx3UwTxjR_NgsLlxy7TQDIDLpmATEmB84vU2f06JsYgdb-Ipy3kyjsQMCgmKyGCo-mNloxTAc9S18cKTalLLzQ1tujfu6rnu-h-_Yq01e0C02HqTjjCCqaVlJXJQdiwsid1j4OWLGutltFdDKIDMKfNpvP7ClPJYi5nw" + "n": "pTHSxrE6cRlhIRxDwOzNsLzy-LxrFQimFORGklT4Ft9H_xhUCs3bH6m2aCFhcX6OS2KceZ6zy9-E0aJWui464ARLQT3lJDooGgnEceLu4tl0WVlb4qqIFBn6FPtFRgpT6td33NDZXfqLZ6fjLXfEkQ-14nLyjYAlJmNwjaoVADonXqe9xR_vnrrJalv4MHh9dBCQcc1isKBu0lRV1gwUTBLh6f4YSDFwEIyk-5mETMIRQlvu_s178Zd-8cQzZ2g0cMUGaJUPuPWnh9n6F6Sj3LN5inh9EDqwa0epYxZSYakanjsrO3cZmCNEdAabKBX0-a0KwQezqeAw1plrroFVjw" } } }, @@ -173,17 +172,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "505f8528-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "277" + "x-ms-request-id": "aaf51e0c-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "290" }, "ResponseBody": { "attributes": { - "created": 1637185371, + "created": 1640018483, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185371 + "updated": 1640018483 }, "key": { "e": "AQAB", @@ -195,9 +194,9 @@ "decrypt", "unwrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/66be89d568c80e0dbabf87ea1a9ce726", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/d23d776cd0114e5d993c3bc3bb0ee0a7", "kty": "RSA-HSM", - "n": "idj2DD4tVQOX2ehpY2PR85PNwmX5dkhnWKT37ggSZLAJsibElsVWqWL3aoqAiGhAcYYRoWSNDLhQzt3bMgh9FcPzrlbDygrHtxOvs-9AZhohRuwl3Ao0cbHS9k_VkgDABQaPj4Um1Ib8c6Y_CqWuwJK3Q6SitHQxU6AWzGR0BVI3ZmUT5cZdIYkvj3x_OwfkGvpV-nCzLI1uF7ol1iJzn0wnz798xQIwygJJwCr5DFDWJ5bnIyMAXIt8_K01jIhLQYDGBIytvAsX0228k2IM5KXBEM4Gh1XCFJ7kKrJlC6ZVcP2O49nHT8Bteet1hxh_v1HSR0dcvPw4uBImoefn1w" + "n": "rQpmpU_VIkaG2ypcPVf2x8n46aLNjrvgLmaHXV-nv7qspG3Axg7wCKnqO46GWPsrQ4leIz3HjAQoTIA3koLbAwiFbfQm4ZQxBSP9Jr3cFW2zQqr_D0PLL92i1XbxINquOFf7wQVsJVOf46G5B_COk5I7LROimo4Zq93lqej7WdEAYQzLBhRD7SIqwMwKrVi0f6lTp_mhll9c98MIh6-7Re4AIIsXi4ubJLEI_VNSqM1pYRtvD9h2ddxfn9DTnrgdJ2sLF0F-3Lx-KRhC6si21AD_KlV_4FWDjBz7_nrYDN1c7igCdYEKStUuPpPRSgKqFsIx8wUNd67SzHDLp95fKQ" } } }, @@ -230,17 +229,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "5093d9f4-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "279" + "x-ms-request-id": "ab2b7d58-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "311" }, "ResponseBody": { "attributes": { - "created": 1637185371, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185371 + "updated": 1640018484 }, "key": { "e": "AQAB", @@ -252,9 +251,9 @@ "decrypt", "unwrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/90e333d0a6040ff19f9a7eb5b184b7ad", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/ab89ce2c997f490d9eedcd578e95931e", "kty": "RSA-HSM", - "n": "qmiqMHnymodGLdgGuS8OUg3fiTKFJJydECcMVDZGpjAMk-DS_VUOh8F8feMC7PJ1DiAgXBUuLMkK_Koo81KlTOErGsQ8eXItlVoes-pZuY9EFm0v1nGRRM_1i7epS97UV0wAl4e6ervUtzq_P8_tfyCnesucZSPJ6JsqmUWYNHJ0XRXfHiWyBpuqa7m34JdRufagP0sBEG3WUqcPotTJFuTS0v0MpzkcO7YiUQpd6XGbDtnr4jzIv4yYlACwF1hxEhZn0rLSFiCI_ijhLX_NWGv9HmAdU9wMojLULMJtb6I5me8lPunxclQ9jNY0kMMM_TvusEFBqM7JWfY1W60chQ" + "n": "3AfiR1j4W5IYtvKoY1oQPYJE6zEqEzcNaObCjpsGGEKusIOGY9xscgRUz5cclZZfw59C4wPnCG8yq-hl37kOqbpwheLOnrvQOV54czL4x235bd61mMUTh7eFm6bvnqfuEajXxlOVmLyzo7hXEaLEKEeGH3YIkVI3wLUa5kfh_cPsbVnEWuziTk-llcIo9ft_MPjVnabUMCLz2dd_VoNlwFB2zXlcAmaM_D83DIJW1Ux7-X1FhXgmPjSIA3LINihe8wSzPUvip9yTpq18dqKXisOcGx_593abfHM_4hBrHMS7LOd4XqyhBAX2rV5N6zzkc8zLA6spclWpa5g9hF94UQ" } } }, @@ -287,17 +286,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "50c8bc32-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "275" + "x-ms-request-id": "ab6550b4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "312" }, "ResponseBody": { "attributes": { - "created": 1637185372, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185372 + "updated": 1640018484 }, "key": { "e": "AQAB", @@ -309,9 +308,9 @@ "decrypt", "unwrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/6d3db12667ec42273373166e480a7350", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/daf3fe4135b80b502dce1d7126f93fa1", "kty": "RSA-HSM", - "n": "29T9ob649ZfkHj6alWXI8rZGDpWt-4_dJtLO2hahW--dlWgiLJbliZI06Q9UfBAcj02QJc26zuZdwOY1hegA88ymvgXienNDFtKRqvFYohgVJPY2POkuujVGHspVN4lPs9sg2uNZrgeiL5WthOzoca6kJ13e1TTvfcidRjsy8Rw7sGsyipgyTJELcp58edXS4SDNelGk-6oA4F6WZAkGp2zguK_1GTbv8JdjldYgCRPwtdxw1MKUUem_kOMI1qHXMxr9GeQz3xtoa_PtAT7-Y0MFE6cVftrkmkBqGOZZ6q1sXV5K0grJnvQ73MzqczPvjpK0Tkf6vzoU1jFB2nXuEQ" + "n": "61uiXPvtVtKqOimhcg9b95aZOAs7JokoK82f7ZR4GAhw1gFxXZTwf3Hi_F79hvcyafEckgmcNQH9yUilAnjRIVipVrnGuV5NlDfoTOLN6F1vwNOq5bQSmhlzNXDhnBBlJYpsoKmvBr38Iug2UZhiCyZG2khbSyBGI_shPEws9G0pEAab5oy6qqdu4y7L7Ebsa2rvVyatr9_1hPYVtzD5J3ITR6eAbIF-lLMGtW1Y36FReyqR_KAMixIG0PNzLt5I3vhksIKLL8Fd4pGDdyZPC0RpryrCWda1wpYgcLrM2p1hVjj6cEFPBnsxoBm9qUpkKQK94vfml5Oon1CJT2Q75Q" } } }, @@ -344,17 +343,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "50fcef34-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "288" + "x-ms-request-id": "ab9f131c-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "291" }, "ResponseBody": { "attributes": { - "created": 1637185372, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185372 + "updated": 1640018484 }, "key": { "e": "AQAB", @@ -366,9 +365,9 @@ "decrypt", "unwrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/a22487f5de5904b7bb36cb0e8ec3f39a", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/5cc3dcdd32fc4cd58e9caac53ce10425", "kty": "RSA-HSM", - "n": "s4MCogYnasU461iFBJKLaVAvk45eutmVUqHDia7mCMrNNeT3jlYrYcQagKQICEqRM-K05jsTOQhTi7vEyuFVWW1eBDCDhTbTpds5_uumor7jVeB_x3JRGiluPy6Xh897u46bawMeJ_Rq_e5ZDqxf5PXXJZzqB54zo-l4eqyjmUganf4LaFENW_72qMZrriZ_SbqcMxLBWRJWcmKIjuaLPXwpVn_ttoC0KxhJrrK83UYVdLMfdvOhyrSUQZ2kXPThxA_rr_5ufmHxQM5lTEj3tEp7FqeKl9NvC9P-qaIV22ZQTRWZ3tggdQvAfQ_rWRSc5jQdMLFGbShGw_mY5PZvjQ" + "n": "q8Ak62c4Nvtw0i8JS_aXFzEcntlM2Wb0_CjSHfrSHtCRyHg9DpNMml8GIRfavTYP48_lksYRNI3_8K-8-ucmEXM5XMqAEKyNNdo3MzKlHu-0e72zdAuqK2bdx3UsqDfpE81sPb-Iqb4kmWWjDrJypD22RhCiQYj548ncGCpqeSt-Ktm4ISHCB0zhiTMzfp4ElZVFrrnP4EGyvY7a3qUBhD0PbQY3sVCUJuYq3pbFrXkJuS0bO9rYNAowTN9E-KfZYxufEATkiHERnWU0tVT44Uj2b98nr3z1fltscdPH4K1nNyKzCDcQ1wjrjONoSDhpaXpa_YFcBoMVP0YHvgBSYw" } } }, @@ -395,79 +394,79 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "51337d24-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "116" + "x-ms-request-id": "abd7b3ac-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "100" }, "ResponseBody": { "value": [ { "attributes": { - "created": 1637185370, + "created": 1640018483, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185370 + "updated": 1640018483 }, - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/03eac1f02f100080954a3b9cc5e16289" + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/ddc161944abe0e1d898762c03e3dd087" }, { "attributes": { - "created": 1637185370, + "created": 1640018483, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185370 + "updated": 1640018483 }, - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/9a153530ac9b06e694629ddc81544aa6" + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/1d56e2806f310d95303fb1d8279cc76f" }, { "attributes": { - "created": 1637185371, + "created": 1640018483, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185371 + "updated": 1640018483 }, - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/66be89d568c80e0dbabf87ea1a9ce726" + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/d23d776cd0114e5d993c3bc3bb0ee0a7" }, { "attributes": { - "created": 1637185371, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185371 + "updated": 1640018484 }, - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/90e333d0a6040ff19f9a7eb5b184b7ad" + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/ab89ce2c997f490d9eedcd578e95931e" }, { "attributes": { - "created": 1637185372, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185372 + "updated": 1640018484 }, - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/6d3db12667ec42273373166e480a7350" + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/daf3fe4135b80b502dce1d7126f93fa1" }, { "attributes": { - "created": 1637185372, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185372 + "updated": 1640018484 }, - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/a22487f5de5904b7bb36cb0e8ec3f39a" + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/5cc3dcdd32fc4cd58e9caac53ce10425" } ] } @@ -497,19 +496,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "514f7c36-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "87" + "x-ms-request-id": "abf16720-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "90" }, "ResponseBody": { "attributes": { - "created": 1637185372, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185372 + "updated": 1640018484 }, - "deletedDate": 1637185372, + "deletedDate": 1640018485, "key": { "e": "AQAB", "key_ops": [ @@ -520,12 +519,12 @@ "decrypt", "unwrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/a22487f5de5904b7bb36cb0e8ec3f39a", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/5cc3dcdd32fc4cd58e9caac53ce10425", "kty": "RSA-HSM", - "n": "s4MCogYnasU461iFBJKLaVAvk45eutmVUqHDia7mCMrNNeT3jlYrYcQagKQICEqRM-K05jsTOQhTi7vEyuFVWW1eBDCDhTbTpds5_uumor7jVeB_x3JRGiluPy6Xh897u46bawMeJ_Rq_e5ZDqxf5PXXJZzqB54zo-l4eqyjmUganf4LaFENW_72qMZrriZ_SbqcMxLBWRJWcmKIjuaLPXwpVn_ttoC0KxhJrrK83UYVdLMfdvOhyrSUQZ2kXPThxA_rr_5ufmHxQM5lTEj3tEp7FqeKl9NvC9P-qaIV22ZQTRWZ3tggdQvAfQ_rWRSc5jQdMLFGbShGw_mY5PZvjQ" + "n": "q8Ak62c4Nvtw0i8JS_aXFzEcntlM2Wb0_CjSHfrSHtCRyHg9DpNMml8GIRfavTYP48_lksYRNI3_8K-8-ucmEXM5XMqAEKyNNdo3MzKlHu-0e72zdAuqK2bdx3UsqDfpE81sPb-Iqb4kmWWjDrJypD22RhCiQYj548ncGCpqeSt-Ktm4ISHCB0zhiTMzfp4ElZVFrrnP4EGyvY7a3qUBhD0PbQY3sVCUJuYq3pbFrXkJuS0bO9rYNAowTN9E-KfZYxufEATkiHERnWU0tVT44Uj2b98nr3z1fltscdPH4K1nNyKzCDcQ1wjrjONoSDhpaXpa_YFcBoMVP0YHvgBSYw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2201827963", - "scheduledPurgeDate": 1637790172 + "scheduledPurgeDate": 1640623285 } }, { @@ -551,22 +550,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "5166f622-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "28" + "x-ms-request-id": "ac09ce96-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "34" }, "ResponseBody": { "attributes": { - "created": 1637185372, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185372 + "updated": 1640018484 }, - "deletedDate": 1637185372, + "deletedDate": 1640018485, "key": { "e": "AQAB", "key_ops": [ @@ -577,12 +576,12 @@ "sign", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/a22487f5de5904b7bb36cb0e8ec3f39a", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/5cc3dcdd32fc4cd58e9caac53ce10425", "kty": "RSA-HSM", - "n": "s4MCogYnasU461iFBJKLaVAvk45eutmVUqHDia7mCMrNNeT3jlYrYcQagKQICEqRM-K05jsTOQhTi7vEyuFVWW1eBDCDhTbTpds5_uumor7jVeB_x3JRGiluPy6Xh897u46bawMeJ_Rq_e5ZDqxf5PXXJZzqB54zo-l4eqyjmUganf4LaFENW_72qMZrriZ_SbqcMxLBWRJWcmKIjuaLPXwpVn_ttoC0KxhJrrK83UYVdLMfdvOhyrSUQZ2kXPThxA_rr_5ufmHxQM5lTEj3tEp7FqeKl9NvC9P-qaIV22ZQTRWZ3tggdQvAfQ_rWRSc5jQdMLFGbShGw_mY5PZvjQ" + "n": "q8Ak62c4Nvtw0i8JS_aXFzEcntlM2Wb0_CjSHfrSHtCRyHg9DpNMml8GIRfavTYP48_lksYRNI3_8K-8-ucmEXM5XMqAEKyNNdo3MzKlHu-0e72zdAuqK2bdx3UsqDfpE81sPb-Iqb4kmWWjDrJypD22RhCiQYj548ncGCpqeSt-Ktm4ISHCB0zhiTMzfp4ElZVFrrnP4EGyvY7a3qUBhD0PbQY3sVCUJuYq3pbFrXkJuS0bO9rYNAowTN9E-KfZYxufEATkiHERnWU0tVT44Uj2b98nr3z1fltscdPH4K1nNyKzCDcQ1wjrjONoSDhpaXpa_YFcBoMVP0YHvgBSYw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2201827963", - "scheduledPurgeDate": 1637790172 + "scheduledPurgeDate": 1640623285 } }, { @@ -608,22 +607,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "51757328-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "36" + "x-ms-request-id": "ac1960c2-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "37" }, "ResponseBody": { "attributes": { - "created": 1637185372, + "created": 1640018484, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185372 + "updated": 1640018484 }, - "deletedDate": 1637185372, + "deletedDate": 1640018485, "key": { "e": "AQAB", "key_ops": [ @@ -634,12 +633,12 @@ "sign", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/a22487f5de5904b7bb36cb0e8ec3f39a", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key2201827963/5cc3dcdd32fc4cd58e9caac53ce10425", "kty": "RSA-HSM", - "n": "s4MCogYnasU461iFBJKLaVAvk45eutmVUqHDia7mCMrNNeT3jlYrYcQagKQICEqRM-K05jsTOQhTi7vEyuFVWW1eBDCDhTbTpds5_uumor7jVeB_x3JRGiluPy6Xh897u46bawMeJ_Rq_e5ZDqxf5PXXJZzqB54zo-l4eqyjmUganf4LaFENW_72qMZrriZ_SbqcMxLBWRJWcmKIjuaLPXwpVn_ttoC0KxhJrrK83UYVdLMfdvOhyrSUQZ2kXPThxA_rr_5ufmHxQM5lTEj3tEp7FqeKl9NvC9P-qaIV22ZQTRWZ3tggdQvAfQ_rWRSc5jQdMLFGbShGw_mY5PZvjQ" + "n": "q8Ak62c4Nvtw0i8JS_aXFzEcntlM2Wb0_CjSHfrSHtCRyHg9DpNMml8GIRfavTYP48_lksYRNI3_8K-8-ucmEXM5XMqAEKyNNdo3MzKlHu-0e72zdAuqK2bdx3UsqDfpE81sPb-Iqb4kmWWjDrJypD22RhCiQYj548ncGCpqeSt-Ktm4ISHCB0zhiTMzfp4ElZVFrrnP4EGyvY7a3qUBhD0PbQY3sVCUJuYq3pbFrXkJuS0bO9rYNAowTN9E-KfZYxufEATkiHERnWU0tVT44Uj2b98nr3z1fltscdPH4K1nNyKzCDcQ1wjrjONoSDhpaXpa_YFcBoMVP0YHvgBSYw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key2201827963", - "scheduledPurgeDate": 1637790172 + "scheduledPurgeDate": 1640623285 } }, { @@ -667,8 +666,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "518518be-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "105" + "x-ms-request-id": "ac295612-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "129" }, "ResponseBody": null } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_NON-HSM.json index e3d7d05d2ef6..863dd3b0fd85 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestListKeyVersions/TestListKeyVersions_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:44 GMT", + "Date": "Mon, 20 Dec 2021 16:41:19 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -28,8 +27,8 @@ "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4a69375f-3dd6-4814-9acf-1c011de619c7", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "7fcce3c9-cca7-4099-8d75-1cd8008045b6", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,20 +61,20 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:45 GMT", + "Date": "Mon, 20 Dec 2021 16:41:19 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "e85cb045-0bd3-47f2-bddb-5debc9d49bbc", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "cc533f09-0431-4f70-b676-307e89232b7a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/e162ebd92bdb41d8b86a306fe695892c", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/d444cdb90e574705a3f9c1a236981e61", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "xoYfQiYqWbX7ImV26NPjoGBGD72XQuDyQ16vRNGKgQc8EEio0oluSSOD18UjKmQ1ZM1jPEzMAj5rTyR8h_4zHHgDjcxCeIYiCZ1ibA-1za3jQDtgSbLg1CSMjAfXsNPQWblz3Ap7k16KI1YY7VxBsQUL-TgjkAjuAJXQJVYDhs_WGan7GcF93m6oP5_opJ2xslG_vStrIcQ8Ryrud0fNT3B7J0AFQqk-TnpuH-0BtIT2TCmeXSy9oG3Z1p-0Q6cZWGWUbfFWJY6VaDPmJ1vEci-VLLrz0rxN-QMkoqE5Bka27Ngc-g1Cl-XQKN2lzQGLfI7_sdmtBrvM6S1dysQKnQ", + "n": "yfepUolVtOSw6OtAWV-tsBflzaD2GS4vtUlFOMiWRgi2ON_AmpCiC0NLq9KDPfAer6GVZaenMWGDUgLLI30vXgqGBkk-lAHCV7eUrMFFsK-jbfrUXrVYLuiXGAqjYJ6rnI4U6pSc3BHdtr3oxAeKMOgIdEbEkzetKsd2srFD8iS0cmjmNro1NNdyTjfGjouduZ76MDiFNV9rXyw_kjp4vOFQ5lXlndL64IRW7ijPex5l_Ry8S1bEFxEvFjHYxY4zuuOxhLcuCsuXZ93HfGr8ssynniq9GfidoY-vF4lyOQowdM0Ay5dlnfXGUWnZfeYsV9pmVQdJ5uJ7KyHlPZGA8Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185365, - "updated": 1637185365, + "created": 1640018479, + "updated": 1640018479, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -120,20 +119,20 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:45 GMT", + "Date": "Mon, 20 Dec 2021 16:41:19 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "17d3858c-a5eb-4d22-93d6-363617bf9922", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "36319f32-47f2-4eee-a143-8376a99e5dab", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/6caa5e63fe01486e8040871196cce463", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/7dfc85cad2754789a3881f3f27b97a86", "kty": "RSA", "key_ops": [ "encrypt", @@ -143,13 +142,13 @@ "wrapKey", "unwrapKey" ], - "n": "v_MzAjoGvZl0CrUAhTsci-bJzvIH6PnNi70mNKIPoU57wZQCZxmp8w8rjYgPD08yDJsAq4AON_iv4QX-2oCFqtAiU2Ip19E-PtlrunlaYn821SwvNXgl_NRYl40xWexeLvofxOX2yN9yj_TKfGs-vRLFmcumjoMGGuZS3h938Mw4G_EtGcj8ZrwLaUwt2tu12-10hMxzbxKUt395zNO0Bsc1qfMomZwlFkRWQdi6zAA-5I9YauIv9bDYiC2y1y0jTqjn1rS1yonap0oGeH8sQZ_8zqLvKq0J_5TVgSCfcePIFoEH1LPqis524UiqCgdclfCwuuU58PCyeAtXgFXsLQ", + "n": "xExOIs3BDRwbBXIGKKJl0hxrby-fg8wCUxcJSdMgbMKb1YyYvKodEm5qMP9YBN3iJgOYAtIXS2JHr8e22AAC2N41HFhd0Nl29_iu9JQzHDO0SghCgk_Cc8W4hWq3mDZ-VQLj4us5YBWDTEbmPagFmC02bsYpn-O1j6XffOHYdkhF4JJSu43bkVLMyHG7H9HMycw6Qo_JwJoIt_KLryOxyFr6WmX4xGo_5q9J7uJbjeerdzcHfFNgr0l7hBYiWmP3yVWVQYqP34fEN6-DDt0_qRtRr_YlOibDOo5SLVaa_CEX3UTlwLyb-7i4YHNOyVQIZV40yFWZAqbj5puiNAOYCQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185365, - "updated": 1637185365, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -178,20 +177,20 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:45 GMT", + "Date": "Mon, 20 Dec 2021 16:41:20 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "63e78484-b04d-40da-923f-10bb70a86cdd", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "f8d533aa-351e-4068-92d7-f64c721ef5cb", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/7309eca50be94c61b79bee5f4b311a29", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/8616a2e6c6c24674ad992900cdfac144", "kty": "RSA", "key_ops": [ "encrypt", @@ -201,13 +200,13 @@ "wrapKey", "unwrapKey" ], - "n": "9CLxoLrxy-FMaK2oo02u8CkxMbFixZGQthv5LDwNPukuZCw0genlbvkoz-_AGWMyPriQ2k5ghGLcb3CqgqWAcAWbb2N6K3DsTuuI3hTI3OWMJfcE8UQK2gdcLbdldFTWRScnviManE3Vbwpq0dvbNlOYNQ38vVMWqDf5rfUygCI8zL3-l4aMdtnH5sjalvxO4otCXWpIfX6KqJbAtBQU4R8H461WLNHhhHpRx34jz759OFGjH2LMCj4lqLloiyRH0Z5B6IqCteHJ16OTmKDCi2O7LQNEmsIOM7Xyz-KQaKmqNMDgJ6rDChJ5OSnWMqGBl-uWhfNC33ht4QrWna-t0Q", + "n": "6V5XjJk_7UwhT_j8alemZUD32wWXnAvCbZz6Ok1LJyPsFCP-z8Kh6EKbxZF_gciUda-_eMznafZYIS3yRxj0kjC8JQnogVGQSjf_iIWvnnZg3fPs7aM_YKuSW76e7BiO_6AnZYy3OTdREmza7FzDLer6MWPhS3ifuKY4_S2dyk1D5sxr7iArvgKmFPUZ2z_dGmjZzQb44CuJScBaob_0Bn-iaD8eNhC2sRutPDe0S1VwkM7LamT4jmGy0_qvJmr2Vplhi7aZWht2YdI-8kkLpi0drhXTvrNBcNKyzUgt0IVSp_iCvwESIuSbtCkw_gFHaZ6cCTIu0L31ce_dRQQN3Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -236,20 +235,20 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:45 GMT", + "Date": "Mon, 20 Dec 2021 16:41:20 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4b8a44ee-cc95-4b83-be2d-816dd9bf92f7", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "59c79472-5640-415e-98a5-a03cd255e959", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/0abd5e50dbbe4bae8c6b757aca6cbf28", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/273873b1d610433eafe6f3e5aa3f8323", "kty": "RSA", "key_ops": [ "encrypt", @@ -259,13 +258,13 @@ "wrapKey", "unwrapKey" ], - "n": "1mGqYfuM_ZJKvcYg8h23sVs5TznjpAgIvEBGWbMLTEgln2lyqRNCY2xQAy3v7saT4gkop2cVKrH5pmT6lJOx-au2sHe7DgUJOFgolNjxePfAvVikhFVGVEnokaPB39BWyV2BdDzPb1noagO9OnwnzlEsZKNOFZMawHbnE4Ll_M3U0hvAgyEtDvxN6cvsQGfifiG5fKpVEs90JdgmEeLQJn3xfnQabjjQ7jILor4-055Mlun0bFxQeSY3M_GG5_R4K8Cei2_tSzvddGrLamVrYvj3r-y7HncKfWo6VfBM4IkLUzXvg0I8I58yws8h2hSdQTYo2cOU64-4lmfGYS54CQ", + "n": "2m-howPW_yBp5VCcs-QG3P2LsWC_TtBYg7ePRjlQr6CiUeR0G-3qQHE5-vgu4TKldkdnhqldpRhjBZPoCdy_R2XtghHdYzEGHvlFVKcTCwI6CsGQuSGJzAIHUpXVGGfzYLQq_cblNnEBbtSrgDSl3UHc5VJePBV_3qJqB6eOMiMHQCMJieDguuYoEqzN6oAIuYcVPwHt3Hy-dPxETzgu63bOI9KfBP_310oFuqR5RY1iMWjOM-Kdu1swa64DHhLLrb5kDC_9MVDZAsrGnYarhav3aFMR9LpDSuNPOWC3lhgaiM0SFkLmCBDG60QHGXUUyNNJFFSb-HH5AnRq_RCv7Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -294,20 +293,20 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:46 GMT", + "Date": "Mon, 20 Dec 2021 16:41:20 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "8120370b-5fde-4514-ab6d-6f6ef95cdb79", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "3bf60d44-31a8-4010-9465-90c09e0ef41a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/277d3006730e4c9289a5af096de498a5", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/e1ce498a5a124add9a659e2d2ced0f44", "kty": "RSA", "key_ops": [ "encrypt", @@ -317,13 +316,13 @@ "wrapKey", "unwrapKey" ], - "n": "2Pc5_axZDoJI19xSH6tXSsKZY_Wkb7CqNVMhcxf8aODFpX2Dic0mwpmK89gydEDrpwPYfFqYoWVqpdjzIoWb-M1LA1y-6484zsyD_OPL44iIUtUmDXHQauoz3mA5_BCgSqyuBOOwqPgmzCJR5dJH2FxP1Xy09_HQvNnAYXRYKcEpjIcJtb_uc1DKekIwdxHi4Zd2b-jfT9Rwf6qdVALQmlPARyuFs4hVU5o_Nel6gkVDlLjdvFK7zHQ4td7qb-5MPpB-O9wTqNXnTa0Zi1CnH9n0JADiaeu7XkA25u8Mu5xFhNZPymIQVmA8cQ4N9ELlAqgwI7isNpeUcAYBspEWFQ", + "n": "vGMWut38hiFZfAiWw2_xRXbMgLnwqZJntJ5tDbEoi0UCSsIFTlpURL3XTwMh8iQDmxDuQDFUObcJRq6NrTWoJQEONp6EYeoafSy7UMS6E_AH01Malyqiime80tkjM5RmRu6WSOt4E2REXSmF9JTvM9ui7tU4sLzdiaXmEU4sL31MaDScRcPEL2CZ4Xf6T79t9moGbZr4p8SJTjHlPubhJaoOTRDNertntNOK6LzP4piXcrLPTVCJ0GFpxmcWcUm1i79jAZexWG-H5anl1Pp9gEVDzc0CFZjYYhYFWBHq6izCXWB-L1v8j0Lgwr_j6oiBUAjw3C9sxlI2ebolWRewAQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -352,20 +351,20 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:46 GMT", + "Date": "Mon, 20 Dec 2021 16:41:20 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "f0805f1b-5a02-4139-8854-ad496f05cd3a", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "5d58cacd-544a-4be6-9cb8-659f36ee8503", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/b1cf75a2f7204b1585f9a5750e386a4d", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/94480ae5be964358898c5c9b0ee60315", "kty": "RSA", "key_ops": [ "encrypt", @@ -375,13 +374,13 @@ "wrapKey", "unwrapKey" ], - "n": "37QBPpuQtmboTa7-1ibr6rgeADdumcprkHX4WJgqiUjyc9r1KkRwkltKFwgivjg_oaZ-DqyLpPtWI_BwqWdVLQ3VjNZPRBsIlrYfdUqE65lpuDRgATl9ueuoefhTExS6dtg2j2sYwIGT6BvT-qiMxa-AioIrlgekDGGjc1nXNdj00CMAEfaU8vdqkY_XMtmNtLeQwcKfwlWaxp3LiwI_9BvKo7K4phR6fK5kbtdMKwzejMKYlsP6SGii5frKcd03LJRkZc61u3fEHJxapfDnNgQYrXsbt4oVuKmyWu0uePWA7nnLoBm-8z28-67I66mUxg_buWLENAWpKnvT4c9bwQ", + "n": "wviVnjiTPPBzb0CzTffMgwjxbcV-FrZtqVb9Uzmv1V1CBPRkmiBGgH5RucIdjl5mJb7CSlgCgVjYBLB7E0YGRzB5bN3oa9d6Hn9PLnamlu2Xr5jMZCp_hZJ5B709zw7rS17j5WapfPRJC5En292EOv99P2eYe8X1bHjrIz2enKUMi5Wq3St_5Aj7Y30GkTYNCM80GDF0zs8CPguGGYh5lYhPutAwqqMjc_558GRjc1bqZdSzwW147ty5O_51iwo_u72skfYkr1laAtanPmlH9H_s_kl9DmKuPdknlUvbFQW9nh3vxEsmfHCEU8gtqtbQB6Ezm7n-TTuNwASZOgcmvQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018481, + "updated": 1640018481, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -406,75 +405,75 @@ "Cache-Control": "no-cache", "Content-Length": "1437", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:46 GMT", + "Date": "Mon, 20 Dec 2021 16:41:20 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "a92c8640-c4b3-4ef0-939f-129c71419709", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "e460b9b4-5ffa-442b-b3e9-3abcc4752350", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "value": [ { - "kid": "https://rosebud.vault.azure.net/keys/key231821625/0abd5e50dbbe4bae8c6b757aca6cbf28", + "kid": "https://rosebud.vault.azure.net/keys/key231821625/273873b1d610433eafe6f3e5aa3f8323", "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } }, { - "kid": "https://rosebud.vault.azure.net/keys/key231821625/277d3006730e4c9289a5af096de498a5", + "kid": "https://rosebud.vault.azure.net/keys/key231821625/7dfc85cad2754789a3881f3f27b97a86", "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } }, { - "kid": "https://rosebud.vault.azure.net/keys/key231821625/6caa5e63fe01486e8040871196cce463", + "kid": "https://rosebud.vault.azure.net/keys/key231821625/8616a2e6c6c24674ad992900cdfac144", "attributes": { "enabled": true, - "created": 1637185365, - "updated": 1637185365, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } }, { - "kid": "https://rosebud.vault.azure.net/keys/key231821625/7309eca50be94c61b79bee5f4b311a29", + "kid": "https://rosebud.vault.azure.net/keys/key231821625/94480ae5be964358898c5c9b0ee60315", "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018481, + "updated": 1640018481, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } }, { - "kid": "https://rosebud.vault.azure.net/keys/key231821625/b1cf75a2f7204b1585f9a5750e386a4d", + "kid": "https://rosebud.vault.azure.net/keys/key231821625/d444cdb90e574705a3f9c1a236981e61", "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018479, + "updated": 1640018479, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } }, { - "kid": "https://rosebud.vault.azure.net/keys/key231821625/e162ebd92bdb41d8b86a306fe695892c", + "kid": "https://rosebud.vault.azure.net/keys/key231821625/e1ce498a5a124add9a659e2d2ced0f44", "attributes": { "enabled": true, - "created": 1637185365, - "updated": 1637185365, + "created": 1640018480, + "updated": 1640018480, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -502,23 +501,23 @@ "Cache-Control": "no-cache", "Content-Length": "817", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:46 GMT", + "Date": "Mon, 20 Dec 2021 16:41:20 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "2abdd910-1610-4eb8-bd09-43c44f577aa2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "87cfbab3-967d-4e0b-aae3-56309673a8fc", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key231821625", - "deletedDate": 1637185367, - "scheduledPurgeDate": 1637790167, + "deletedDate": 1640018481, + "scheduledPurgeDate": 1640623281, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/b1cf75a2f7204b1585f9a5750e386a4d", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/94480ae5be964358898c5c9b0ee60315", "kty": "RSA", "key_ops": [ "encrypt", @@ -528,13 +527,13 @@ "wrapKey", "unwrapKey" ], - "n": "37QBPpuQtmboTa7-1ibr6rgeADdumcprkHX4WJgqiUjyc9r1KkRwkltKFwgivjg_oaZ-DqyLpPtWI_BwqWdVLQ3VjNZPRBsIlrYfdUqE65lpuDRgATl9ueuoefhTExS6dtg2j2sYwIGT6BvT-qiMxa-AioIrlgekDGGjc1nXNdj00CMAEfaU8vdqkY_XMtmNtLeQwcKfwlWaxp3LiwI_9BvKo7K4phR6fK5kbtdMKwzejMKYlsP6SGii5frKcd03LJRkZc61u3fEHJxapfDnNgQYrXsbt4oVuKmyWu0uePWA7nnLoBm-8z28-67I66mUxg_buWLENAWpKnvT4c9bwQ", + "n": "wviVnjiTPPBzb0CzTffMgwjxbcV-FrZtqVb9Uzmv1V1CBPRkmiBGgH5RucIdjl5mJb7CSlgCgVjYBLB7E0YGRzB5bN3oa9d6Hn9PLnamlu2Xr5jMZCp_hZJ5B709zw7rS17j5WapfPRJC5En292EOv99P2eYe8X1bHjrIz2enKUMi5Wq3St_5Aj7Y30GkTYNCM80GDF0zs8CPguGGYh5lYhPutAwqqMjc_558GRjc1bqZdSzwW147ty5O_51iwo_u72skfYkr1laAtanPmlH9H_s_kl9DmKuPdknlUvbFQW9nh3vxEsmfHCEU8gtqtbQB6Ezm7n-TTuNwASZOgcmvQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018481, + "updated": 1640018481, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -559,200 +558,15 @@ "Cache-Control": "no-cache", "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:46 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "d5527276-4c81-4b76-8d4c-b99e90175376", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key231821625" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key231821625?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key231821625?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:46 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "d549e534-62d1-4c8b-89d6-a29abe7885c1", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key231821625" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key231821625?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key231821625?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "9420bec0-0857-4354-8acb-aa529e6a6a81", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key231821625" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key231821625?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key231821625?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "254db19c-0128-4693-a018-3a1322c7637a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key231821625" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key231821625?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key231821625?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:47 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "ebcfee79-2e81-4a59-a707-4374cdda03c2", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key231821625" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key231821625?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key231821625?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:48 GMT", + "Date": "Mon, 20 Dec 2021 16:41:21 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4ac4b65a-dfed-4557-8faa-6d7c7f47d495", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "32bd7203-6914-4f54-a52e-2002dff69d37", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -781,15 +595,15 @@ "Cache-Control": "no-cache", "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:48 GMT", + "Date": "Mon, 20 Dec 2021 16:41:21 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7215ae1e-a55d-4bcb-9e5e-bcdfbb8c79f9", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "cca67098-9b90-4f25-867f-a9fa7e7d7496", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -818,15 +632,15 @@ "Cache-Control": "no-cache", "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:48 GMT", + "Date": "Mon, 20 Dec 2021 16:41:21 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "b74e4f87-ea21-47b7-ad85-728b51394ad3", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "ec9905c7-6a45-41e2-8faf-d59347fda51d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -855,23 +669,23 @@ "Cache-Control": "no-cache", "Content-Length": "817", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:42:50 GMT", + "Date": "Mon, 20 Dec 2021 16:41:21 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7224d9e5-43a2-41c5-b8db-fdb2abea08d2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "76e6152c-0afa-4704-bb26-fe6cd9c63b05", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key231821625", - "deletedDate": 1637185367, - "scheduledPurgeDate": 1637790167, + "deletedDate": 1640018481, + "scheduledPurgeDate": 1640623281, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/b1cf75a2f7204b1585f9a5750e386a4d", + "kid": "https://fakekvurl.vault.azure.net/keys/key231821625/94480ae5be964358898c5c9b0ee60315", "kty": "RSA", "key_ops": [ "encrypt", @@ -881,13 +695,13 @@ "wrapKey", "unwrapKey" ], - "n": "37QBPpuQtmboTa7-1ibr6rgeADdumcprkHX4WJgqiUjyc9r1KkRwkltKFwgivjg_oaZ-DqyLpPtWI_BwqWdVLQ3VjNZPRBsIlrYfdUqE65lpuDRgATl9ueuoefhTExS6dtg2j2sYwIGT6BvT-qiMxa-AioIrlgekDGGjc1nXNdj00CMAEfaU8vdqkY_XMtmNtLeQwcKfwlWaxp3LiwI_9BvKo7K4phR6fK5kbtdMKwzejMKYlsP6SGii5frKcd03LJRkZc61u3fEHJxapfDnNgQYrXsbt4oVuKmyWu0uePWA7nnLoBm-8z28-67I66mUxg_buWLENAWpKnvT4c9bwQ", + "n": "wviVnjiTPPBzb0CzTffMgwjxbcV-FrZtqVb9Uzmv1V1CBPRkmiBGgH5RucIdjl5mJb7CSlgCgVjYBLB7E0YGRzB5bN3oa9d6Hn9PLnamlu2Xr5jMZCp_hZJ5B709zw7rS17j5WapfPRJC5En292EOv99P2eYe8X1bHjrIz2enKUMi5Wq3St_5Aj7Y30GkTYNCM80GDF0zs8CPguGGYh5lYhPutAwqqMjc_558GRjc1bqZdSzwW147ty5O_51iwo_u72skfYkr1laAtanPmlH9H_s_kl9DmKuPdknlUvbFQW9nh3vxEsmfHCEU8gtqtbQB6Ezm7n-TTuNwASZOgcmvQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185366, - "updated": 1637185366, + "created": 1640018481, + "updated": 1640018481, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -910,15 +724,15 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Wed, 17 Nov 2021 21:42:50 GMT", + "Date": "Mon, 20 Dec 2021 16:41:22 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "99519511-d69b-4d6c-92c6-8bd66218e63e", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "a7475a5d-a5d0-440b-89f6-6f3bcf87083d", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_HSM.json index bf265808bcbd..b346cdc1963f 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,8 +24,8 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "24dc260e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "1" + "x-ms-request-id": "8c3c9580-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "0" }, "ResponseBody": null }, @@ -60,17 +59,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2501b176-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "227" + "x-ms-request-id": "8c6173b4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "237" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, "key": { "e": "AQAB", @@ -82,9 +81,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/570deb623971413a3f61b09b6b54c8c5", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/d8799606235745320f44e731665738d1", "kty": "RSA-HSM", - "n": "jKjQ1J0vVJAeD-ezqJb3pCa91xrG5LeEGBmiGMyj2ShDvUL8Bl8HnkVZgZR3JE6X_HEikGI1igQBV9GftdRI4qE3S3mWcI2QnOtQ_GFJqS6yicPUkKuVpzcY3LvZmCmd9HXYu_xBwysvUoAmi7g0MTjjOdPRCNjhGmjI8wpKulIwoSWsoW75w5pELX7EDROT_4btT3m7GAjnkDiw8tA1wHnYEtd2bVh4jdaA9XM1TqAAMvGsUJsSDOOzTXm3oCI5bxqhf2u440j-_pl4LOsKOdIz4jxYAIpPhe7eRLq_QQJ2Bp4iHvPGIBdyVQ-2tKD4qBk15CYge_X4sfnrhRDThQ" + "n": "tHNHD8HcXakdPpLaYHD0QaH0_17O9vV6M3-XgFDxF2E3XOLybH3uHC4wbEeKcGXMeHBH1uaZJiLLTCbF2D9zh9cXKfY35Hj79wG1MCZlwypGueMd98Ua5gdkK7opR_zNlJCibWgwtbijCb0gDo2o5gbqZ8-v71q0-oTfbloM6wd0-OaH27Wlfq7ZHE1HuwxBCJ9AIyAvfqhteKrpsGEH03OggSY6XvZIChd-tTwWVTgvPijjcoWX8QQkWPi0DDqKunVT95yq8j-6HGteoSIdkPWWpu5SpD1z-hvW9mQWdKRC6AJ2n5aQYgjA-ORa7sgEs9uIB6YhNdwhswMNJuEs3Q" } } }, @@ -118,17 +117,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "252eaf82-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "227" + "x-ms-request-id": "8c901c50-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "233" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, "key": { "e": "AQAB", @@ -140,9 +139,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/e6f56436188e02bea1e468fda743a6a0", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/80560de730f10a35819f2fcdc0bde989", "kty": "RSA-HSM", - "n": "qCUfwlztuH1WYGpcz5yTinza32aOiMfp-bk6DDsNuh_026OleWpeuaxMKjh27U3l7X506Ouq59YszD9c7ajQdsp0Kj8XwK7if-obktmfYI5XI5MVBn_bs5vgVkkv6VElwaOzj4l9MyJfsMYM0x5KQi1KAN6SGtUSGrr402_9FwjePevnSiZ9aryMu-4hzWoprbCKcG2-PVjXUYEv3Um-FuZYq-NApGPnVrjqbVCkOtNJorMtt4lqIwNzAxhjrZ45vE795JyTEvlMpiVzCPJq3ii6E8xzX16o8V_TytPHBegziPj0Qnuaqi8ZYqWBXzWrjr45E5NeadDEmaYhNC9IgQ" + "n": "iCvkpvVMVp0DAMAK7ztQTcO09vRNkJTA4b2p7DmzWubSPkWciAaCqVyo059W_tekrhO2yw8fciVizKYhX0vSnffi6RvU_N9th40gCmdYL6UnuPnIDdW9pewDFBJXvB6VaWyZih0b8nLN4AjwooQlqV7H9EzwTn9iqk1_uVCEAWf956JK3tvmA4casAVtkqRrF5h6-_RLob9EH2ZN24TcOYilZrCjIeiGot5nnXYCCqGMFhc-XVa76kIgdl-O-_d6Ji3pR2icvZSUtI8_gt2UqvIfSGy1l5W38R2-pAdDdtSbP848osIQuiWnsd08DAHIgdAhmRDk_UtL8GOr0z-t2w" } } }, @@ -176,17 +175,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "255ba226-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "223" + "x-ms-request-id": "8cbe5692-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "234" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, "key": { "e": "AQAB", @@ -198,9 +197,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/daaadf71ef6e412ab8025b3c01bb710b", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/46acf3b602230ba231e4998de496fb39", "kty": "RSA-HSM", - "n": "tT_vM4b4ek4EAl3fiDDKCERNUEisOux-9OqI6c-FVz7oGUpOc7Rsq6U94P54OSOlggglJsneSwoKE-zLHsDbmmydHUB3PxprC9c3g_dmpI_mvQyriZoLwI8XUST90VYwHOcNSIeCkrd0azvr-GHbW_ti-Rcr4ghzCaeZkiDUwPcXdUJ_zJ18FVRLhxblstJcL5bblbsZP0a4Qk8H3_EMyXg8I4NFHRWWFESUcXSiTTGR9GETNU_JR7KWuB7t_lGh2Qtrr823WcUyl0ksm4uzb6fWe0vhgSn2Df2Hkb6d-MvkL49GRmBQlxICdgWDhzcGAI8K14UXVp5Gulo3J9Jy_w" + "n": "uV4oR_Kg6rBuqT6g4TyhLNcy6oFE5czty6Nh7QQwm-jLmRajmdTrs6-Z_1hGo4DzYDB7fN73AnwYgO-b8w6LDxaStJP5qnc-sT9yhJ64gpjSTgY4qDNb9n54BlOUVBV1BfRVWZpkNUtOOdpe2qTtfQWSk1T4pAtXyc49BBD4anhLnB7UjS9IO6QwNPSz-4kN6NzWPqh9akpTxHfW7H8z20NL8T3DkjUdxh2T3wo30HjK1YEAMWUmNywHh-TxliQmQZDs6sNYpeTMJa9wu-h4Q8z8G7E_ZeeN6nQrfQ6Kg850S1KmGCFQrXFjTGM7d2tduubz-HCkTRV1raXLUqQz0w" } } }, @@ -234,17 +233,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2588f47e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "211" + "x-ms-request-id": "8cec5c4a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "218" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, "key": { "e": "AQAB", @@ -256,9 +255,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/66c5d90435b302342c9770a07bd9e7bc", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/59f5bc286b31421e2dd3fc094e1e5298", "kty": "RSA-HSM", - "n": "iADMgqh21BxOIz2stm2MwURrKeQOBKcD4L8BaZkaktvuCyzTtcMPRNTPM5oVAxrMhxoBBjeDanF87MFC1LfnsvPcW3yi7-hdN5XHVQdFJF304oSIKD40A_ekUt0qcmaHkHLxWMLsh_NLoU-tUUteqbQbM3Ye7WKaIKDbjGx4k0HR99WV7aK2xbDoJz7NhhfDSq46e8Y6DsHV9edtEJZ8qXIISs_FRSZOqCI1Mgfy1gc35sOX1hyJBQSk7k3DzQlTZXsGZJi0JOGHrC0t0Efyi9ht0KYKjfApy_3aAOwR4ugiG-79wnPLRKyGSv-fNUnnXEVYQxoNflD-Aus_G7IJHw" + "n": "itlx41Wg7KLRLSFU83XMpOb8ZRPEQ18KgkEVs2CZQThlHWNOx9_KHb6RG7LZURLJiTSJZ_zMGxNHH_owWi4HM3Fae74oODBOSTJoItIrUXxUekw59pWwR0h35TmEw1oUeLIqFEEFZbqYj7p5e9kEbeh8-TLoOFoWWbvBI3lOYbCXb7K4MrTkEbpSaq72yE7lzIa1O3ETUgA6UyojnVi4cwtfKGGcQ77cM1C-z3WLK-enMBK-qoP0yqa6SCEXOhRMXtwZOljFbS1h2Rwlg5TgEJp2Xs2k9JK8I_ZOk1ck489avOGpY1TVws4QdQtA7cCJX30c3h7ZrM3COMXirsN0ow" } } }, @@ -285,55 +284,55 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "25b3fb9c-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "34" + "x-ms-request-id": "8d17ff8a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "32" }, "ResponseBody": { "value": [ { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325" }, { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325" }, { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325" }, { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325" } @@ -365,19 +364,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "25c3a088-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "138" + "x-ms-request-id": "8d2a5fd6-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "166" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, - "deletedDate": 1637185299, + "deletedDate": 1640018433, "key": { "e": "AQAB", "key_ops": [ @@ -388,12 +387,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/570deb623971413a3f61b09b6b54c8c5", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/d8799606235745320f44e731665738d1", "kty": "RSA-HSM", - "n": "jKjQ1J0vVJAeD-ezqJb3pCa91xrG5LeEGBmiGMyj2ShDvUL8Bl8HnkVZgZR3JE6X_HEikGI1igQBV9GftdRI4qE3S3mWcI2QnOtQ_GFJqS6yicPUkKuVpzcY3LvZmCmd9HXYu_xBwysvUoAmi7g0MTjjOdPRCNjhGmjI8wpKulIwoSWsoW75w5pELX7EDROT_4btT3m7GAjnkDiw8tA1wHnYEtd2bVh4jdaA9XM1TqAAMvGsUJsSDOOzTXm3oCI5bxqhf2u440j-_pl4LOsKOdIz4jxYAIpPhe7eRLq_QQJ2Bp4iHvPGIBdyVQ-2tKD4qBk15CYge_X4sfnrhRDThQ" + "n": "tHNHD8HcXakdPpLaYHD0QaH0_17O9vV6M3-XgFDxF2E3XOLybH3uHC4wbEeKcGXMeHBH1uaZJiLLTCbF2D9zh9cXKfY35Hj79wG1MCZlwypGueMd98Ua5gdkK7opR_zNlJCibWgwtbijCb0gDo2o5gbqZ8-v71q0-oTfbloM6wd0-OaH27Wlfq7ZHE1HuwxBCJ9AIyAvfqhteKrpsGEH03OggSY6XvZIChd-tTwWVTgvPijjcoWX8QQkWPi0DDqKunVT95yq8j-6HGteoSIdkPWWpu5SpD1z-hvW9mQWdKRC6AJ2n5aQYgjA-ORa7sgEs9uIB6YhNdwhswMNJuEs3Q" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-02357843325", - "scheduledPurgeDate": 1637790099 + "scheduledPurgeDate": 1640623233 } }, { @@ -419,22 +418,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "25e2f4ba-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "8d516fc2-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "33" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, - "deletedDate": 1637185299, + "deletedDate": 1640018433, "key": { "e": "AQAB", "key_ops": [ @@ -445,12 +444,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/570deb623971413a3f61b09b6b54c8c5", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/d8799606235745320f44e731665738d1", "kty": "RSA-HSM", - "n": "jKjQ1J0vVJAeD-ezqJb3pCa91xrG5LeEGBmiGMyj2ShDvUL8Bl8HnkVZgZR3JE6X_HEikGI1igQBV9GftdRI4qE3S3mWcI2QnOtQ_GFJqS6yicPUkKuVpzcY3LvZmCmd9HXYu_xBwysvUoAmi7g0MTjjOdPRCNjhGmjI8wpKulIwoSWsoW75w5pELX7EDROT_4btT3m7GAjnkDiw8tA1wHnYEtd2bVh4jdaA9XM1TqAAMvGsUJsSDOOzTXm3oCI5bxqhf2u440j-_pl4LOsKOdIz4jxYAIpPhe7eRLq_QQJ2Bp4iHvPGIBdyVQ-2tKD4qBk15CYge_X4sfnrhRDThQ" + "n": "tHNHD8HcXakdPpLaYHD0QaH0_17O9vV6M3-XgFDxF2E3XOLybH3uHC4wbEeKcGXMeHBH1uaZJiLLTCbF2D9zh9cXKfY35Hj79wG1MCZlwypGueMd98Ua5gdkK7opR_zNlJCibWgwtbijCb0gDo2o5gbqZ8-v71q0-oTfbloM6wd0-OaH27Wlfq7ZHE1HuwxBCJ9AIyAvfqhteKrpsGEH03OggSY6XvZIChd-tTwWVTgvPijjcoWX8QQkWPi0DDqKunVT95yq8j-6HGteoSIdkPWWpu5SpD1z-hvW9mQWdKRC6AJ2n5aQYgjA-ORa7sgEs9uIB6YhNdwhswMNJuEs3Q" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-02357843325", - "scheduledPurgeDate": 1637790099 + "scheduledPurgeDate": 1640623233 } }, { @@ -476,22 +475,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "25f22c82-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "8d60ec72-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "36" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, - "deletedDate": 1637185299, + "deletedDate": 1640018433, "key": { "e": "AQAB", "key_ops": [ @@ -502,12 +501,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/570deb623971413a3f61b09b6b54c8c5", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-02357843325/d8799606235745320f44e731665738d1", "kty": "RSA-HSM", - "n": "jKjQ1J0vVJAeD-ezqJb3pCa91xrG5LeEGBmiGMyj2ShDvUL8Bl8HnkVZgZR3JE6X_HEikGI1igQBV9GftdRI4qE3S3mWcI2QnOtQ_GFJqS6yicPUkKuVpzcY3LvZmCmd9HXYu_xBwysvUoAmi7g0MTjjOdPRCNjhGmjI8wpKulIwoSWsoW75w5pELX7EDROT_4btT3m7GAjnkDiw8tA1wHnYEtd2bVh4jdaA9XM1TqAAMvGsUJsSDOOzTXm3oCI5bxqhf2u440j-_pl4LOsKOdIz4jxYAIpPhe7eRLq_QQJ2Bp4iHvPGIBdyVQ-2tKD4qBk15CYge_X4sfnrhRDThQ" + "n": "tHNHD8HcXakdPpLaYHD0QaH0_17O9vV6M3-XgFDxF2E3XOLybH3uHC4wbEeKcGXMeHBH1uaZJiLLTCbF2D9zh9cXKfY35Hj79wG1MCZlwypGueMd98Ua5gdkK7opR_zNlJCibWgwtbijCb0gDo2o5gbqZ8-v71q0-oTfbloM6wd0-OaH27Wlfq7ZHE1HuwxBCJ9AIyAvfqhteKrpsGEH03OggSY6XvZIChd-tTwWVTgvPijjcoWX8QQkWPi0DDqKunVT95yq8j-6HGteoSIdkPWWpu5SpD1z-hvW9mQWdKRC6AJ2n5aQYgjA-ORa7sgEs9uIB6YhNdwhswMNJuEs3Q" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-02357843325", - "scheduledPurgeDate": 1637790099 + "scheduledPurgeDate": 1640623233 } }, { @@ -535,7 +534,7 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "26022f7e-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "8d70b8b4-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "112" }, "ResponseBody": null @@ -565,19 +564,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "261d851c-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "8d8c0a4c-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "138" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, - "deletedDate": 1637185300, + "deletedDate": 1640018434, "key": { "e": "AQAB", "key_ops": [ @@ -588,12 +587,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/e6f56436188e02bea1e468fda743a6a0", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/80560de730f10a35819f2fcdc0bde989", "kty": "RSA-HSM", - "n": "qCUfwlztuH1WYGpcz5yTinza32aOiMfp-bk6DDsNuh_026OleWpeuaxMKjh27U3l7X506Ouq59YszD9c7ajQdsp0Kj8XwK7if-obktmfYI5XI5MVBn_bs5vgVkkv6VElwaOzj4l9MyJfsMYM0x5KQi1KAN6SGtUSGrr402_9FwjePevnSiZ9aryMu-4hzWoprbCKcG2-PVjXUYEv3Um-FuZYq-NApGPnVrjqbVCkOtNJorMtt4lqIwNzAxhjrZ45vE795JyTEvlMpiVzCPJq3ii6E8xzX16o8V_TytPHBegziPj0Qnuaqi8ZYqWBXzWrjr45E5NeadDEmaYhNC9IgQ" + "n": "iCvkpvVMVp0DAMAK7ztQTcO09vRNkJTA4b2p7DmzWubSPkWciAaCqVyo059W_tekrhO2yw8fciVizKYhX0vSnffi6RvU_N9th40gCmdYL6UnuPnIDdW9pewDFBJXvB6VaWyZih0b8nLN4AjwooQlqV7H9EzwTn9iqk1_uVCEAWf956JK3tvmA4casAVtkqRrF5h6-_RLob9EH2ZN24TcOYilZrCjIeiGot5nnXYCCqGMFhc-XVa76kIgdl-O-_d6Ji3pR2icvZSUtI8_gt2UqvIfSGy1l5W38R2-pAdDdtSbP848osIQuiWnsd08DAHIgdAhmRDk_UtL8GOr0z-t2w" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-12357843325", - "scheduledPurgeDate": 1637790100 + "scheduledPurgeDate": 1640623234 } }, { @@ -619,22 +618,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "263cea24-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "34" + "x-ms-request-id": "8dadd370-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "37" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, - "deletedDate": 1637185300, + "deletedDate": 1640018434, "key": { "e": "AQAB", "key_ops": [ @@ -645,12 +644,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/e6f56436188e02bea1e468fda743a6a0", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/80560de730f10a35819f2fcdc0bde989", "kty": "RSA-HSM", - "n": "qCUfwlztuH1WYGpcz5yTinza32aOiMfp-bk6DDsNuh_026OleWpeuaxMKjh27U3l7X506Ouq59YszD9c7ajQdsp0Kj8XwK7if-obktmfYI5XI5MVBn_bs5vgVkkv6VElwaOzj4l9MyJfsMYM0x5KQi1KAN6SGtUSGrr402_9FwjePevnSiZ9aryMu-4hzWoprbCKcG2-PVjXUYEv3Um-FuZYq-NApGPnVrjqbVCkOtNJorMtt4lqIwNzAxhjrZ45vE795JyTEvlMpiVzCPJq3ii6E8xzX16o8V_TytPHBegziPj0Qnuaqi8ZYqWBXzWrjr45E5NeadDEmaYhNC9IgQ" + "n": "iCvkpvVMVp0DAMAK7ztQTcO09vRNkJTA4b2p7DmzWubSPkWciAaCqVyo059W_tekrhO2yw8fciVizKYhX0vSnffi6RvU_N9th40gCmdYL6UnuPnIDdW9pewDFBJXvB6VaWyZih0b8nLN4AjwooQlqV7H9EzwTn9iqk1_uVCEAWf956JK3tvmA4casAVtkqRrF5h6-_RLob9EH2ZN24TcOYilZrCjIeiGot5nnXYCCqGMFhc-XVa76kIgdl-O-_d6Ji3pR2icvZSUtI8_gt2UqvIfSGy1l5W38R2-pAdDdtSbP848osIQuiWnsd08DAHIgdAhmRDk_UtL8GOr0z-t2w" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-12357843325", - "scheduledPurgeDate": 1637790100 + "scheduledPurgeDate": 1640623234 } }, { @@ -676,22 +675,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "264c2b2e-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "35" + "x-ms-request-id": "8dbe024a-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "36" }, "ResponseBody": { "attributes": { - "created": 1637185298, + "created": 1640018432, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185298 + "updated": 1640018432 }, - "deletedDate": 1637185300, + "deletedDate": 1640018434, "key": { "e": "AQAB", "key_ops": [ @@ -702,12 +701,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/e6f56436188e02bea1e468fda743a6a0", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-12357843325/80560de730f10a35819f2fcdc0bde989", "kty": "RSA-HSM", - "n": "qCUfwlztuH1WYGpcz5yTinza32aOiMfp-bk6DDsNuh_026OleWpeuaxMKjh27U3l7X506Ouq59YszD9c7ajQdsp0Kj8XwK7if-obktmfYI5XI5MVBn_bs5vgVkkv6VElwaOzj4l9MyJfsMYM0x5KQi1KAN6SGtUSGrr402_9FwjePevnSiZ9aryMu-4hzWoprbCKcG2-PVjXUYEv3Um-FuZYq-NApGPnVrjqbVCkOtNJorMtt4lqIwNzAxhjrZ45vE795JyTEvlMpiVzCPJq3ii6E8xzX16o8V_TytPHBegziPj0Qnuaqi8ZYqWBXzWrjr45E5NeadDEmaYhNC9IgQ" + "n": "iCvkpvVMVp0DAMAK7ztQTcO09vRNkJTA4b2p7DmzWubSPkWciAaCqVyo059W_tekrhO2yw8fciVizKYhX0vSnffi6RvU_N9th40gCmdYL6UnuPnIDdW9pewDFBJXvB6VaWyZih0b8nLN4AjwooQlqV7H9EzwTn9iqk1_uVCEAWf956JK3tvmA4casAVtkqRrF5h6-_RLob9EH2ZN24TcOYilZrCjIeiGot5nnXYCCqGMFhc-XVa76kIgdl-O-_d6Ji3pR2icvZSUtI8_gt2UqvIfSGy1l5W38R2-pAdDdtSbP848osIQuiWnsd08DAHIgdAhmRDk_UtL8GOr0z-t2w" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-12357843325", - "scheduledPurgeDate": 1637790100 + "scheduledPurgeDate": 1640623234 } }, { @@ -735,8 +734,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "265ca99a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "112" + "x-ms-request-id": "8dcf18f0-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "118" }, "ResponseBody": null }, @@ -765,19 +764,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "26786e28-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "153" + "x-ms-request-id": "8deb7770-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "148" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, - "deletedDate": 1637185301, + "deletedDate": 1640018435, "key": { "e": "AQAB", "key_ops": [ @@ -788,12 +787,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/daaadf71ef6e412ab8025b3c01bb710b", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/46acf3b602230ba231e4998de496fb39", "kty": "RSA-HSM", - "n": "tT_vM4b4ek4EAl3fiDDKCERNUEisOux-9OqI6c-FVz7oGUpOc7Rsq6U94P54OSOlggglJsneSwoKE-zLHsDbmmydHUB3PxprC9c3g_dmpI_mvQyriZoLwI8XUST90VYwHOcNSIeCkrd0azvr-GHbW_ti-Rcr4ghzCaeZkiDUwPcXdUJ_zJ18FVRLhxblstJcL5bblbsZP0a4Qk8H3_EMyXg8I4NFHRWWFESUcXSiTTGR9GETNU_JR7KWuB7t_lGh2Qtrr823WcUyl0ksm4uzb6fWe0vhgSn2Df2Hkb6d-MvkL49GRmBQlxICdgWDhzcGAI8K14UXVp5Gulo3J9Jy_w" + "n": "uV4oR_Kg6rBuqT6g4TyhLNcy6oFE5czty6Nh7QQwm-jLmRajmdTrs6-Z_1hGo4DzYDB7fN73AnwYgO-b8w6LDxaStJP5qnc-sT9yhJ64gpjSTgY4qDNb9n54BlOUVBV1BfRVWZpkNUtOOdpe2qTtfQWSk1T4pAtXyc49BBD4anhLnB7UjS9IO6QwNPSz-4kN6NzWPqh9akpTxHfW7H8z20NL8T3DkjUdxh2T3wo30HjK1YEAMWUmNywHh-TxliQmQZDs6sNYpeTMJa9wu-h4Q8z8G7E_ZeeN6nQrfQ6Kg850S1KmGCFQrXFjTGM7d2tduubz-HCkTRV1raXLUqQz0w" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-22357843325", - "scheduledPurgeDate": 1637790101 + "scheduledPurgeDate": 1640623235 } }, { @@ -819,22 +818,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "2699fe1c-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "32" + "x-ms-request-id": "8e0cc8a8-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "28" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, - "deletedDate": 1637185301, + "deletedDate": 1640018435, "key": { "e": "AQAB", "key_ops": [ @@ -845,12 +844,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/daaadf71ef6e412ab8025b3c01bb710b", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/46acf3b602230ba231e4998de496fb39", "kty": "RSA-HSM", - "n": "tT_vM4b4ek4EAl3fiDDKCERNUEisOux-9OqI6c-FVz7oGUpOc7Rsq6U94P54OSOlggglJsneSwoKE-zLHsDbmmydHUB3PxprC9c3g_dmpI_mvQyriZoLwI8XUST90VYwHOcNSIeCkrd0azvr-GHbW_ti-Rcr4ghzCaeZkiDUwPcXdUJ_zJ18FVRLhxblstJcL5bblbsZP0a4Qk8H3_EMyXg8I4NFHRWWFESUcXSiTTGR9GETNU_JR7KWuB7t_lGh2Qtrr823WcUyl0ksm4uzb6fWe0vhgSn2Df2Hkb6d-MvkL49GRmBQlxICdgWDhzcGAI8K14UXVp5Gulo3J9Jy_w" + "n": "uV4oR_Kg6rBuqT6g4TyhLNcy6oFE5czty6Nh7QQwm-jLmRajmdTrs6-Z_1hGo4DzYDB7fN73AnwYgO-b8w6LDxaStJP5qnc-sT9yhJ64gpjSTgY4qDNb9n54BlOUVBV1BfRVWZpkNUtOOdpe2qTtfQWSk1T4pAtXyc49BBD4anhLnB7UjS9IO6QwNPSz-4kN6NzWPqh9akpTxHfW7H8z20NL8T3DkjUdxh2T3wo30HjK1YEAMWUmNywHh-TxliQmQZDs6sNYpeTMJa9wu-h4Q8z8G7E_ZeeN6nQrfQ6Kg850S1KmGCFQrXFjTGM7d2tduubz-HCkTRV1raXLUqQz0w" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-22357843325", - "scheduledPurgeDate": 1637790101 + "scheduledPurgeDate": 1640623235 } }, { @@ -876,22 +875,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "26a9200e-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "8e1b8a00-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "37" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, - "deletedDate": 1637185301, + "deletedDate": 1640018435, "key": { "e": "AQAB", "key_ops": [ @@ -902,12 +901,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/daaadf71ef6e412ab8025b3c01bb710b", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-22357843325/46acf3b602230ba231e4998de496fb39", "kty": "RSA-HSM", - "n": "tT_vM4b4ek4EAl3fiDDKCERNUEisOux-9OqI6c-FVz7oGUpOc7Rsq6U94P54OSOlggglJsneSwoKE-zLHsDbmmydHUB3PxprC9c3g_dmpI_mvQyriZoLwI8XUST90VYwHOcNSIeCkrd0azvr-GHbW_ti-Rcr4ghzCaeZkiDUwPcXdUJ_zJ18FVRLhxblstJcL5bblbsZP0a4Qk8H3_EMyXg8I4NFHRWWFESUcXSiTTGR9GETNU_JR7KWuB7t_lGh2Qtrr823WcUyl0ksm4uzb6fWe0vhgSn2Df2Hkb6d-MvkL49GRmBQlxICdgWDhzcGAI8K14UXVp5Gulo3J9Jy_w" + "n": "uV4oR_Kg6rBuqT6g4TyhLNcy6oFE5czty6Nh7QQwm-jLmRajmdTrs6-Z_1hGo4DzYDB7fN73AnwYgO-b8w6LDxaStJP5qnc-sT9yhJ64gpjSTgY4qDNb9n54BlOUVBV1BfRVWZpkNUtOOdpe2qTtfQWSk1T4pAtXyc49BBD4anhLnB7UjS9IO6QwNPSz-4kN6NzWPqh9akpTxHfW7H8z20NL8T3DkjUdxh2T3wo30HjK1YEAMWUmNywHh-TxliQmQZDs6sNYpeTMJa9wu-h4Q8z8G7E_ZeeN6nQrfQ6Kg850S1KmGCFQrXFjTGM7d2tduubz-HCkTRV1raXLUqQz0w" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-22357843325", - "scheduledPurgeDate": 1637790101 + "scheduledPurgeDate": 1640623235 } }, { @@ -935,8 +934,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "26b92d14-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "110" + "x-ms-request-id": "8e2ba462-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "122" }, "ResponseBody": null }, @@ -965,19 +964,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "26d4229a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "136" + "x-ms-request-id": "8e488f46-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "147" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, - "deletedDate": 1637185301, + "deletedDate": 1640018435, "key": { "e": "AQAB", "key_ops": [ @@ -988,12 +987,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/66c5d90435b302342c9770a07bd9e7bc", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/59f5bc286b31421e2dd3fc094e1e5298", "kty": "RSA-HSM", - "n": "iADMgqh21BxOIz2stm2MwURrKeQOBKcD4L8BaZkaktvuCyzTtcMPRNTPM5oVAxrMhxoBBjeDanF87MFC1LfnsvPcW3yi7-hdN5XHVQdFJF304oSIKD40A_ekUt0qcmaHkHLxWMLsh_NLoU-tUUteqbQbM3Ye7WKaIKDbjGx4k0HR99WV7aK2xbDoJz7NhhfDSq46e8Y6DsHV9edtEJZ8qXIISs_FRSZOqCI1Mgfy1gc35sOX1hyJBQSk7k3DzQlTZXsGZJi0JOGHrC0t0Efyi9ht0KYKjfApy_3aAOwR4ugiG-79wnPLRKyGSv-fNUnnXEVYQxoNflD-Aus_G7IJHw" + "n": "itlx41Wg7KLRLSFU83XMpOb8ZRPEQ18KgkEVs2CZQThlHWNOx9_KHb6RG7LZURLJiTSJZ_zMGxNHH_owWi4HM3Fae74oODBOSTJoItIrUXxUekw59pWwR0h35TmEw1oUeLIqFEEFZbqYj7p5e9kEbeh8-TLoOFoWWbvBI3lOYbCXb7K4MrTkEbpSaq72yE7lzIa1O3ETUgA6UyojnVi4cwtfKGGcQ77cM1C-z3WLK-enMBK-qoP0yqa6SCEXOhRMXtwZOljFbS1h2Rwlg5TgEJp2Xs2k9JK8I_ZOk1ck489avOGpY1TVws4QdQtA7cCJX30c3h7ZrM3COMXirsN0ow" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-32357843325", - "scheduledPurgeDate": 1637790101 + "scheduledPurgeDate": 1640623235 } }, { @@ -1019,22 +1018,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "26f31d76-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "37" + "x-ms-request-id": "8e696ec8-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "34" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, - "deletedDate": 1637185301, + "deletedDate": 1640018435, "key": { "e": "AQAB", "key_ops": [ @@ -1045,12 +1044,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/66c5d90435b302342c9770a07bd9e7bc", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/59f5bc286b31421e2dd3fc094e1e5298", "kty": "RSA-HSM", - "n": "iADMgqh21BxOIz2stm2MwURrKeQOBKcD4L8BaZkaktvuCyzTtcMPRNTPM5oVAxrMhxoBBjeDanF87MFC1LfnsvPcW3yi7-hdN5XHVQdFJF304oSIKD40A_ekUt0qcmaHkHLxWMLsh_NLoU-tUUteqbQbM3Ye7WKaIKDbjGx4k0HR99WV7aK2xbDoJz7NhhfDSq46e8Y6DsHV9edtEJZ8qXIISs_FRSZOqCI1Mgfy1gc35sOX1hyJBQSk7k3DzQlTZXsGZJi0JOGHrC0t0Efyi9ht0KYKjfApy_3aAOwR4ugiG-79wnPLRKyGSv-fNUnnXEVYQxoNflD-Aus_G7IJHw" + "n": "itlx41Wg7KLRLSFU83XMpOb8ZRPEQ18KgkEVs2CZQThlHWNOx9_KHb6RG7LZURLJiTSJZ_zMGxNHH_owWi4HM3Fae74oODBOSTJoItIrUXxUekw59pWwR0h35TmEw1oUeLIqFEEFZbqYj7p5e9kEbeh8-TLoOFoWWbvBI3lOYbCXb7K4MrTkEbpSaq72yE7lzIa1O3ETUgA6UyojnVi4cwtfKGGcQ77cM1C-z3WLK-enMBK-qoP0yqa6SCEXOhRMXtwZOljFbS1h2Rwlg5TgEJp2Xs2k9JK8I_ZOk1ck489avOGpY1TVws4QdQtA7cCJX30c3h7ZrM3COMXirsN0ow" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-32357843325", - "scheduledPurgeDate": 1637790101 + "scheduledPurgeDate": 1640623235 } }, { @@ -1076,22 +1075,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "27030402-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "32" + "x-ms-request-id": "8e79000e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "31" }, "ResponseBody": { "attributes": { - "created": 1637185299, + "created": 1640018433, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185299 + "updated": 1640018433 }, - "deletedDate": 1637185301, + "deletedDate": 1640018435, "key": { "e": "AQAB", "key_ops": [ @@ -1102,12 +1101,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/66c5d90435b302342c9770a07bd9e7bc", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key-32357843325/59f5bc286b31421e2dd3fc094e1e5298", "kty": "RSA-HSM", - "n": "iADMgqh21BxOIz2stm2MwURrKeQOBKcD4L8BaZkaktvuCyzTtcMPRNTPM5oVAxrMhxoBBjeDanF87MFC1LfnsvPcW3yi7-hdN5XHVQdFJF304oSIKD40A_ekUt0qcmaHkHLxWMLsh_NLoU-tUUteqbQbM3Ye7WKaIKDbjGx4k0HR99WV7aK2xbDoJz7NhhfDSq46e8Y6DsHV9edtEJZ8qXIISs_FRSZOqCI1Mgfy1gc35sOX1hyJBQSk7k3DzQlTZXsGZJi0JOGHrC0t0Efyi9ht0KYKjfApy_3aAOwR4ugiG-79wnPLRKyGSv-fNUnnXEVYQxoNflD-Aus_G7IJHw" + "n": "itlx41Wg7KLRLSFU83XMpOb8ZRPEQ18KgkEVs2CZQThlHWNOx9_KHb6RG7LZURLJiTSJZ_zMGxNHH_owWi4HM3Fae74oODBOSTJoItIrUXxUekw59pWwR0h35TmEw1oUeLIqFEEFZbqYj7p5e9kEbeh8-TLoOFoWWbvBI3lOYbCXb7K4MrTkEbpSaq72yE7lzIa1O3ETUgA6UyojnVi4cwtfKGGcQ77cM1C-z3WLK-enMBK-qoP0yqa6SCEXOhRMXtwZOljFbS1h2Rwlg5TgEJp2Xs2k9JK8I_ZOk1ck489avOGpY1TVws4QdQtA7cCJX30c3h7ZrM3COMXirsN0ow" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key-32357843325", - "scheduledPurgeDate": 1637790101 + "scheduledPurgeDate": 1640623235 } }, { @@ -1135,7 +1134,7 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "27124a98-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "8e881d64-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "112" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_NON-HSM.json index 8a29d43afc05..a0adeb40dd1e 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestListKeys/TestListKeys_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:25 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -28,8 +27,8 @@ "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4fb28dfc-1799-4c51-b53c-fdf968274867", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "641101df-698b-4c9b-b81f-646a9c84a1d6", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -63,20 +62,20 @@ "Cache-Control": "no-cache", "Content-Length": "688", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:24 GMT", + "Date": "Mon, 20 Dec 2021 16:40:25 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "6eb5ab23-99dc-4e02-893e-cd7db6912ec1", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "31671314-6ddd-4d53-9f19-5da5153dac92", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-0173508775/3dc23b1854e049d28a58626d2d199fbc", + "kid": "https://fakekvurl.vault.azure.net/keys/key-0173508775/1cce599655e54f108760694599a93d03", "kty": "RSA", "key_ops": [ "encrypt", @@ -86,13 +85,13 @@ "wrapKey", "unwrapKey" ], - "n": "w6FKVTuJajjVotMxIHN17fS0Ndc_3TfgDpxcwDKZoEXqeQshg1flG5A9NM8IJ76y-5rUG2HJy3wC06SEPr75Q3K7WDKJQJrwKkn0chUraPnP4952k-Vr3wSfAFfj5ko_aVAi4kPdSHnXQulWCB1qYay4oKd73gttD26BW3O1ZGvbTh7APs_oVUlb1Hal7SunSlTmK1VqWQwcPyh_eiW48ID2J8QPQiUvQfliagl-UX2pJTP5XJVmpfKenZgqtW4QBOuHjGIXCqcQRMshgZePOhxAWkPx5DRMmCLhNb9BqbAtRyrxKilFfH850bQaatPJXUzkfLFWSaiu21v_AvARHQ", + "n": "x9LV3wUMRWpu-2pcZivTtCNjuiZT9T-B0A7yghkY--m4sHxsM3nSPE35_W25ZUA7UqoFiTYWDtIPm1vjK8Wmvt2f1CJjFLRLHEixW2vAVEWtoi8PH9R8hmICKvvYMv_CgWPxINIKVDoEc49Xr-lf6PWO5wFqriucqPQWlR2xs35ZJW_mZ04mBOVlPoXBmZN2TA0H5edmkUOlsaszFtFPH7dvrccs1IV4NoCcnQiiz1XG_09u4OLK2XGlaTnM4LDT4CFKwt9TZgsbTeXaWaumWtDuF4LRE3aZamxHfdmEoxRnEHpP1EgL0kodt2XrhpxH8rOYZihbBR8uNfWPN6CdNQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -122,20 +121,20 @@ "Cache-Control": "no-cache", "Content-Length": "688", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "ef086875-4834-4880-b3f1-d0f6fedd91dd", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "02ed0871-47d4-46ac-b239-aed418adbbcf", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-1173508775/f992eb681e21481aa56c6e17f6717919", + "kid": "https://fakekvurl.vault.azure.net/keys/key-1173508775/0f9dd244b1bb4174ac06ab07c186ffcc", "kty": "RSA", "key_ops": [ "encrypt", @@ -145,13 +144,13 @@ "wrapKey", "unwrapKey" ], - "n": "nXIq1gQCXRHUJmlb7vUCotXuyJMljR25mnQt_iYCDcHYusvPBoV40XhkBxdaFPdp_gG96hBA4AHRhQfovLHkwS8EL2YoF9rDXDIisfoGqjgP_3_yN_0CrLlUW4aVd1PfDtBXRWhElmfQjoTXfiCRx1nq0kAR80C4Td8f4NxjGygWdch_VxVXFqNFlWcEZQzn0Yf2PI9YXdJgwqlOaeMAIDMxgMKRV5r5hF7b_7gA8bZGtjBDpl2KczoRaFo6gHeDVNR52NM32OYrIrsp5ROEDXsaA536oxIiVhABPZrVgRw4-a9sL27jnGjiHr_6Sd82bskzIG5Q3t57R5-L7hcM4Q", + "n": "tgpHUYrM54mn5kZr0tf9tB4LJrfhhAqvUj8QhDO2HWag-2DSw_yhG6QXYbmy7ufG3Ybp6ASrKGXAlSNZrKXaX-7L7b6LAH4BnA7dQL_Tod4X3qxTnd8-PhhysMnRf-NnVtJb8x-in2qd0gkPO3M3BrxqlwrWOoWRtgJCCC7e1ib5cf6LMO56_VhuiLHS6ddn7hJHoPkrhW6Sn4Mvw969MhQ-0wA4Q3D7HvAp-UkjU21bPraIw_6xGsQedQUfWCgfuBVsT1m8i6ZeitffubsrNMQF19cG9V1bslGDfQIv3lI_Ukt9lkjB6Pi-5Cn7TODoUdy_UrgHORtkQeVBFLyDGQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -181,20 +180,20 @@ "Cache-Control": "no-cache", "Content-Length": "688", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "71549fee-ce2b-414e-8bf6-1085601d3ce0", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "8437b02a-2d5a-4b43-a8a4-25d83d4c5e79", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-2173508775/9f05342261a84e09af278eb302774179", + "kid": "https://fakekvurl.vault.azure.net/keys/key-2173508775/a5bb8cb14929481da42379316cf1a841", "kty": "RSA", "key_ops": [ "encrypt", @@ -204,13 +203,13 @@ "wrapKey", "unwrapKey" ], - "n": "usxmkWGUQdBYdjk7-BCCgTnLylG8fE6YorjPX4ip7p3LZjXtF3PL2MsbpxscCocKpYGBocaESyNl_MTDylblDpDYoLY06SJf0C3SRuMVwt_RzjwT1AnM58jZJyld5ueGDvVHa33x17RKYVa1tTfE30LqN_djwIso_i6wBzJrPMlBhALZE7nTfkIGLo1QWL988fFbNbFzSBSFGgwv5k5rPhK2_exFbRSeWg9xh19oTV6ltqcx1gDRGm9xDFJgepUGLJc98r0mR9AsaoBkBYfJn7vtXk0gdGBQRsqsWaSwrRFetf-MKQf37ZKdG1M4Z9QFQiAHmtRP9N6Mbcad2_lYrQ", + "n": "sKiMFwzTIEXKHV1C1AJOllEG6SHfr6D05Us5y2K7b5zBPnJJ3zmf0DcKsGH3rYwthVKuQ25MxVVHbTwe_MgeYFnVPMtAAD02gFD6oBoPQonyBTllxT2zVuSrgT_SM0CSYetZSt2jvJcASZflIAG_zZmBh4UF0OKjtduMfHn_yK8aQ0BcA3XFox4922QsRPHZaCiDPM5v7yv__T4okX2e4tje9XJn0N3smaRfxZgoB7Gjs0pFaKdUPVw_-ga7v041gP2YZAE0u_AHX00gliBojf85Kapcrnck09qVPdjruhP1by1G5DOvJK8TRgqdFcAM4uOzi_hoJm-AE1z9w0z-lQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185286, - "updated": 1637185286, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -240,20 +239,20 @@ "Cache-Control": "no-cache", "Content-Length": "688", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7855b150-804c-4f99-b5fd-c55582760cd0", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "676a1e34-9b18-4c08-82f4-b441e51a8520", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-3173508775/4a101643c9b34f9994b0980e19f37990", + "kid": "https://fakekvurl.vault.azure.net/keys/key-3173508775/07116999a7df49ce8527d72256da2e5d", "kty": "RSA", "key_ops": [ "encrypt", @@ -263,13 +262,13 @@ "wrapKey", "unwrapKey" ], - "n": "wUl0WOtkP4ZREXiLUpuOC7G9I-pmQxo9UEcnMdKfsCSfubgdZPKm722njiD4AZ6T-fpUMXvhnjeSHlCOu7R4ZbrcaB3eFaGviWSTTtbJbg6TMAPjiYAtHtMmfKhy0xsnNFj9uzyYJ-7I3m1RP3eZ2NQ0EnVW8rzssJQQKT52N8lLeM9ertrP-OWWVohSfQxtBVVo3wqYegChvf3yxAgyzPQXOjAWGaiuRToFbsmY8srF9lwsnlhSzqv1U9-nXk9rQDJvuwe9O1C1TPYcaJa05_Ben-RzKYH9K275UPYCw9TRPG6taKdc7OuTG7VEUPy7O3_k7PyiFJXKSgmTcMA5nQ", + "n": "vE2R85U2EXNhGxJv5lMVpt59iGJzemA_VGLZE0O42gkMiJYelDejhFRdNktYbkierAjKaGqkdEvYTfIg-3xlmd8Cz089vNnOTZr8KglLT06wUyV-FTciFAm6tqPVJWtyrBn5HpB6n7nYjqcUq1OK3tqOxG7fyS3PtOqyts-wyo4iWszSCiWF0Tdzt8mwrfitKsd7zGJruz7Sh3seORzBeu2wRMFoNiDeswOn1YMT-YKDWN6I4pQ3NLvNiJu9Bztj_QscybhRvIammR0h2U5t6XuCG9rDC86ga88xHXV0Qq44a3z9pRSY2QB4Xf-4UReUAhu2NC6om_ZS7-hRdfhX8Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185286, - "updated": 1637185286, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -294,15 +293,15 @@ "Cache-Control": "no-cache", "Content-Length": "843", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "bdbf96c0-0285-404e-848b-945588513b02", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "19e3cce2-5497-4384-baea-bcb82e8d7992", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -311,8 +310,8 @@ "kid": "https://rosebud.vault.azure.net/keys/key-0173508775", "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -321,8 +320,8 @@ "kid": "https://rosebud.vault.azure.net/keys/key-1173508775", "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -331,8 +330,8 @@ "kid": "https://rosebud.vault.azure.net/keys/key-2173508775", "attributes": { "enabled": true, - "created": 1637185286, - "updated": 1637185286, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -341,8 +340,8 @@ "kid": "https://rosebud.vault.azure.net/keys/key-3173508775", "attributes": { "enabled": true, - "created": 1637185286, - "updated": 1637185286, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -370,23 +369,23 @@ "Cache-Control": "no-cache", "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:25 GMT", + "Date": "Mon, 20 Dec 2021 16:40:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "39539ac0-51a0-4dca-aa24-1390f39f5157", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "a571fe45-22be-449d-8514-cfc9c7e74e51", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-0173508775", - "deletedDate": 1637185286, - "scheduledPurgeDate": 1637790086, + "deletedDate": 1640018427, + "scheduledPurgeDate": 1640623227, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-0173508775/3dc23b1854e049d28a58626d2d199fbc", + "kid": "https://fakekvurl.vault.azure.net/keys/key-0173508775/1cce599655e54f108760694599a93d03", "kty": "RSA", "key_ops": [ "encrypt", @@ -396,13 +395,13 @@ "wrapKey", "unwrapKey" ], - "n": "w6FKVTuJajjVotMxIHN17fS0Ndc_3TfgDpxcwDKZoEXqeQshg1flG5A9NM8IJ76y-5rUG2HJy3wC06SEPr75Q3K7WDKJQJrwKkn0chUraPnP4952k-Vr3wSfAFfj5ko_aVAi4kPdSHnXQulWCB1qYay4oKd73gttD26BW3O1ZGvbTh7APs_oVUlb1Hal7SunSlTmK1VqWQwcPyh_eiW48ID2J8QPQiUvQfliagl-UX2pJTP5XJVmpfKenZgqtW4QBOuHjGIXCqcQRMshgZePOhxAWkPx5DRMmCLhNb9BqbAtRyrxKilFfH850bQaatPJXUzkfLFWSaiu21v_AvARHQ", + "n": "x9LV3wUMRWpu-2pcZivTtCNjuiZT9T-B0A7yghkY--m4sHxsM3nSPE35_W25ZUA7UqoFiTYWDtIPm1vjK8Wmvt2f1CJjFLRLHEixW2vAVEWtoi8PH9R8hmICKvvYMv_CgWPxINIKVDoEc49Xr-lf6PWO5wFqriucqPQWlR2xs35ZJW_mZ04mBOVlPoXBmZN2TA0H5edmkUOlsaszFtFPH7dvrccs1IV4NoCcnQiiz1XG_09u4OLK2XGlaTnM4LDT4CFKwt9TZgsbTeXaWaumWtDuF4LRE3aZamxHfdmEoxRnEHpP1EgL0kodt2XrhpxH8rOYZihbBR8uNfWPN6CdNQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -427,163 +426,15 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "96ba89cb-1f71-4eb2-b085-a46733daa253", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-0173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-0173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-0173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "8ea70c54-4eed-4035-9087-c3130796bf2b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-0173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-0173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-0173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "bcb28713-1254-4681-9270-ac45d313ec49", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-0173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-0173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-0173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:26 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "f855829c-72a4-460d-8e08-2790f20345b2", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-0173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-0173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-0173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:27 GMT", + "Date": "Mon, 20 Dec 2021 16:40:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "65a65e1e-8f93-42ea-8c4f-0fb98b652247", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "04163d03-0077-4ca0-a441-158255fa57d4", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -612,15 +463,15 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:27 GMT", + "Date": "Mon, 20 Dec 2021 16:40:26 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "d30ef711-9f2a-4543-8a31-db2b67e0f9aa", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "2c4d2c03-1fdb-4af3-8b01-9cd2986b828d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -649,23 +500,23 @@ "Cache-Control": "no-cache", "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:27 GMT", + "Date": "Mon, 20 Dec 2021 16:40:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "2e2f4e24-55fa-458f-9a31-d680ee82434c", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "e9490690-e855-4836-9ae3-9f779066ae11", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-0173508775", - "deletedDate": 1637185286, - "scheduledPurgeDate": 1637790086, + "deletedDate": 1640018427, + "scheduledPurgeDate": 1640623227, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-0173508775/3dc23b1854e049d28a58626d2d199fbc", + "kid": "https://fakekvurl.vault.azure.net/keys/key-0173508775/1cce599655e54f108760694599a93d03", "kty": "RSA", "key_ops": [ "encrypt", @@ -675,13 +526,13 @@ "wrapKey", "unwrapKey" ], - "n": "w6FKVTuJajjVotMxIHN17fS0Ndc_3TfgDpxcwDKZoEXqeQshg1flG5A9NM8IJ76y-5rUG2HJy3wC06SEPr75Q3K7WDKJQJrwKkn0chUraPnP4952k-Vr3wSfAFfj5ko_aVAi4kPdSHnXQulWCB1qYay4oKd73gttD26BW3O1ZGvbTh7APs_oVUlb1Hal7SunSlTmK1VqWQwcPyh_eiW48ID2J8QPQiUvQfliagl-UX2pJTP5XJVmpfKenZgqtW4QBOuHjGIXCqcQRMshgZePOhxAWkPx5DRMmCLhNb9BqbAtRyrxKilFfH850bQaatPJXUzkfLFWSaiu21v_AvARHQ", + "n": "x9LV3wUMRWpu-2pcZivTtCNjuiZT9T-B0A7yghkY--m4sHxsM3nSPE35_W25ZUA7UqoFiTYWDtIPm1vjK8Wmvt2f1CJjFLRLHEixW2vAVEWtoi8PH9R8hmICKvvYMv_CgWPxINIKVDoEc49Xr-lf6PWO5wFqriucqPQWlR2xs35ZJW_mZ04mBOVlPoXBmZN2TA0H5edmkUOlsaszFtFPH7dvrccs1IV4NoCcnQiiz1XG_09u4OLK2XGlaTnM4LDT4CFKwt9TZgsbTeXaWaumWtDuF4LRE3aZamxHfdmEoxRnEHpP1EgL0kodt2XrhpxH8rOYZihbBR8uNfWPN6CdNQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -704,15 +555,15 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Wed, 17 Nov 2021 21:41:29 GMT", + "Date": "Mon, 20 Dec 2021 16:40:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "f9444110-86a4-424e-a527-1849157b18c3", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "f5edd24a-2381-48e1-9d13-b36b0c30ba75", "X-Powered-By": "ASP.NET" }, "ResponseBody": null @@ -736,23 +587,23 @@ "Cache-Control": "no-cache", "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:29 GMT", + "Date": "Mon, 20 Dec 2021 16:40:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "166a7487-4663-49a7-be0e-2cdf6755adb4", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "8bf4b093-77f6-4f76-be10-6312d6805659", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775", - "deletedDate": 1637185289, - "scheduledPurgeDate": 1637790089, + "deletedDate": 1640018428, + "scheduledPurgeDate": 1640623228, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-1173508775/f992eb681e21481aa56c6e17f6717919", + "kid": "https://fakekvurl.vault.azure.net/keys/key-1173508775/0f9dd244b1bb4174ac06ab07c186ffcc", "kty": "RSA", "key_ops": [ "encrypt", @@ -762,13 +613,13 @@ "wrapKey", "unwrapKey" ], - "n": "nXIq1gQCXRHUJmlb7vUCotXuyJMljR25mnQt_iYCDcHYusvPBoV40XhkBxdaFPdp_gG96hBA4AHRhQfovLHkwS8EL2YoF9rDXDIisfoGqjgP_3_yN_0CrLlUW4aVd1PfDtBXRWhElmfQjoTXfiCRx1nq0kAR80C4Td8f4NxjGygWdch_VxVXFqNFlWcEZQzn0Yf2PI9YXdJgwqlOaeMAIDMxgMKRV5r5hF7b_7gA8bZGtjBDpl2KczoRaFo6gHeDVNR52NM32OYrIrsp5ROEDXsaA536oxIiVhABPZrVgRw4-a9sL27jnGjiHr_6Sd82bskzIG5Q3t57R5-L7hcM4Q", + "n": "tgpHUYrM54mn5kZr0tf9tB4LJrfhhAqvUj8QhDO2HWag-2DSw_yhG6QXYbmy7ufG3Ybp6ASrKGXAlSNZrKXaX-7L7b6LAH4BnA7dQL_Tod4X3qxTnd8-PhhysMnRf-NnVtJb8x-in2qd0gkPO3M3BrxqlwrWOoWRtgJCCC7e1ib5cf6LMO56_VhuiLHS6ddn7hJHoPkrhW6Sn4Mvw969MhQ-0wA4Q3D7HvAp-UkjU21bPraIw_6xGsQedQUfWCgfuBVsT1m8i6ZeitffubsrNMQF19cG9V1bslGDfQIv3lI_Ukt9lkjB6Pi-5Cn7TODoUdy_UrgHORtkQeVBFLyDGQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -793,15 +644,15 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:29 GMT", + "Date": "Mon, 20 Dec 2021 16:40:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4749d81d-50ce-4422-a690-3f816fc8eb47", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "1c2d20ad-3900-4a88-9692-3adb824c4138", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -830,15 +681,15 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:29 GMT", + "Date": "Mon, 20 Dec 2021 16:40:27 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "b8624dad-5c6f-48ef-9732-6d66795fc93b", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "5aee98c0-2e62-49a9-a632-35791ed6a927", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -862,35 +713,55 @@ "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, - "StatusCode": 404, + "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "82", + "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:29 GMT", + "Date": "Mon, 20 Dec 2021 16:40:28 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "df9a205a-184d-4317-9046-963de9d04359", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "92a661df-cc33-4b68-a379-b6d5cbb7a23a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775", + "deletedDate": 1640018428, + "scheduledPurgeDate": 1640623228, + "key": { + "kid": "https://fakekvurl.vault.azure.net/keys/key-1173508775/0f9dd244b1bb4174ac06ab07c186ffcc", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "tgpHUYrM54mn5kZr0tf9tB4LJrfhhAqvUj8QhDO2HWag-2DSw_yhG6QXYbmy7ufG3Ybp6ASrKGXAlSNZrKXaX-7L7b6LAH4BnA7dQL_Tod4X3qxTnd8-PhhysMnRf-NnVtJb8x-in2qd0gkPO3M3BrxqlwrWOoWRtgJCCC7e1ib5cf6LMO56_VhuiLHS6ddn7hJHoPkrhW6Sn4Mvw969MhQ-0wA4Q3D7HvAp-UkjU21bPraIw_6xGsQedQUfWCgfuBVsT1m8i6ZeitffubsrNMQF19cG9V1bslGDfQIv3lI_Ukt9lkjB6Pi-5Cn7TODoUdy_UrgHORtkQeVBFLyDGQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1640018426, + "updated": 1640018426, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 } } }, { "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", - "RequestMethod": "GET", + "RequestMethod": "DELETE", "RequestHeaders": { ":authority": "localhost:5001", - ":method": "GET", + ":method": "DELETE", ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", @@ -899,36 +770,29 @@ "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, - "StatusCode": 404, + "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:30 GMT", + "Date": "Mon, 20 Dec 2021 16:40:28 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "75890b6f-45ad-42af-9c30-d58a44d47947", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "11162e57-96b8-449d-a640-d11a508d9afa", "X-Powered-By": "ASP.NET" }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" - } - } + "ResponseBody": null }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", - "RequestMethod": "GET", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key-2173508775?api-version=7.3-preview", + "RequestMethod": "DELETE", "RequestHeaders": { ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":method": "DELETE", + ":path": "/keys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -936,36 +800,56 @@ "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, - "StatusCode": 404, + "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "82", + "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:30 GMT", + "Date": "Mon, 20 Dec 2021 16:40:28 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "1a2c2465-22c0-49be-bcf7-08a11ddef63a", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "7dd4568e-4761-4baa-a763-1fb77398373a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775", + "deletedDate": 1640018428, + "scheduledPurgeDate": 1640623228, + "key": { + "kid": "https://fakekvurl.vault.azure.net/keys/key-2173508775/a5bb8cb14929481da42379316cf1a841", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "sKiMFwzTIEXKHV1C1AJOllEG6SHfr6D05Us5y2K7b5zBPnJJ3zmf0DcKsGH3rYwthVKuQ25MxVVHbTwe_MgeYFnVPMtAAD02gFD6oBoPQonyBTllxT2zVuSrgT_SM0CSYetZSt2jvJcASZflIAG_zZmBh4UF0OKjtduMfHn_yK8aQ0BcA3XFox4922QsRPHZaCiDPM5v7yv__T4okX2e4tje9XJn0N3smaRfxZgoB7Gjs0pFaKdUPVw_-ga7v041gP2YZAE0u_AHX00gliBojf85Kapcrnck09qVPdjruhP1by1G5DOvJK8TRgqdFcAM4uOzi_hoJm-AE1z9w0z-lQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1640018426, + "updated": 1640018426, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -978,31 +862,31 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:30 GMT", + "Date": "Mon, 20 Dec 2021 16:40:28 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "55d79580-9ba6-4672-b162-3393d355a293", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "77299766-3b69-4162-be60-e0c55b9d7ebf", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" + "message": "Deleted Key not found: key-2173508775" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -1015,31 +899,31 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:31 GMT", + "Date": "Mon, 20 Dec 2021 16:40:28 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4cebd96b-96a2-42af-8b3b-ee7adcf421ff", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "400e4cd2-8438-4289-ab4d-ac614078aa7a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" + "message": "Deleted Key not found: key-2173508775" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -1052,31 +936,31 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:31 GMT", + "Date": "Mon, 20 Dec 2021 16:40:28 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "b0dc2104-02a4-46a2-91b2-099d11244eed", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "a9545093-c52a-49b2-8069-4d0c54d728af", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" + "message": "Deleted Key not found: key-2173508775" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -1089,31 +973,31 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:32 GMT", + "Date": "Mon, 20 Dec 2021 16:40:29 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "e3c12d43-eac3-417e-82f0-56d48e365849", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "ffa3d4e2-8fab-4e3f-8b83-c80ada634161", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" + "message": "Deleted Key not found: key-2173508775" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -1126,31 +1010,31 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:32 GMT", + "Date": "Mon, 20 Dec 2021 16:40:29 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "e4414e89-303d-4a77-9ff9-d25a6c5e324d", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "02577bb1-c4e7-4f5a-b727-f18225677246", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "Deleted Key not found: key-1173508775" + "message": "Deleted Key not found: key-2173508775" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -1163,23 +1047,23 @@ "Cache-Control": "no-cache", "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:32 GMT", + "Date": "Mon, 20 Dec 2021 16:40:29 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "425a41c7-1643-4c02-87ce-211a1f0d21a4", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "77f23c86-87bc-43ef-83e3-07caea9791ca", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775", - "deletedDate": 1637185289, - "scheduledPurgeDate": 1637790089, + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775", + "deletedDate": 1640018428, + "scheduledPurgeDate": 1640623228, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-1173508775/f992eb681e21481aa56c6e17f6717919", + "kid": "https://fakekvurl.vault.azure.net/keys/key-2173508775/a5bb8cb14929481da42379316cf1a841", "kty": "RSA", "key_ops": [ "encrypt", @@ -1189,25 +1073,25 @@ "wrapKey", "unwrapKey" ], - "n": "nXIq1gQCXRHUJmlb7vUCotXuyJMljR25mnQt_iYCDcHYusvPBoV40XhkBxdaFPdp_gG96hBA4AHRhQfovLHkwS8EL2YoF9rDXDIisfoGqjgP_3_yN_0CrLlUW4aVd1PfDtBXRWhElmfQjoTXfiCRx1nq0kAR80C4Td8f4NxjGygWdch_VxVXFqNFlWcEZQzn0Yf2PI9YXdJgwqlOaeMAIDMxgMKRV5r5hF7b_7gA8bZGtjBDpl2KczoRaFo6gHeDVNR52NM32OYrIrsp5ROEDXsaA536oxIiVhABPZrVgRw4-a9sL27jnGjiHr_6Sd82bskzIG5Q3t57R5-L7hcM4Q", + "n": "sKiMFwzTIEXKHV1C1AJOllEG6SHfr6D05Us5y2K7b5zBPnJJ3zmf0DcKsGH3rYwthVKuQ25MxVVHbTwe_MgeYFnVPMtAAD02gFD6oBoPQonyBTllxT2zVuSrgT_SM0CSYetZSt2jvJcASZflIAG_zZmBh4UF0OKjtduMfHn_yK8aQ0BcA3XFox4922QsRPHZaCiDPM5v7yv__T4okX2e4tje9XJn0N3smaRfxZgoB7Gjs0pFaKdUPVw_-ga7v041gP2YZAE0u_AHX00gliBojf85Kapcrnck09qVPdjruhP1by1G5DOvJK8TRgqdFcAM4uOzi_hoJm-AE1z9w0z-lQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185285, - "updated": 1637185285, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-1173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", "RequestMethod": "DELETE", "RequestHeaders": { ":authority": "localhost:5001", ":method": "DELETE", - ":path": "/deletedkeys/key-1173508775?api-version=7.3-preview", + ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -1218,26 +1102,26 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Wed, 17 Nov 2021 21:41:32 GMT", + "Date": "Mon, 20 Dec 2021 16:40:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7fd7ad35-8e8e-4d05-87a4-304582583342", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "e07fbc41-a79a-4a79-acc3-40f025fe9b12", "X-Powered-By": "ASP.NET" }, "ResponseBody": null }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key-2173508775?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key-3173508775?api-version=7.3-preview", "RequestMethod": "DELETE", "RequestHeaders": { ":authority": "localhost:5001", ":method": "DELETE", - ":path": "/keys/key-2173508775?api-version=7.3-preview", + ":path": "/keys/key-3173508775?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -1250,23 +1134,23 @@ "Cache-Control": "no-cache", "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:33 GMT", + "Date": "Mon, 20 Dec 2021 16:40:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "627957cf-47ff-4940-bcaa-93354f7471d6", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "977ce993-ab50-4791-9e15-1148630ec4cc", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775", - "deletedDate": 1637185293, - "scheduledPurgeDate": 1637790093, + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-3173508775", + "deletedDate": 1640018430, + "scheduledPurgeDate": 1640623230, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-2173508775/9f05342261a84e09af278eb302774179", + "kid": "https://fakekvurl.vault.azure.net/keys/key-3173508775/07116999a7df49ce8527d72256da2e5d", "kty": "RSA", "key_ops": [ "encrypt", @@ -1276,532 +1160,18 @@ "wrapKey", "unwrapKey" ], - "n": "usxmkWGUQdBYdjk7-BCCgTnLylG8fE6YorjPX4ip7p3LZjXtF3PL2MsbpxscCocKpYGBocaESyNl_MTDylblDpDYoLY06SJf0C3SRuMVwt_RzjwT1AnM58jZJyld5ueGDvVHa33x17RKYVa1tTfE30LqN_djwIso_i6wBzJrPMlBhALZE7nTfkIGLo1QWL988fFbNbFzSBSFGgwv5k5rPhK2_exFbRSeWg9xh19oTV6ltqcx1gDRGm9xDFJgepUGLJc98r0mR9AsaoBkBYfJn7vtXk0gdGBQRsqsWaSwrRFetf-MKQf37ZKdG1M4Z9QFQiAHmtRP9N6Mbcad2_lYrQ", + "n": "vE2R85U2EXNhGxJv5lMVpt59iGJzemA_VGLZE0O42gkMiJYelDejhFRdNktYbkierAjKaGqkdEvYTfIg-3xlmd8Cz089vNnOTZr8KglLT06wUyV-FTciFAm6tqPVJWtyrBn5HpB6n7nYjqcUq1OK3tqOxG7fyS3PtOqyts-wyo4iWszSCiWF0Tdzt8mwrfitKsd7zGJruz7Sh3seORzBeu2wRMFoNiDeswOn1YMT-YKDWN6I4pQ3NLvNiJu9Bztj_QscybhRvIammR0h2U5t6XuCG9rDC86ga88xHXV0Qq44a3z9pRSY2QB4Xf-4UReUAhu2NC6om_ZS7-hRdfhX8Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185286, - "updated": 1637185286, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } } }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:33 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7c5d4fa2-897f-43f5-9811-cacdeb5ad2dd", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:33 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "de2132fa-7a34-4d51-a8c0-30b3b4703bbc", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:33 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "8265aae3-1cab-496a-a6cc-a7a3e594e7f8", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "f0127d16-fd7b-4d4f-a61a-cdf6390c658c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "0c924c10-2e73-4de3-8310-3a8e96b2a015", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:34 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "d8e8e515-cc18-44d2-852c-2aa9d9ce6a08", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "c83850d2-0a0a-444c-be4f-0768453cdb81", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "165e2dda-442b-4776-bf58-c95f36991565", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-2173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "821", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "399fdd34-cf05-4180-8c1d-7c1bf372d1bb", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775", - "deletedDate": 1637185293, - "scheduledPurgeDate": 1637790093, - "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-2173508775/9f05342261a84e09af278eb302774179", - "kty": "RSA", - "key_ops": [ - "encrypt", - "decrypt", - "sign", - "verify", - "wrapKey", - "unwrapKey" - ], - "n": "usxmkWGUQdBYdjk7-BCCgTnLylG8fE6YorjPX4ip7p3LZjXtF3PL2MsbpxscCocKpYGBocaESyNl_MTDylblDpDYoLY06SJf0C3SRuMVwt_RzjwT1AnM58jZJyld5ueGDvVHa33x17RKYVa1tTfE30LqN_djwIso_i6wBzJrPMlBhALZE7nTfkIGLo1QWL988fFbNbFzSBSFGgwv5k5rPhK2_exFbRSeWg9xh19oTV6ltqcx1gDRGm9xDFJgepUGLJc98r0mR9AsaoBkBYfJn7vtXk0gdGBQRsqsWaSwrRFetf-MKQf37ZKdG1M4Z9QFQiAHmtRP9N6Mbcad2_lYrQ", - "e": "AQAB" - }, - "attributes": { - "enabled": true, - "created": 1637185286, - "updated": 1637185286, - "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "recoverableDays": 7 - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-2173508775?api-version=7.3-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "DELETE", - ":path": "/deletedkeys/key-2173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 204, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Date": "Wed, 17 Nov 2021 21:41:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "c9ac17b8-c7fa-4299-b0cb-936a07f91849", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key-3173508775?api-version=7.3-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "DELETE", - ":path": "/keys/key-3173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "821", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:35 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "eeb53bee-902d-4b00-a3fa-c63ee897e24d", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-3173508775", - "deletedDate": 1637185296, - "scheduledPurgeDate": 1637790096, - "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-3173508775/4a101643c9b34f9994b0980e19f37990", - "kty": "RSA", - "key_ops": [ - "encrypt", - "decrypt", - "sign", - "verify", - "wrapKey", - "unwrapKey" - ], - "n": "wUl0WOtkP4ZREXiLUpuOC7G9I-pmQxo9UEcnMdKfsCSfubgdZPKm722njiD4AZ6T-fpUMXvhnjeSHlCOu7R4ZbrcaB3eFaGviWSTTtbJbg6TMAPjiYAtHtMmfKhy0xsnNFj9uzyYJ-7I3m1RP3eZ2NQ0EnVW8rzssJQQKT52N8lLeM9ertrP-OWWVohSfQxtBVVo3wqYegChvf3yxAgyzPQXOjAWGaiuRToFbsmY8srF9lwsnlhSzqv1U9-nXk9rQDJvuwe9O1C1TPYcaJa05_Ben-RzKYH9K275UPYCw9TRPG6taKdc7OuTG7VEUPy7O3_k7PyiFJXKSgmTcMA5nQ", - "e": "AQAB" - }, - "attributes": { - "enabled": true, - "created": 1637185286, - "updated": 1637185286, - "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "recoverableDays": 7 - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-3173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-3173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:36 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "94ced27b-41fa-400f-b9ea-b74e92f1b321", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-3173508775" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-3173508775?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key-3173508775?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "82", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:36 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "d1b3a35f-c284-46e9-a6cd-ac61cd29d0d5", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key-3173508775" - } - } - }, { "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key-3173508775?api-version=7.3-preview", "RequestMethod": "GET", @@ -1821,15 +1191,15 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "1276040b-90c3-4954-ad90-36f9ba9be95d", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "b18440ab-06e4-4c10-8e1c-8a64eb754b66", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1858,15 +1228,15 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:36 GMT", + "Date": "Mon, 20 Dec 2021 16:40:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "48778004-5e87-45a5-84da-9a0bfe99161b", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "31dd4552-8b3b-46ae-8520-54f46f57e359", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1895,15 +1265,15 @@ "Cache-Control": "no-cache", "Content-Length": "82", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "065b335d-d88b-4bba-888f-9f2eaaf65dfa", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "bf67aaee-805e-4ab4-a14e-a5270ed65d3a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1932,23 +1302,23 @@ "Cache-Control": "no-cache", "Content-Length": "821", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:41:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:31 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "d34d3f8e-415c-4f5a-9ff7-f6ad9a178903", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "9fab5dba-da41-4a80-ad53-a91e83ab181d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key-3173508775", - "deletedDate": 1637185296, - "scheduledPurgeDate": 1637790096, + "deletedDate": 1640018430, + "scheduledPurgeDate": 1640623230, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key-3173508775/4a101643c9b34f9994b0980e19f37990", + "kid": "https://fakekvurl.vault.azure.net/keys/key-3173508775/07116999a7df49ce8527d72256da2e5d", "kty": "RSA", "key_ops": [ "encrypt", @@ -1958,13 +1328,13 @@ "wrapKey", "unwrapKey" ], - "n": "wUl0WOtkP4ZREXiLUpuOC7G9I-pmQxo9UEcnMdKfsCSfubgdZPKm722njiD4AZ6T-fpUMXvhnjeSHlCOu7R4ZbrcaB3eFaGviWSTTtbJbg6TMAPjiYAtHtMmfKhy0xsnNFj9uzyYJ-7I3m1RP3eZ2NQ0EnVW8rzssJQQKT52N8lLeM9ertrP-OWWVohSfQxtBVVo3wqYegChvf3yxAgyzPQXOjAWGaiuRToFbsmY8srF9lwsnlhSzqv1U9-nXk9rQDJvuwe9O1C1TPYcaJa05_Ben-RzKYH9K275UPYCw9TRPG6taKdc7OuTG7VEUPy7O3_k7PyiFJXKSgmTcMA5nQ", + "n": "vE2R85U2EXNhGxJv5lMVpt59iGJzemA_VGLZE0O42gkMiJYelDejhFRdNktYbkierAjKaGqkdEvYTfIg-3xlmd8Cz089vNnOTZr8KglLT06wUyV-FTciFAm6tqPVJWtyrBn5HpB6n7nYjqcUq1OK3tqOxG7fyS3PtOqyts-wyo4iWszSCiWF0Tdzt8mwrfitKsd7zGJruz7Sh3seORzBeu2wRMFoNiDeswOn1YMT-YKDWN6I4pQ3NLvNiJu9Bztj_QscybhRvIammR0h2U5t6XuCG9rDC86ga88xHXV0Qq44a3z9pRSY2QB4Xf-4UReUAhu2NC6om_ZS7-hRdfhX8Q", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185286, - "updated": 1637185286, + "created": 1640018426, + "updated": 1640018426, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1987,15 +1357,15 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Wed, 17 Nov 2021 21:41:37 GMT", + "Date": "Mon, 20 Dec 2021 16:40:31 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "356dbe52-46c1-448f-9b38-db082b61b635", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "500c11f7-7825-4762-9222-78281eced88c", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_HSM.json index 77c1ad96c20b..72904271e7ee 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,7 +24,7 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "426c0a0e-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a0d1f332-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "1" }, "ResponseBody": null @@ -59,17 +58,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "428eb928-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "216" + "x-ms-request-id": "a0e912f6-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "223" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, "key": { "e": "AQAB", @@ -81,9 +80,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" } } }, @@ -112,19 +111,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "42b9a386-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "139" + "x-ms-request-id": "a11579cc-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "157" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, - "deletedDate": 1637185348, + "deletedDate": 1640018467, "key": { "e": "AQAB", "key_ops": [ @@ -135,12 +134,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1649980179", - "scheduledPurgeDate": 1637790148 + "scheduledPurgeDate": 1640623267 } }, { @@ -166,22 +165,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "42d8ff24-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "35" + "x-ms-request-id": "a137ae84-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "31" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, - "deletedDate": 1637185348, + "deletedDate": 1640018467, "key": { "e": "AQAB", "key_ops": [ @@ -192,12 +191,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1649980179", - "scheduledPurgeDate": 1637790148 + "scheduledPurgeDate": 1640623267 } }, { @@ -223,22 +222,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "42ea78ee-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "31" + "x-ms-request-id": "a14af5fc-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "34" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, - "deletedDate": 1637185348, + "deletedDate": 1640018467, "key": { "e": "AQAB", "key_ops": [ @@ -249,12 +248,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1649980179", - "scheduledPurgeDate": 1637790148 + "scheduledPurgeDate": 1640623267 } }, { @@ -283,17 +282,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "42f96908-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "126" + "x-ms-request-id": "a15a8710-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "132" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, "key": { "e": "AQAB", @@ -305,9 +304,9 @@ "encrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" } } }, @@ -334,20 +333,20 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "4316cd68-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a17909e2-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "1" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, "key": { "e": "AQAB", @@ -359,9 +358,9 @@ "encrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" } } }, @@ -388,20 +387,20 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "432104e0-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a187d4b8-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "0" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, "key": { "e": "AQAB", @@ -413,9 +412,9 @@ "encrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" } } }, @@ -442,20 +441,20 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "432b55d0-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "0" + "x-ms-request-id": "a1921478-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "1" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, "key": { "e": "AQAB", @@ -467,9 +466,43 @@ "encrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" + } + } + }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/deletedkeys/INVALIDKEYNAME/recover?api-version=7.3-preview", + "RequestMethod": "POST", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "POST", + ":path": "/deletedkeys/INVALIDKEYNAME/recover?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "0", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "178", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "a19c73b4-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "30" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/deletedkeys/INVALIDKEYNAME (Activity ID: a19c73b4-61b3-11ec-985f-000d3aec06d7)" } } }, @@ -498,19 +531,19 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "43358500-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "77" + "x-ms-request-id": "a1ab8ca0-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "72" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, - "deletedDate": 1637185349, + "deletedDate": 1640018468, "key": { "e": "AQAB", "key_ops": [ @@ -521,12 +554,12 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1649980179", - "scheduledPurgeDate": 1637790149 + "scheduledPurgeDate": 1640623268 } }, { @@ -552,22 +585,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "434b9a20-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "46" + "x-ms-request-id": "a1c0d22c-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "33" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, - "deletedDate": 1637185349, + "deletedDate": 1640018468, "key": { "e": "AQAB", "key_ops": [ @@ -578,12 +611,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1649980179", - "scheduledPurgeDate": 1637790149 + "scheduledPurgeDate": 1640623268 } }, { @@ -609,22 +642,22 @@ "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "435cadb0-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "34" + "x-ms-request-id": "a1d02efc-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "39" }, "ResponseBody": { "attributes": { - "created": 1637185348, + "created": 1640018466, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185348 + "updated": 1640018466 }, - "deletedDate": 1637185349, + "deletedDate": 1640018468, "key": { "e": "AQAB", "key_ops": [ @@ -635,12 +668,12 @@ "decrypt", "wrapKey" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/e4ea70a650d507cf9d29327f8fd04ac1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key1649980179/3f74931169584417334ba8a2b2660cdc", "kty": "RSA-HSM", - "n": "26wrXbT0bIfpBbl0C9_V5DK8_0aNndmt_-cCGMpW555zbA2G90ocmwZ0uLI_4CAHH5liHO3YwUJWhPYUUR3pohEL0p2WPqfpPPMaxJ9HIyxbWpqNOwrrDYhOr2f12_xNdZudjlovQ60lX-GxWG2m_8vsRIVOwDwjKodu0Rwb5l98Mth5adeHh5mF_p84QEgUWZ8UzRfvyKmIp-6lC2qG9FqpQBbgHUWEokGqTb_oEV9tmZEyOSaDST5YW_v-1OqIjOn0JnHbQiYP79-XARd16MWUqTKFriOib9PvpURAW-Phb44nmZVNKGkGqDIIS69xwvpAiguSHSXlnKdZBP6fjQ" + "n": "l-ABr_dTz1iFQRMaf9qhzRejFNJmc19d73U0S0nN-KWSkjG7KGLKPWN9Eeoyo9Hknau8LJnTTb9bObw6coNaUR96JUv_B1Vn8SJjDL-OTd3LNf1leEh7eCt48_cEIWme06l1cDRefNcL9pVcm_uHHTbNBV3sVfh6Y4aLBywf-eguxJA3ZXtKiejiVgfg48q7mVZLO8-bbQXwbYta8Uy3BfX0-XSxlyUP1OROmMO79EYiDEIy5tLAEv5BxVnDUy_cIFHQUZcZnOBxikxOeQuBF87G56e0OPZfluQJBOgzRd1Agt7cJpIp-IgchuLSumDdcXJS4Z95Q-GwQfFtC9LZKw" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key1649980179", - "scheduledPurgeDate": 1637790149 + "scheduledPurgeDate": 1640623268 } }, { @@ -668,8 +701,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "436bedf2-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "110" + "x-ms-request-id": "a1e05ade-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "114" }, "ResponseBody": null } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_NON-HSM.json index 1f29177febf9..2f9693d3ffdd 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestRecoverDeletedKey/TestRecoverDeletedKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:09 GMT", + "Date": "Mon, 20 Dec 2021 16:41:02 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,632 +28,40 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ff564fcb-162d-470a-b149-2ea28b5c41a0", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "Unauthorized", - "message": "AKV10000: Request is missing a Bearer or PoP token." - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/create?api-version=7.3-preview", - "RequestMethod": "POST", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "POST", - ":path": "/keys/key108732465/create?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "Content-Length": "13", - "Content-Type": "application/json", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": { - "kty": "RSA" - }, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "686", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:11 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2037cf09-95dd-43b0-930c-f6164e0e3497", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", - "kty": "RSA", - "key_ops": [ - "encrypt", - "decrypt", - "sign", - "verify", - "wrapKey", - "unwrapKey" - ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", - "e": "AQAB" - }, - "attributes": { - "enabled": true, - "created": 1639070771, - "updated": 1639070771, - "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "recoverableDays": 7 - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465?api-version=7.3-preview", - "RequestMethod": "DELETE", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "DELETE", - ":path": "/keys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 200, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "817", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:11 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6ac8c8fe-1744-4c65-bab7-e06891873089", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465", - "deletedDate": 1639070771, - "scheduledPurgeDate": 1639675571, - "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", - "kty": "RSA", - "key_ops": [ - "encrypt", - "decrypt", - "sign", - "verify", - "wrapKey", - "unwrapKey" - ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", - "e": "AQAB" - }, - "attributes": { - "enabled": true, - "created": 1639070771, - "updated": 1639070771, - "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "recoverableDays": 7 - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:11 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "96065b18-1219-43d7-8974-393ce4a4e75f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "bf871dbb-7a3e-4991-83d2-becdbbab946c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1679c188-50d8-4fa6-bea4-c39763e7bd57", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "32c4a5c6-0e81-4891-b8c8-cd6f2bbbf4e8", + "x-ms-request-id": "e634fde7-6916-4b36-ae49-ee5b45712c3d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7b9ffee1-b036-4b73-bdf2-2e24df771b3c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f320f2bb-2db0-4db7-bbce-4d89401a5524", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "bb6d8179-fbd1-4d11-9fef-d8fce91b563a", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:14 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b348a417-6ce2-4bea-9547-f9d221178375", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:14 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "21b5e6cf-b5c3-4327-b835-e9641f1150b6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:14 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "101e5b4b-6e02-4ed6-85cd-aa9b57be6035", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b837f454-d64b-4800-9141-5e9223a812af", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ed693465-f999-490a-9f98-9a4fdcf17697", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:15 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "ede5bfdf-3c76-4f59-9828-6c5605cacf98", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" + "error": { + "code": "Unauthorized", + "message": "AKV10000: Request is missing a Bearer or PoP token." } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/create?api-version=7.3-preview", + "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", + ":method": "POST", + ":path": "/keys/key108732465/create?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", + "Content-Length": "13", + "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, - "RequestBody": null, + "RequestBody": { + "kty": "RSA" + }, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "817", + "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:16 GMT", + "Date": "Mon, 20 Dec 2021 16:41:02 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -662,15 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b0186326-b717-47e5-ab7d-086927ecf8fa", + "x-ms-request-id": "cdd300d0-205e-4d9a-a482-a6c349a18ae5", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465", - "deletedDate": 1639070771, - "scheduledPurgeDate": 1639675571, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", "kty": "RSA", "key_ops": [ "encrypt", @@ -680,39 +84,38 @@ "wrapKey", "unwrapKey" ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070771, - "updated": 1639070771, + "created": 1640018463, + "updated": 1640018463, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465/recover?api-version=7.3-preview", - "RequestMethod": "POST", + "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465?api-version=7.3-preview", + "RequestMethod": "DELETE", "RequestHeaders": { ":authority": "localhost:5001", - ":method": "POST", - ":path": "/deletedkeys/key108732465/recover?api-version=7.3-preview", + ":method": "DELETE", + ":path": "/keys/key108732465?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "Content-Length": "0", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "686", + "Content-Length": "817", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:16 GMT", + "Date": "Mon, 20 Dec 2021 16:41:02 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -720,12 +123,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6b8cd1db-8ade-4847-b821-22adc9df177b", + "x-ms-request-id": "caf7c2bd-53ed-44b7-a9cb-82cd627a1bf9", "X-Powered-By": "ASP.NET" }, "ResponseBody": { + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465", + "deletedDate": 1640018463, + "scheduledPurgeDate": 1640623263, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", "kty": "RSA", "key_ops": [ "encrypt", @@ -735,62 +141,25 @@ "wrapKey", "unwrapKey" ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070771, - "updated": 1639070771, + "created": 1640018463, + "updated": 1640018463, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/keys/key108732465/?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "300", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:16 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "add06da5-8e61-4d61-bd91-bfeed220941b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "A key with (name/id) key108732465 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/keys/key108732465/?api-version=7.3-preview", + ":path": "/deletedkeys/key108732465?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -801,9 +170,9 @@ "StatusCode": 404, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "300", + "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:16 GMT", + "Date": "Mon, 20 Dec 2021 16:41:02 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -811,23 +180,23 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3062f130-b0d4-4998-9472-77d883205f4a", + "x-ms-request-id": "3b85b3e5-cb7b-45e2-8425-67feb25fd669", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "A key with (name/id) key108732465 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + "message": "Deleted Key not found: key108732465" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/keys/key108732465/?api-version=7.3-preview", + ":path": "/deletedkeys/key108732465?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -838,9 +207,9 @@ "StatusCode": 404, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "300", + "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:17 GMT", + "Date": "Mon, 20 Dec 2021 16:41:02 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -848,23 +217,23 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "0b205454-46c9-4603-9a36-f1f4c22b32ce", + "x-ms-request-id": "f8beda7c-01f9-4fcc-bc36-b424cc7bb8bd", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "A key with (name/id) key108732465 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + "message": "Deleted Key not found: key108732465" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/keys/key108732465/?api-version=7.3-preview", + ":path": "/deletedkeys/key108732465?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -875,9 +244,9 @@ "StatusCode": 404, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "300", + "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:17 GMT", + "Date": "Mon, 20 Dec 2021 16:41:04 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -885,23 +254,23 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "239e8d21-7b48-495f-af10-81beb47b31b1", + "x-ms-request-id": "735c31d7-4d79-4849-b92c-602db47f4b4d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "error": { "code": "KeyNotFound", - "message": "A key with (name/id) key108732465 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + "message": "Deleted Key not found: key108732465" } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/?api-version=7.3-preview", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", "RequestMethod": "GET", "RequestHeaders": { ":authority": "localhost:5001", ":method": "GET", - ":path": "/keys/key108732465/?api-version=7.3-preview", + ":path": "/deletedkeys/key108732465?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", @@ -909,12 +278,12 @@ "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, - "StatusCode": 404, + "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "300", + "Content-Length": "817", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:17 GMT", + "Date": "Mon, 20 Dec 2021 16:41:04 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -922,36 +291,57 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "9a987dd7-308d-4d17-89ca-071e74eee35e", + "x-ms-request-id": "3330cccc-2a14-4c1c-a4f6-d2b483351c0e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "A key with (name/id) key108732465 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465", + "deletedDate": 1640018463, + "scheduledPurgeDate": 1640623263, + "key": { + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1640018463, + "updated": 1640018463, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 } } }, { - "RequestUri": "https://fakekvurl.vault.azure.net/keys/key108732465/?api-version=7.3-preview", - "RequestMethod": "GET", + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465/recover?api-version=7.3-preview", + "RequestMethod": "POST", "RequestHeaders": { ":authority": "localhost:5001", - ":method": "GET", - ":path": "/keys/key108732465/?api-version=7.3-preview", + ":method": "POST", + ":path": "/deletedkeys/key108732465/recover?api-version=7.3-preview", ":scheme": "https", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", + "Content-Length": "0", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, - "StatusCode": 404, + "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "300", + "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:18 GMT", + "Date": "Mon, 20 Dec 2021 16:41:04 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -959,13 +349,30 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7ce2876b-e78e-40dd-b7b3-4289619b1d65", + "x-ms-request-id": "b454b91a-d861-4bbc-81ef-9f5f330bc569", "X-Powered-By": "ASP.NET" }, "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "A key with (name/id) key108732465 was not found in this key vault. If you recently deleted this key you may be able to recover it using the correct recovery command. For help resolving this issue, please see https://go.microsoft.com/fwlink/?linkid=2125182" + "key": { + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", + "kty": "RSA", + "key_ops": [ + "encrypt", + "decrypt", + "sign", + "verify", + "wrapKey", + "unwrapKey" + ], + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", + "e": "AQAB" + }, + "attributes": { + "enabled": true, + "created": 1640018463, + "updated": 1640018463, + "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", + "recoverableDays": 7 } } }, @@ -988,7 +395,7 @@ "Cache-Control": "no-cache", "Content-Length": "300", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:18 GMT", + "Date": "Mon, 20 Dec 2021 16:41:04 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -996,7 +403,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7e27e1ed-1990-4a69-8e74-d425af22ebb5", + "x-ms-request-id": "88cbdc4c-ec66-4e5e-ae55-b6aeb686f5d4", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1025,7 +432,7 @@ "Cache-Control": "no-cache", "Content-Length": "300", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:18 GMT", + "Date": "Mon, 20 Dec 2021 16:41:04 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1033,7 +440,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1cadc5fa-322e-4ab2-bec7-429fd966886d", + "x-ms-request-id": "f0d4f069-2b05-4229-b8d6-9bf1367f30a3", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1062,7 +469,7 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:19 GMT", + "Date": "Mon, 20 Dec 2021 16:41:05 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1070,12 +477,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "17ca3e99-d820-4ef5-8613-e1a6b0030c6c", + "x-ms-request-id": "7f79bde7-d071-46c4-8ba0-c48d53ecd071", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", "kty": "RSA", "key_ops": [ "encrypt", @@ -1085,13 +492,13 @@ "wrapKey", "unwrapKey" ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070771, - "updated": 1639070771, + "created": 1640018463, + "updated": 1640018463, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1116,7 +523,7 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:19 GMT", + "Date": "Mon, 20 Dec 2021 16:41:05 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1124,12 +531,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "bab3db87-6826-4813-859f-a69621284aa9", + "x-ms-request-id": "c742d923-f3a7-42f7-9074-6133b9bcbab5", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", "kty": "RSA", "key_ops": [ "encrypt", @@ -1139,13 +546,13 @@ "wrapKey", "unwrapKey" ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070771, - "updated": 1639070771, + "created": 1640018463, + "updated": 1640018463, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1170,7 +577,7 @@ "Cache-Control": "no-cache", "Content-Length": "686", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:19 GMT", + "Date": "Mon, 20 Dec 2021 16:41:05 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1178,12 +585,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d62a43c3-bf66-459c-b8d1-50a16588dcad", + "x-ms-request-id": "677e9dde-8eb2-4fe6-8b6b-60822960f77b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", "kty": "RSA", "key_ops": [ "encrypt", @@ -1193,13 +600,13 @@ "wrapKey", "unwrapKey" ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070771, - "updated": 1639070771, + "created": 1640018463, + "updated": 1640018463, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1225,7 +632,7 @@ "Cache-Control": "no-cache", "Content-Length": "302", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:19 GMT", + "Date": "Mon, 20 Dec 2021 16:41:05 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1233,7 +640,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "5884d251-0bec-441f-b561-1d6c24fb6803", + "x-ms-request-id": "0cd85d47-cdb5-4f1d-b474-a103470a4898", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1262,7 +669,7 @@ "Cache-Control": "no-cache", "Content-Length": "817", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:19 GMT", + "Date": "Mon, 20 Dec 2021 16:41:05 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1270,15 +677,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "460c51b5-0325-48e7-a379-dbf6f1f341a2", + "x-ms-request-id": "21357e1c-c8b7-41f7-8c66-796728de9eaf", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465", - "deletedDate": 1639070780, - "scheduledPurgeDate": 1639675580, + "deletedDate": 1640018465, + "scheduledPurgeDate": 1640623265, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", "kty": "RSA", "key_ops": [ "encrypt", @@ -1288,13 +695,13 @@ "wrapKey", "unwrapKey" ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070771, - "updated": 1639070771, + "created": 1640018463, + "updated": 1640018463, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1319,118 +726,7 @@ "Cache-Control": "no-cache", "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b0a762c1-896e-4fa5-bc5e-c55e7e2b01cc", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "5f62ed0c-21ef-4699-9b1f-99cb76441dd5", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:20 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "253584c7-38df-4ba5-9540-db7d533446a8", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key108732465" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key108732465?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "80", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:20 GMT", + "Date": "Mon, 20 Dec 2021 16:41:05 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1438,7 +734,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e2aee25d-0c98-42be-b33a-e5f1d298dd11", + "x-ms-request-id": "a285e89c-edc7-41ca-b5c7-14bd75a719af", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1467,7 +763,7 @@ "Cache-Control": "no-cache", "Content-Length": "80", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:21 GMT", + "Date": "Mon, 20 Dec 2021 16:41:06 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1475,7 +771,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f8c7c346-a16a-49d1-8bba-89eabc6dc151", + "x-ms-request-id": "aaa6ba8c-9c4d-4daf-ae25-a13b494b193c", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -1504,7 +800,7 @@ "Cache-Control": "no-cache", "Content-Length": "817", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:26:21 GMT", + "Date": "Mon, 20 Dec 2021 16:41:06 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1512,15 +808,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "21f68cb8-8f54-4f5f-a1e5-da4fc396b2f0", + "x-ms-request-id": "236a67d0-a2bc-482b-9f88-08f7f712893a", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key108732465", - "deletedDate": 1639070780, - "scheduledPurgeDate": 1639675580, + "deletedDate": 1640018465, + "scheduledPurgeDate": 1640623265, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/f157d38ffceb4922b814e0d15b6b8ae9", + "kid": "https://fakekvurl.vault.azure.net/keys/key108732465/4ca77832f84c4899a7663d95cb2a17d8", "kty": "RSA", "key_ops": [ "encrypt", @@ -1530,13 +826,13 @@ "wrapKey", "unwrapKey" ], - "n": "yL-ejpef45YL4sQmwb-gQSdRpYg_tzfd54G9NSIfDdvQ2unbKI4fChFx0pc346c_yRpLrHlMOod8yVRW9upUEQi8a9dPLyXBtPo_CQ29ZFlLBw4n1K-V3avmHzVGsZKrYZhee-P1CDp8cpS0HQZzECpXk8a8EBOBD9FgozMM6L74QPrZivuyuQR-ylaQXY7oY2ihe6bRgfdlnCxuhP79p9VULpZZ7oSnJyDguX12NT71wKCHbRtHxDa57q9pVgAxhaJXz9m-hmYO-Fu-D0zNZx8T47iXyUtKtW6X3_REdykZLPN0dvQ8GV1XesnMFqRwYpR3Lcg4rbh5N-hC2kMnvQ", + "n": "l2qZgaOP39TPp6gas7vtY__PoOz5AfiaP-LEtdDM_5ZWhujohZlgeM9CJMizFUAcVasFYQOaAojS983sthkwG1H3xqvcYCoasyENjHsXr4UBlvRN4nT7tWPgUEk9HX6ecjpdmwQQBEYJnrrnRZtd5zq1y2hkEgG6H5K4e5m98uY04lsuLYl0x2lQ7lPvRglNjWqOx6QPUv8OAH1UBqVMwmZzc03rptm7mNT9qALanrp0yeiHqWdqooMlRYo6bNtjucfppGgTwiZ6I4AwbHNtcMBXCCaQV_DqX9wcR9IooJYUJbV1-na_EnLL92sfsoKZuK2w8-PmW3fwDmVREfFebQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639070771, - "updated": 1639070771, + "created": 1640018463, + "updated": 1640018463, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1559,7 +855,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 17:26:21 GMT", + "Date": "Mon, 20 Dec 2021 16:41:06 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -1567,7 +863,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f21db80f-c1c8-49af-a873-99a89df979d3", + "x-ms-request-id": "84de07b3-cdf2-456c-b68a-ee120b52f0e0", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestReleaseKey/TestReleaseKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestReleaseKey/TestReleaseKey_NON-HSM.json index 3879c0fab292..7edaed69399c 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestReleaseKey/TestReleaseKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestReleaseKey/TestReleaseKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:11 GMT", + "Date": "Mon, 20 Dec 2021 16:42:57 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "6970853b-f8fb-4099-8d19-7b64ee934b13", + "x-ms-request-id": "c8aa3b53-a28b-43a4-950b-1d553c12512b", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:12 GMT", + "Date": "Mon, 20 Dec 2021 16:42:58 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2ff86ea4-d1b8-4c92-8157-6543c20a4555", + "x-ms-request-id": "44ff3e8e-c166-481e-8059-b7ba96500805", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3813505923/88561a00137f4809a4b788817ad0c4b3", + "kid": "https://fakekvurl.vault.azure.net/keys/key3813505923/4ac8e7acdafb427daa86a099a7a44112", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "2wBMvfVRarH04ZMCsyJxqsZQ0MK6nK3zer3UGKC83ofKBRW7-zkyuWuAzf6dd_TdtYMMGYrwNii2qcmwTP9zzEneCoXPzwa2DzleR3dZAye5YoFR4vS63-k2-4F7ZRc36t1ET7zwiprjIftsCWzNbgVNIusQhBwQZ3qHGiU60I6mInpZq9Tdk69JbBAwLaoECY5SpDIn6lWJaX9jzVXRjldxhb30YZlsbe5MzcxHOI54049ku1ZMKdMMnL_h_GFqT7C4--JxJ3kyNgDAOms_24pJKCDaz2-YdipsOQ40IYZQvGPym12gprMvLYl-DHhgShWccQp3ze0psnZDLru_JQ", + "n": "tlIz3yZZZJ4MS3FBkRXjrntzLnYiSNx7yl-3L-M8qaiNkd6J1SVe6fOZLvWjq5FbAYBxr3TPKfE451NlVaKjpguTarsPnySFIoeG4IjgkeYEkOMii0MaHnGv_6r0F9v4EHnYc6vUlfnvNJrJD7ijlPW_viR0cpjaTLTcg4sOQAWPH-U_me6K_U5wB_4BKC9tdFJabmZ8sFi5Yo-mj22nlYo1Yarz27or_6kN4TGWgefanVe-FtkvkgcgXcMs5-WUwBHlUYcGtV2hn8jBz_Kr6C4FgB1TKd5b_VEvFCvEZj1L53IWYeutOi80x68q1w57ueRSSBCgLhzQZ8sJyJM8gQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639072932, - "updated": 1639072932, + "created": 1640018578, + "updated": 1640018578, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -120,7 +119,7 @@ "Cache-Control": "no-cache", "Content-Length": "140", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:12 GMT", + "Date": "Mon, 20 Dec 2021 16:42:58 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -128,7 +127,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "f789ee6b-60a9-4f53-bd42-4009e6e19512", + "x-ms-request-id": "6bf9181f-b5c1-4c88-9b49-e2ce99cbf2b0", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -160,7 +159,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:12 GMT", + "Date": "Mon, 20 Dec 2021 16:42:58 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -168,15 +167,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1699e51d-da91-4ee4-bdcd-819ff3819f69", + "x-ms-request-id": "07b63764-ea4e-4c66-983f-0c25bce5ab02", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3813505923", - "deletedDate": 1639072933, - "scheduledPurgeDate": 1639677733, + "deletedDate": 1640018578, + "scheduledPurgeDate": 1640623378, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3813505923/88561a00137f4809a4b788817ad0c4b3", + "kid": "https://fakekvurl.vault.azure.net/keys/key3813505923/4ac8e7acdafb427daa86a099a7a44112", "kty": "RSA", "key_ops": [ "encrypt", @@ -186,13 +185,13 @@ "wrapKey", "unwrapKey" ], - "n": "2wBMvfVRarH04ZMCsyJxqsZQ0MK6nK3zer3UGKC83ofKBRW7-zkyuWuAzf6dd_TdtYMMGYrwNii2qcmwTP9zzEneCoXPzwa2DzleR3dZAye5YoFR4vS63-k2-4F7ZRc36t1ET7zwiprjIftsCWzNbgVNIusQhBwQZ3qHGiU60I6mInpZq9Tdk69JbBAwLaoECY5SpDIn6lWJaX9jzVXRjldxhb30YZlsbe5MzcxHOI54049ku1ZMKdMMnL_h_GFqT7C4--JxJ3kyNgDAOms_24pJKCDaz2-YdipsOQ40IYZQvGPym12gprMvLYl-DHhgShWccQp3ze0psnZDLru_JQ", + "n": "tlIz3yZZZJ4MS3FBkRXjrntzLnYiSNx7yl-3L-M8qaiNkd6J1SVe6fOZLvWjq5FbAYBxr3TPKfE451NlVaKjpguTarsPnySFIoeG4IjgkeYEkOMii0MaHnGv_6r0F9v4EHnYc6vUlfnvNJrJD7ijlPW_viR0cpjaTLTcg4sOQAWPH-U_me6K_U5wB_4BKC9tdFJabmZ8sFi5Yo-mj22nlYo1Yarz27or_6kN4TGWgefanVe-FtkvkgcgXcMs5-WUwBHlUYcGtV2hn8jBz_Kr6C4FgB1TKd5b_VEvFCvEZj1L53IWYeutOi80x68q1w57ueRSSBCgLhzQZ8sJyJM8gQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639072932, - "updated": 1639072932, + "created": 1640018578, + "updated": 1640018578, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -217,155 +216,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1f215122-4d3a-43f3-acfb-05baedb951ae", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key3813505923" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3813505923?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key3813505923?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:12 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "52fad550-ab47-43ac-b493-1db4fcbb211c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key3813505923" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3813505923?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key3813505923?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "a6155069-278b-48d0-9ee9-ac3b7c9f14ec", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key3813505923" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3813505923?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key3813505923?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:13 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "407ecae3-7b86-4bdf-8dff-2d06e125ed5f", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key3813505923" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3813505923?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key3813505923?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:13 GMT", + "Date": "Mon, 20 Dec 2021 16:42:58 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -373,7 +224,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "204ff297-a5d9-4678-82b3-ec455e8e78cd", + "x-ms-request-id": "84a3bdc1-f458-48e9-a34c-b856b7569239", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -402,7 +253,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:14 GMT", + "Date": "Mon, 20 Dec 2021 16:42:58 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -410,7 +261,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "19c77ce1-a5a9-4bf0-9db8-dcfb3036b9e5", + "x-ms-request-id": "1e1ec4c7-dfac-42c4-9cdb-bc02ff9e8c69", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -439,7 +290,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:02:14 GMT", + "Date": "Mon, 20 Dec 2021 16:42:59 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -447,15 +298,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "2a2153e3-22eb-454a-9631-7c4f661ff3a4", + "x-ms-request-id": "ab5b188f-2554-4811-96b2-55f6050df213", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3813505923", - "deletedDate": 1639072933, - "scheduledPurgeDate": 1639677733, + "deletedDate": 1640018578, + "scheduledPurgeDate": 1640623378, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3813505923/88561a00137f4809a4b788817ad0c4b3", + "kid": "https://fakekvurl.vault.azure.net/keys/key3813505923/4ac8e7acdafb427daa86a099a7a44112", "kty": "RSA", "key_ops": [ "encrypt", @@ -465,13 +316,13 @@ "wrapKey", "unwrapKey" ], - "n": "2wBMvfVRarH04ZMCsyJxqsZQ0MK6nK3zer3UGKC83ofKBRW7-zkyuWuAzf6dd_TdtYMMGYrwNii2qcmwTP9zzEneCoXPzwa2DzleR3dZAye5YoFR4vS63-k2-4F7ZRc36t1ET7zwiprjIftsCWzNbgVNIusQhBwQZ3qHGiU60I6mInpZq9Tdk69JbBAwLaoECY5SpDIn6lWJaX9jzVXRjldxhb30YZlsbe5MzcxHOI54049ku1ZMKdMMnL_h_GFqT7C4--JxJ3kyNgDAOms_24pJKCDaz2-YdipsOQ40IYZQvGPym12gprMvLYl-DHhgShWccQp3ze0psnZDLru_JQ", + "n": "tlIz3yZZZJ4MS3FBkRXjrntzLnYiSNx7yl-3L-M8qaiNkd6J1SVe6fOZLvWjq5FbAYBxr3TPKfE451NlVaKjpguTarsPnySFIoeG4IjgkeYEkOMii0MaHnGv_6r0F9v4EHnYc6vUlfnvNJrJD7ijlPW_viR0cpjaTLTcg4sOQAWPH-U_me6K_U5wB_4BKC9tdFJabmZ8sFi5Yo-mj22nlYo1Yarz27or_6kN4TGWgefanVe-FtkvkgcgXcMs5-WUwBHlUYcGtV2hn8jBz_Kr6C4FgB1TKd5b_VEvFCvEZj1L53IWYeutOi80x68q1w57ueRSSBCgLhzQZ8sJyJM8gQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639072932, - "updated": 1639072932, + "created": 1640018578, + "updated": 1640018578, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -494,7 +345,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 18:02:14 GMT", + "Date": "Mon, 20 Dec 2021 16:42:59 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -502,7 +353,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "44e92c87-041b-4e8c-8df8-21259f2ccf72", + "x-ms-request-id": "0956640e-e1ba-4f28-9914-f4695f8edfc2", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestRotateKey/TestRotateKey_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestRotateKey/TestRotateKey_NON-HSM.json index 551eef22569f..40e7c720b0d7 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestRotateKey/TestRotateKey_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestRotateKey/TestRotateKey_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:40 GMT", + "Date": "Mon, 20 Dec 2021 16:41:30 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "12d95432-6618-4497-b8df-481b1ec63a9a", + "x-ms-request-id": "6a97b0cb-b6f3-4b88-908f-deff0d127ea4", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:32 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b0a69ccb-e8c0-40b6-a26a-616d03f48fa4", + "x-ms-request-id": "07235aa5-f236-4394-aef2-b3e451a74107", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/3e361086709547e2bff649c777e72346", + "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/4b714b5a41ef45a980533bc49f5b3f8f", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "ymgIa4lM7qhJ8YqgUbFSP_cfMAwbNFM5MHYZWRSj8m8Zxe94_yJ8eiZn08fKnH5aLqAwDPX7iNh2Gd3iXcabFJvhmkejwB917bSQRkXHLnk1ta6AmxOhoc2P7q5BsJ3Ngd5HIaDF9dx8FQl0QRLCV55zfPXL-f4omqRQRdMF7YWgZW_NLcJi2WZzYKlplC3GS27JQPaGXQ8bTnTP6QvluR8VSLP7o0Lm5HFACAmCcIX8X-ZuRJD4LVOIGG9RXTba8F-zg2xFWAH-Lwy9wBesOsyQo3lCsPBmkD89Z_fLlAaYisIBMGJKGTN71L8hkfVx_WZ3U0GYX_mZVm0QJyk-JQ", + "n": "2_5Bvlpk28wR0dWqIrUmf7zOZZnvVHGaj3miGKJIqCAsxD2zC5VRYuKJYdrzUkfrROLhVvdZxhT6RZpyogDCoWCJobf4CUDn8Rk9AAcPMzvMBPtGxnQTHxO4Kq1X9lep5Eiz4_9L39QRPChRSCMIxjlz-HPJgDLuZTL7fjqeJBESbM4lH562ifG_o9bXJZB0TvaeJM1aGKWGj18_ZC2Tq8gA4zZLvASvQ2QpHOU4m18kiBa_7_-7aeJHh-CezHfd70xdsgmY_ae3b1SQ_1UyNUL7RBgT42ATkj79SciFkf0wRCdf3X2GyxJJmaMMDb_h1cdHb0n_Osj1FVvN5JYKNQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639075481, - "updated": 1639075481, + "created": 1640018491, + "updated": 1640018491, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -117,7 +116,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:32 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -125,12 +124,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b2e3d835-e2b3-41c5-8c1b-be5dcea00130", + "x-ms-request-id": "e6ea790f-305e-4368-baa3-5e56584d644f", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/464c658fba8041598f36cec8c3d62d11", + "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/00760098264b4bf0a6774e754f48d44c", "kty": "RSA", "key_ops": [ "encrypt", @@ -140,13 +139,13 @@ "wrapKey", "unwrapKey" ], - "n": "rzRgT4JJKHvJm0I45HSv2GFChFFHNzJv8ZXTz8sfdZtcrCxRl7_ymqd2By4g8n_N7mrTyfCkOtz91rTkqRrtj6fmF-Iaw_y06onh7MMNz1gFLbIbSFNxORn85xBZn2KCYwf02SD3-u_43vETV6redUEGhNENKobdlx9QOC882wIkCRdvDfaRZW14YhmqAKoYv1Vrx_RizQ46QRblcdHWlyGZ-opyWAYXUUkUHcnl6UqrY1-B4J5dnXXsZVpXHFZ11eBWri8RRCixATYqFh5o7V6QMDEFuyVHWjrOIBh8XRo507ryQdNM03HkYWXRuj_Tb7eE9FiX1gx_dv1Dty1v5Q", + "n": "v1Y5t2t9uucU1EucaRwVDSwYAjAfcqEZTGXyG0VhAt7vjsOcwuIm0NSbcdhLg-Or9D7bae_xisd9086raqBmxD6gUIxlsOyv1BbisNYUKUuI6C8ikjWOfG5C4Htmnsn4wYzC41iYHw1MJS0fJnv4XQRD05uTaH-XNxLMNAz31Buc2myWRTyTiYy1QL5Zar2Hs4961OXW8GG8gBOVi8AS9S4RchUsoUGW7U5G99mmO5xeoJc6CdwgrcRTMgoZde8an8SyyrfudAM8t903AHQ2axm_H_T4dVpPt5RKe7uKTnID18i5XdIBfgMZMMiSQPOMcqy0jlCacXUvSEWWdm1BmQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639075482, - "updated": 1639075482, + "created": 1640018492, + "updated": 1640018492, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -172,7 +171,7 @@ "Cache-Control": "no-cache", "Content-Length": "302", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:41 GMT", + "Date": "Mon, 20 Dec 2021 16:41:32 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -180,7 +179,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3a0e724c-e1ff-43ed-bda2-e05f7262fc41", + "x-ms-request-id": "a7ef9bcc-e6e3-436a-8d24-2d25a3d89cf1", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -209,7 +208,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:32 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -217,15 +216,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "d851d963-cff9-41a1-b046-7a11e47a29bb", + "x-ms-request-id": "136ec13f-f02e-43b6-b091-787d3eea23f8", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3297178601", - "deletedDate": 1639075482, - "scheduledPurgeDate": 1639680282, + "deletedDate": 1640018492, + "scheduledPurgeDate": 1640623292, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/464c658fba8041598f36cec8c3d62d11", + "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/00760098264b4bf0a6774e754f48d44c", "kty": "RSA", "key_ops": [ "encrypt", @@ -235,13 +234,13 @@ "wrapKey", "unwrapKey" ], - "n": "rzRgT4JJKHvJm0I45HSv2GFChFFHNzJv8ZXTz8sfdZtcrCxRl7_ymqd2By4g8n_N7mrTyfCkOtz91rTkqRrtj6fmF-Iaw_y06onh7MMNz1gFLbIbSFNxORn85xBZn2KCYwf02SD3-u_43vETV6redUEGhNENKobdlx9QOC882wIkCRdvDfaRZW14YhmqAKoYv1Vrx_RizQ46QRblcdHWlyGZ-opyWAYXUUkUHcnl6UqrY1-B4J5dnXXsZVpXHFZ11eBWri8RRCixATYqFh5o7V6QMDEFuyVHWjrOIBh8XRo507ryQdNM03HkYWXRuj_Tb7eE9FiX1gx_dv1Dty1v5Q", + "n": "v1Y5t2t9uucU1EucaRwVDSwYAjAfcqEZTGXyG0VhAt7vjsOcwuIm0NSbcdhLg-Or9D7bae_xisd9086raqBmxD6gUIxlsOyv1BbisNYUKUuI6C8ikjWOfG5C4Htmnsn4wYzC41iYHw1MJS0fJnv4XQRD05uTaH-XNxLMNAz31Buc2myWRTyTiYy1QL5Zar2Hs4961OXW8GG8gBOVi8AS9S4RchUsoUGW7U5G99mmO5xeoJc6CdwgrcRTMgoZde8an8SyyrfudAM8t903AHQ2axm_H_T4dVpPt5RKe7uKTnID18i5XdIBfgMZMMiSQPOMcqy0jlCacXUvSEWWdm1BmQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639075482, - "updated": 1639075482, + "created": 1640018492, + "updated": 1640018492, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -266,7 +265,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:32 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -274,7 +273,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "1036987c-3b5e-4555-9f46-11cb1fb0b9f5", + "x-ms-request-id": "59e07241-6d1e-445a-9e45-55173fe4da0f", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -303,7 +302,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:32 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -311,7 +310,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "bea4c63d-5a80-4a3b-a32b-a1447234727d", + "x-ms-request-id": "6b0f8e02-ae92-4642-82fe-9139962677b2", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -340,7 +339,7 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 18:44:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -348,15 +347,15 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "e5b61a3f-092e-4230-8bce-b49af0cbb8b5", + "x-ms-request-id": "23b32883-ed30-4754-aef3-d97c7c648d48", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3297178601", - "deletedDate": 1639075482, - "scheduledPurgeDate": 1639680282, + "deletedDate": 1640018492, + "scheduledPurgeDate": 1640623292, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/464c658fba8041598f36cec8c3d62d11", + "kid": "https://fakekvurl.vault.azure.net/keys/key3297178601/00760098264b4bf0a6774e754f48d44c", "kty": "RSA", "key_ops": [ "encrypt", @@ -366,13 +365,13 @@ "wrapKey", "unwrapKey" ], - "n": "rzRgT4JJKHvJm0I45HSv2GFChFFHNzJv8ZXTz8sfdZtcrCxRl7_ymqd2By4g8n_N7mrTyfCkOtz91rTkqRrtj6fmF-Iaw_y06onh7MMNz1gFLbIbSFNxORn85xBZn2KCYwf02SD3-u_43vETV6redUEGhNENKobdlx9QOC882wIkCRdvDfaRZW14YhmqAKoYv1Vrx_RizQ46QRblcdHWlyGZ-opyWAYXUUkUHcnl6UqrY1-B4J5dnXXsZVpXHFZ11eBWri8RRCixATYqFh5o7V6QMDEFuyVHWjrOIBh8XRo507ryQdNM03HkYWXRuj_Tb7eE9FiX1gx_dv1Dty1v5Q", + "n": "v1Y5t2t9uucU1EucaRwVDSwYAjAfcqEZTGXyG0VhAt7vjsOcwuIm0NSbcdhLg-Or9D7bae_xisd9086raqBmxD6gUIxlsOyv1BbisNYUKUuI6C8ikjWOfG5C4Htmnsn4wYzC41iYHw1MJS0fJnv4XQRD05uTaH-XNxLMNAz31Buc2myWRTyTiYy1QL5Zar2Hs4961OXW8GG8gBOVi8AS9S4RchUsoUGW7U5G99mmO5xeoJc6CdwgrcRTMgoZde8an8SyyrfudAM8t903AHQ2axm_H_T4dVpPt5RKe7uKTnID18i5XdIBfgMZMMiSQPOMcqy0jlCacXUvSEWWdm1BmQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639075482, - "updated": 1639075482, + "created": 1640018492, + "updated": 1640018492, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -395,7 +394,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 18:44:42 GMT", + "Date": "Mon, 20 Dec 2021 16:41:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -403,7 +402,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "dbac026f-149f-4bf9-90d6-252edfc55675", + "x-ms-request-id": "096cf7c0-4e63-45d7-a2a9-6aa510bd6b3c", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_HSM.json index ba5f65d94269..16c1b2adc302 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -25,8 +24,8 @@ "WWW-Authenticate": "Bearer authorization=\u0022https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000\u0022, resource=\u0022https://managedhsm.azure.net\u0022", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-request-id": "4599402a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "0" + "x-ms-request-id": "a33b512c-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "1" }, "ResponseBody": null }, @@ -59,17 +58,17 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "45ba5616-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "208" + "x-ms-request-id": "a359c5b2-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "223" }, "ResponseBody": { "attributes": { - "created": 1637185353, + "created": 1640018470, "enabled": true, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185353 + "updated": 1640018470 }, "key": { "e": "AQAB", @@ -81,9 +80,9 @@ "sign", "verify" ], - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/f7fe8ad0e10c0e93b30481d4cfc236e1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/9e6e9ae53d25079fbfc7b2dbe3b7c762", "kty": "RSA-HSM", - "n": "pWVtD-zyDous2z-YpTJK0ynBJ9TMgi0777uaYqutzNMS2Y3oKyC6GQaZToe3tTQM_e4jAb5nXFrZsHSQv0PSRa--Vz-qdSMkzYFIykpDchYEVkH44D-rBlNz9-UuVPiHW-bTmq0j2-VjLmU5al6390Pl4DsupkibBQswDWWFtgaMG8qmSW4iat_OIsqaBndB6VrExXbbnF3D7qeBIVTD-rW5DbHTmlf2r6jlo7g6pXnr0chCAg7UJRBBqZxrLZieR-EmfvMPSEMHNZzX3fB9ASo5OLma3VBp59C4L58ardiGbI4imzeWEiaZPSoxGCBYzhJxwYUdsc3alAGP_AvAKQ" + "n": "qqojvO5U8v8XzOU2-jjeU3e9E5z59GIP46hbQ7paD0diahaS_S6I0Wuw7upfGYg0r_bzdRnDV_euhkARKuwTg_aR-9inBDDh-VJYdY7mb5L8UZLN_UZ5y80NQAuAQuo1NkLqaE3mMBdFp5RJpwphJlQ-e58jSPWI3xiDBs-tz65078xfRPwuWDJ6yvInSaAqrL0uieDbArwDmTmbzMZwzztmjq1vPvAsLE-Pp-Fe2sWltLK2KaaHQx9fBMgk3sXxxL5m70wYHgdbUewt00nu-lvotrk-_jVYDJFmPUeNS9Wr7_q676dl5FaojB1yw0SY9s_aXSEAmWuzKAPirtRXOQ" } } }, @@ -98,11 +97,14 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "Content-Length": "37", + "Content-Length": "69", "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": { + "attributes": { + "exp": 1671554471 + }, "key_ops": [], "tags": { "Tag1": "Val1" @@ -111,7 +113,7 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "669", + "Content-Length": "686", "Content-Security-Policy": "default-src \u0027self\u0027", "Content-Type": "application/json; charset=utf-8", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", @@ -119,29 +121,67 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "45e89b2a-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "141" + "x-ms-request-id": "a3862efe-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "140" }, "ResponseBody": { "attributes": { - "created": 1637185353, + "created": 1640018470, "enabled": true, + "exp": 1671554471, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185353 + "updated": 1640018471 }, "key": { "e": "AQAB", - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/f7fe8ad0e10c0e93b30481d4cfc236e1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/9e6e9ae53d25079fbfc7b2dbe3b7c762", "kty": "RSA-HSM", - "n": "pWVtD-zyDous2z-YpTJK0ynBJ9TMgi0777uaYqutzNMS2Y3oKyC6GQaZToe3tTQM_e4jAb5nXFrZsHSQv0PSRa--Vz-qdSMkzYFIykpDchYEVkH44D-rBlNz9-UuVPiHW-bTmq0j2-VjLmU5al6390Pl4DsupkibBQswDWWFtgaMG8qmSW4iat_OIsqaBndB6VrExXbbnF3D7qeBIVTD-rW5DbHTmlf2r6jlo7g6pXnr0chCAg7UJRBBqZxrLZieR-EmfvMPSEMHNZzX3fB9ASo5OLma3VBp59C4L58ardiGbI4imzeWEiaZPSoxGCBYzhJxwYUdsc3alAGP_AvAKQ" + "n": "qqojvO5U8v8XzOU2-jjeU3e9E5z59GIP46hbQ7paD0diahaS_S6I0Wuw7upfGYg0r_bzdRnDV_euhkARKuwTg_aR-9inBDDh-VJYdY7mb5L8UZLN_UZ5y80NQAuAQuo1NkLqaE3mMBdFp5RJpwphJlQ-e58jSPWI3xiDBs-tz65078xfRPwuWDJ6yvInSaAqrL0uieDbArwDmTmbzMZwzztmjq1vPvAsLE-Pp-Fe2sWltLK2KaaHQx9fBMgk3sXxxL5m70wYHgdbUewt00nu-lvotrk-_jVYDJFmPUeNS9Wr7_q676dl5FaojB1yw0SY9s_aXSEAmWuzKAPirtRXOQ" }, "tags": { "Tag1": "Val1" } } }, + { + "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/doesnotexist/?api-version=7.3-preview", + "RequestMethod": "PATCH", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "PATCH", + ":path": "/keys/doesnotexist/?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "Content-Length": "14", + "Content-Type": "application/json", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": { + "key_ops": [] + }, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "169", + "Content-Security-Policy": "default-src \u0027self\u0027", + "Content-Type": "application/json; charset=utf-8", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "x-ms-request-id": "a3a5d448-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "18" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Key not found: https://rosebudhsm.managedhsm.azure.net/keys/doesnotexist (Activity ID: a3a5d448-61b3-11ec-985f-000d3aec06d7)" + } + } + }, { "RequestUri": "https://fakekvurl.managedhsm.azure.net/keys/key3028589187?api-version=7.3-preview", "RequestMethod": "DELETE", @@ -159,7 +199,7 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "807", + "Content-Length": "824", "Content-Security-Policy": "default-src \u0027self\u0027", "Content-Type": "application/json; charset=utf-8", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", @@ -167,27 +207,28 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "460859f6-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "88" + "x-ms-request-id": "a3b2cf18-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "92" }, "ResponseBody": { "attributes": { - "created": 1637185353, + "created": 1640018470, "enabled": true, + "exp": 1671554471, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185353 + "updated": 1640018471 }, - "deletedDate": 1637185354, + "deletedDate": 1640018471, "key": { "e": "AQAB", - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/f7fe8ad0e10c0e93b30481d4cfc236e1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/9e6e9ae53d25079fbfc7b2dbe3b7c762", "kty": "RSA-HSM", - "n": "pWVtD-zyDous2z-YpTJK0ynBJ9TMgi0777uaYqutzNMS2Y3oKyC6GQaZToe3tTQM_e4jAb5nXFrZsHSQv0PSRa--Vz-qdSMkzYFIykpDchYEVkH44D-rBlNz9-UuVPiHW-bTmq0j2-VjLmU5al6390Pl4DsupkibBQswDWWFtgaMG8qmSW4iat_OIsqaBndB6VrExXbbnF3D7qeBIVTD-rW5DbHTmlf2r6jlo7g6pXnr0chCAg7UJRBBqZxrLZieR-EmfvMPSEMHNZzX3fB9ASo5OLma3VBp59C4L58ardiGbI4imzeWEiaZPSoxGCBYzhJxwYUdsc3alAGP_AvAKQ" + "n": "qqojvO5U8v8XzOU2-jjeU3e9E5z59GIP46hbQ7paD0diahaS_S6I0Wuw7upfGYg0r_bzdRnDV_euhkARKuwTg_aR-9inBDDh-VJYdY7mb5L8UZLN_UZ5y80NQAuAQuo1NkLqaE3mMBdFp5RJpwphJlQ-e58jSPWI3xiDBs-tz65078xfRPwuWDJ6yvInSaAqrL0uieDbArwDmTmbzMZwzztmjq1vPvAsLE-Pp-Fe2sWltLK2KaaHQx9fBMgk3sXxxL5m70wYHgdbUewt00nu-lvotrk-_jVYDJFmPUeNS9Wr7_q676dl5FaojB1yw0SY9s_aXSEAmWuzKAPirtRXOQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key3028589187", - "scheduledPurgeDate": 1637790154, + "scheduledPurgeDate": 1640623271, "tags": { "Tag1": "Val1" } @@ -210,36 +251,37 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "807", + "Content-Length": "824", "Content-Security-Policy": "default-src \u0027self\u0027", "Content-Type": "application/json; charset=utf-8", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "46206096-47ef-11ec-bf7c-000d3a5f7959", + "x-ms-request-id": "a3cb2338-61b3-11ec-985f-000d3aec06d7", "x-ms-server-latency": "35" }, "ResponseBody": { "attributes": { - "created": 1637185353, + "created": 1640018470, "enabled": true, + "exp": 1671554471, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185353 + "updated": 1640018471 }, - "deletedDate": 1637185353, + "deletedDate": 1640018471, "key": { "e": "AQAB", - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/f7fe8ad0e10c0e93b30481d4cfc236e1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/9e6e9ae53d25079fbfc7b2dbe3b7c762", "kty": "RSA-HSM", - "n": "pWVtD-zyDous2z-YpTJK0ynBJ9TMgi0777uaYqutzNMS2Y3oKyC6GQaZToe3tTQM_e4jAb5nXFrZsHSQv0PSRa--Vz-qdSMkzYFIykpDchYEVkH44D-rBlNz9-UuVPiHW-bTmq0j2-VjLmU5al6390Pl4DsupkibBQswDWWFtgaMG8qmSW4iat_OIsqaBndB6VrExXbbnF3D7qeBIVTD-rW5DbHTmlf2r6jlo7g6pXnr0chCAg7UJRBBqZxrLZieR-EmfvMPSEMHNZzX3fB9ASo5OLma3VBp59C4L58ardiGbI4imzeWEiaZPSoxGCBYzhJxwYUdsc3alAGP_AvAKQ" + "n": "qqojvO5U8v8XzOU2-jjeU3e9E5z59GIP46hbQ7paD0diahaS_S6I0Wuw7upfGYg0r_bzdRnDV_euhkARKuwTg_aR-9inBDDh-VJYdY7mb5L8UZLN_UZ5y80NQAuAQuo1NkLqaE3mMBdFp5RJpwphJlQ-e58jSPWI3xiDBs-tz65078xfRPwuWDJ6yvInSaAqrL0uieDbArwDmTmbzMZwzztmjq1vPvAsLE-Pp-Fe2sWltLK2KaaHQx9fBMgk3sXxxL5m70wYHgdbUewt00nu-lvotrk-_jVYDJFmPUeNS9Wr7_q676dl5FaojB1yw0SY9s_aXSEAmWuzKAPirtRXOQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key3028589187", - "scheduledPurgeDate": 1637790153, + "scheduledPurgeDate": 1640623271, "tags": { "Tag1": "Val1" } @@ -262,36 +304,37 @@ "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", - "Content-Length": "807", + "Content-Length": "824", "Content-Security-Policy": "default-src \u0027self\u0027", "Content-Type": "application/json; charset=utf-8", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "SAMEORIGIN", - "x-ms-build-version": "1.0.20211018-1-9c44708a-develop", + "x-ms-build-version": "1.0.20211206-1-be739728-develop", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "462fdcb0-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "32" + "x-ms-request-id": "a3daedc2-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "35" }, "ResponseBody": { "attributes": { - "created": 1637185353, + "created": 1640018470, "enabled": true, + "exp": 1671554471, "exportable": false, "recoverableDays": 7, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", - "updated": 1637185353 + "updated": 1640018471 }, - "deletedDate": 1637185353, + "deletedDate": 1640018471, "key": { "e": "AQAB", - "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/f7fe8ad0e10c0e93b30481d4cfc236e1", + "kid": "https://rosebudhsm.managedhsm.azure.net/keys/key3028589187/9e6e9ae53d25079fbfc7b2dbe3b7c762", "kty": "RSA-HSM", - "n": "pWVtD-zyDous2z-YpTJK0ynBJ9TMgi0777uaYqutzNMS2Y3oKyC6GQaZToe3tTQM_e4jAb5nXFrZsHSQv0PSRa--Vz-qdSMkzYFIykpDchYEVkH44D-rBlNz9-UuVPiHW-bTmq0j2-VjLmU5al6390Pl4DsupkibBQswDWWFtgaMG8qmSW4iat_OIsqaBndB6VrExXbbnF3D7qeBIVTD-rW5DbHTmlf2r6jlo7g6pXnr0chCAg7UJRBBqZxrLZieR-EmfvMPSEMHNZzX3fB9ASo5OLma3VBp59C4L58ardiGbI4imzeWEiaZPSoxGCBYzhJxwYUdsc3alAGP_AvAKQ" + "n": "qqojvO5U8v8XzOU2-jjeU3e9E5z59GIP46hbQ7paD0diahaS_S6I0Wuw7upfGYg0r_bzdRnDV_euhkARKuwTg_aR-9inBDDh-VJYdY7mb5L8UZLN_UZ5y80NQAuAQuo1NkLqaE3mMBdFp5RJpwphJlQ-e58jSPWI3xiDBs-tz65078xfRPwuWDJ6yvInSaAqrL0uieDbArwDmTmbzMZwzztmjq1vPvAsLE-Pp-Fe2sWltLK2KaaHQx9fBMgk3sXxxL5m70wYHgdbUewt00nu-lvotrk-_jVYDJFmPUeNS9Wr7_q676dl5FaojB1yw0SY9s_aXSEAmWuzKAPirtRXOQ" }, "recoveryId": "https://rosebudhsm.managedhsm.azure.net/deletedkeys/key3028589187", - "scheduledPurgeDate": 1637790153, + "scheduledPurgeDate": 1640623271, "tags": { "Tag1": "Val1" } @@ -322,8 +365,8 @@ "X-Frame-Options": "SAMEORIGIN", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=Ipv4;", "x-ms-keyvault-region": "southcentralus", - "x-ms-request-id": "463efee8-47ef-11ec-bf7c-000d3a5f7959", - "x-ms-server-latency": "111" + "x-ms-request-id": "a3ea9e8e-61b3-11ec-985f-000d3aec06d7", + "x-ms-server-latency": "114" }, "ResponseBody": null } diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_NON-HSM.json index 9c7da6d41fbb..081bfca248c9 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyProperties/TestUpdateKeyProperties_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:19 GMT", + "Date": "Mon, 20 Dec 2021 16:41:08 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -29,7 +28,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "099f3a1a-bde5-4d43-9105-90f435ed7e66", + "x-ms-request-id": "6f42dfd5-b4e2-44be-8adf-e405cb778892", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,7 +61,7 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:20 GMT", + "Date": "Mon, 20 Dec 2021 16:41:08 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -70,12 +69,12 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "b4939157-7115-4e32-ba9d-e57c97336182", + "x-ms-request-id": "7d9086e1-3d2e-4fea-a74e-4d31834922a9", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/000d11a3aa4b41139ce6468725eed0a0", + "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/804e9c5dd07a496c80fc051ba9e7101d", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "1VhfcZXRsE7l4G37B4gAjlbFes7HMSmNeDfkUkV3OvsTu70790TsxwLyU67L_O6wDzyGqh0KfE07Ea1XPsb-VJNaZIwrZjqvoQy7eCmFk9_Rlsdc8lLkfKrP6eTtRe2w9-DnDSz6v2Mrpg-oJzwwv-LilBbc6qcGXhh1XH2iyUC2ZaaZSZqVWwW6nM0OltoyqNC3QhR0hzcW3NQdox6f72Yhczy1qaDkBdu7oWHygW6Xk1FR-6DurpKAQXy9T2ZQLCn-1PJKz8sV1Ma11HBOkCfoH4Q_8l50YqmqbsyUkNryA3ZEnfAI1HbvV1oV94BrwGoDBxQmBVZMC8qX6_OfvQ", + "n": "5GwX_jyr3tMTQlN8wVbZ2dhD3rhgYn2EkrcY9Si_twx0kt96CjVv6ay0RK8i2iyRVsBb66p42m_lFAF_5cOG6SBi9i3psL3Hag9krRm4LFcwr6cmFcUDSrpOc3ztNeyS7iKH7_OvcRSUYGRpk0BN2zLzQZdmof6MMVlnnNXUstLFZcZlMvTwmESh1oQ7XRDQMizwxA2Qt8Ca-Yy9-suTWBNfvJOm8FMyipvdrtzzfhtggvdu6sEf3Hm5Qg6T20y9Z97BHT72q1Vm6mim2r4ijDm7h7X5QUOmgyA_7xrJQBnbCYeeGb407IRAIlwrLVPV0Yj8A4LZs6fu8wk8mmCkYQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1639071800, - "updated": 1639071800, + "created": 1640018468, + "updated": 1640018468, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -114,7 +113,7 @@ }, "RequestBody": { "attributes": { - "exp": 1670607800 + "exp": 1671554469 }, "key_ops": [], "tags": { @@ -126,7 +125,7 @@ "Cache-Control": "no-cache", "Content-Length": "670", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:20 GMT", + "Date": "Mon, 20 Dec 2021 16:41:09 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -134,22 +133,22 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "9f9a04cc-01e4-47fd-9493-f263802902b0", + "x-ms-request-id": "603fc24a-c9fd-4a55-82aa-143ccf417015", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/000d11a3aa4b41139ce6468725eed0a0", + "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/804e9c5dd07a496c80fc051ba9e7101d", "kty": "RSA", "key_ops": [], - "n": "1VhfcZXRsE7l4G37B4gAjlbFes7HMSmNeDfkUkV3OvsTu70790TsxwLyU67L_O6wDzyGqh0KfE07Ea1XPsb-VJNaZIwrZjqvoQy7eCmFk9_Rlsdc8lLkfKrP6eTtRe2w9-DnDSz6v2Mrpg-oJzwwv-LilBbc6qcGXhh1XH2iyUC2ZaaZSZqVWwW6nM0OltoyqNC3QhR0hzcW3NQdox6f72Yhczy1qaDkBdu7oWHygW6Xk1FR-6DurpKAQXy9T2ZQLCn-1PJKz8sV1Ma11HBOkCfoH4Q_8l50YqmqbsyUkNryA3ZEnfAI1HbvV1oV94BrwGoDBxQmBVZMC8qX6_OfvQ", + "n": "5GwX_jyr3tMTQlN8wVbZ2dhD3rhgYn2EkrcY9Si_twx0kt96CjVv6ay0RK8i2iyRVsBb66p42m_lFAF_5cOG6SBi9i3psL3Hag9krRm4LFcwr6cmFcUDSrpOc3ztNeyS7iKH7_OvcRSUYGRpk0BN2zLzQZdmof6MMVlnnNXUstLFZcZlMvTwmESh1oQ7XRDQMizwxA2Qt8Ca-Yy9-suTWBNfvJOm8FMyipvdrtzzfhtggvdu6sEf3Hm5Qg6T20y9Z97BHT72q1Vm6mim2r4ijDm7h7X5QUOmgyA_7xrJQBnbCYeeGb407IRAIlwrLVPV0Yj8A4LZs6fu8wk8mmCkYQ", "e": "AQAB" }, "attributes": { "enabled": true, - "exp": 1670607800, - "created": 1639071800, - "updated": 1639071800, + "exp": 1671554469, + "created": 1640018468, + "updated": 1640018469, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 }, @@ -181,7 +180,7 @@ "Cache-Control": "no-cache", "Content-Length": "300", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:20 GMT", + "Date": "Mon, 20 Dec 2021 16:41:09 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -189,7 +188,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "835995e3-ec90-4ad5-afa5-77ca0609ae93", + "x-ms-request-id": "6d1a0c21-f8f4-4609-b0ee-c131903c04d8", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -218,7 +217,7 @@ "Cache-Control": "no-cache", "Content-Length": "802", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:20 GMT", + "Date": "Mon, 20 Dec 2021 16:41:09 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -226,25 +225,25 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "7a23f5f2-94e9-4eec-9d02-e89c74ee8035", + "x-ms-request-id": "b18214f4-a45a-4f09-8d3e-9e28ba52c502", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3533325025", - "deletedDate": 1639071801, - "scheduledPurgeDate": 1639676601, + "deletedDate": 1640018469, + "scheduledPurgeDate": 1640623269, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/000d11a3aa4b41139ce6468725eed0a0", + "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/804e9c5dd07a496c80fc051ba9e7101d", "kty": "RSA", "key_ops": [], - "n": "1VhfcZXRsE7l4G37B4gAjlbFes7HMSmNeDfkUkV3OvsTu70790TsxwLyU67L_O6wDzyGqh0KfE07Ea1XPsb-VJNaZIwrZjqvoQy7eCmFk9_Rlsdc8lLkfKrP6eTtRe2w9-DnDSz6v2Mrpg-oJzwwv-LilBbc6qcGXhh1XH2iyUC2ZaaZSZqVWwW6nM0OltoyqNC3QhR0hzcW3NQdox6f72Yhczy1qaDkBdu7oWHygW6Xk1FR-6DurpKAQXy9T2ZQLCn-1PJKz8sV1Ma11HBOkCfoH4Q_8l50YqmqbsyUkNryA3ZEnfAI1HbvV1oV94BrwGoDBxQmBVZMC8qX6_OfvQ", + "n": "5GwX_jyr3tMTQlN8wVbZ2dhD3rhgYn2EkrcY9Si_twx0kt96CjVv6ay0RK8i2iyRVsBb66p42m_lFAF_5cOG6SBi9i3psL3Hag9krRm4LFcwr6cmFcUDSrpOc3ztNeyS7iKH7_OvcRSUYGRpk0BN2zLzQZdmof6MMVlnnNXUstLFZcZlMvTwmESh1oQ7XRDQMizwxA2Qt8Ca-Yy9-suTWBNfvJOm8FMyipvdrtzzfhtggvdu6sEf3Hm5Qg6T20y9Z97BHT72q1Vm6mim2r4ijDm7h7X5QUOmgyA_7xrJQBnbCYeeGb407IRAIlwrLVPV0Yj8A4LZs6fu8wk8mmCkYQ", "e": "AQAB" }, "attributes": { "enabled": true, - "exp": 1670607800, - "created": 1639071800, - "updated": 1639071800, + "exp": 1671554469, + "created": 1640018468, + "updated": 1640018469, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 }, @@ -272,7 +271,44 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:20 GMT", + "Date": "Mon, 20 Dec 2021 16:41:09 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000;includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", + "x-ms-keyvault-region": "westus2", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "950aec26-b53b-4ee6-b8ba-bd9e7704f6f5", + "X-Powered-By": "ASP.NET" + }, + "ResponseBody": { + "error": { + "code": "KeyNotFound", + "message": "Deleted Key not found: key3533325025" + } + } + }, + { + "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key3533325025?api-version=7.3-preview", + "RequestMethod": "GET", + "RequestHeaders": { + ":authority": "localhost:5001", + ":method": "GET", + ":path": "/deletedkeys/key3533325025?api-version=7.3-preview", + ":scheme": "https", + "Accept": "application/json", + "Accept-Encoding": "gzip", + "Authorization": "Sanitized", + "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" + }, + "RequestBody": null, + "StatusCode": 404, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "81", + "Content-Type": "application/json; charset=utf-8", + "Date": "Mon, 20 Dec 2021 16:41:09 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -280,7 +316,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "c917ee8f-f68a-4990-8be4-039895dd49c9", + "x-ms-request-id": "10fe82ea-8316-44ce-8aef-9eec0e706510", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -309,7 +345,7 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:20 GMT", + "Date": "Mon, 20 Dec 2021 16:41:09 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -317,7 +353,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "31baa6d6-068a-4847-9c07-ddfa1cc4b3b8", + "x-ms-request-id": "9e5716d9-72a9-41a8-bf8a-07b714945913", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -346,7 +382,7 @@ "Cache-Control": "no-cache", "Content-Length": "802", "Content-Type": "application/json; charset=utf-8", - "Date": "Thu, 09 Dec 2021 17:43:21 GMT", + "Date": "Mon, 20 Dec 2021 16:41:10 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -354,25 +390,25 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "eb144f93-7863-4b62-b7e3-20e205d4232d", + "x-ms-request-id": "aea85611-1b17-4baf-a1b7-5e2d4cc1e54e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key3533325025", - "deletedDate": 1639071801, - "scheduledPurgeDate": 1639676601, + "deletedDate": 1640018469, + "scheduledPurgeDate": 1640623269, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/000d11a3aa4b41139ce6468725eed0a0", + "kid": "https://fakekvurl.vault.azure.net/keys/key3533325025/804e9c5dd07a496c80fc051ba9e7101d", "kty": "RSA", "key_ops": [], - "n": "1VhfcZXRsE7l4G37B4gAjlbFes7HMSmNeDfkUkV3OvsTu70790TsxwLyU67L_O6wDzyGqh0KfE07Ea1XPsb-VJNaZIwrZjqvoQy7eCmFk9_Rlsdc8lLkfKrP6eTtRe2w9-DnDSz6v2Mrpg-oJzwwv-LilBbc6qcGXhh1XH2iyUC2ZaaZSZqVWwW6nM0OltoyqNC3QhR0hzcW3NQdox6f72Yhczy1qaDkBdu7oWHygW6Xk1FR-6DurpKAQXy9T2ZQLCn-1PJKz8sV1Ma11HBOkCfoH4Q_8l50YqmqbsyUkNryA3ZEnfAI1HbvV1oV94BrwGoDBxQmBVZMC8qX6_OfvQ", + "n": "5GwX_jyr3tMTQlN8wVbZ2dhD3rhgYn2EkrcY9Si_twx0kt96CjVv6ay0RK8i2iyRVsBb66p42m_lFAF_5cOG6SBi9i3psL3Hag9krRm4LFcwr6cmFcUDSrpOc3ztNeyS7iKH7_OvcRSUYGRpk0BN2zLzQZdmof6MMVlnnNXUstLFZcZlMvTwmESh1oQ7XRDQMizwxA2Qt8Ca-Yy9-suTWBNfvJOm8FMyipvdrtzzfhtggvdu6sEf3Hm5Qg6T20y9Z97BHT72q1Vm6mim2r4ijDm7h7X5QUOmgyA_7xrJQBnbCYeeGb407IRAIlwrLVPV0Yj8A4LZs6fu8wk8mmCkYQ", "e": "AQAB" }, "attributes": { "enabled": true, - "exp": 1670607800, - "created": 1639071800, - "updated": 1639071800, + "exp": 1671554469, + "created": 1640018468, + "updated": 1640018469, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 }, @@ -398,7 +434,7 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Thu, 09 Dec 2021 17:43:21 GMT", + "Date": "Mon, 20 Dec 2021 16:41:10 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -406,7 +442,7 @@ "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", "x-ms-keyvault-service-version": "1.9.195.1", - "x-ms-request-id": "3fa458c2-3635-420e-9c54-5c3b92db3984", + "x-ms-request-id": "84989d82-b6dd-45d1-9f68-de3b3821c46f", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyRotationPolicy/TestUpdateKeyRotationPolicy_NON-HSM.json b/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyRotationPolicy/TestUpdateKeyRotationPolicy_NON-HSM.json index f26cec42b118..8c890c514e3c 100644 --- a/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyRotationPolicy/TestUpdateKeyRotationPolicy_NON-HSM.json +++ b/sdk/keyvault/azkeys/testdata/recordings/TestUpdateKeyRotationPolicy/TestUpdateKeyRotationPolicy_NON-HSM.json @@ -11,7 +11,6 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Content-Length": "0", - "Content-Type": "application/json", "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" }, "RequestBody": null, @@ -20,7 +19,7 @@ "Cache-Control": "no-cache", "Content-Length": "97", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:02 GMT", + "Date": "Mon, 20 Dec 2021 16:41:37 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", @@ -28,8 +27,8 @@ "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "a0a4bac6-553b-4ad9-8f14-e92f6ebd7839", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "d28eacf0-54de-421a-891f-46dd37727575", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -62,20 +61,20 @@ "Cache-Control": "no-cache", "Content-Length": "687", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:02 GMT", + "Date": "Mon, 20 Dec 2021 16:41:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "4107d9cc-5655-49f7-80cd-90ad86e7d489", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "12562b08-f42f-4533-a6c9-6cbd4736282d", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key1190835325/0b032dbb7c2e4924bfd17b79876f6101", + "kid": "https://fakekvurl.vault.azure.net/keys/key1190835325/d94642e9f7e04dc0afbf70faf75a7434", "kty": "RSA", "key_ops": [ "encrypt", @@ -85,13 +84,13 @@ "wrapKey", "unwrapKey" ], - "n": "y15N8te8zgLJqe4bnppyuAaMscdvP7z_oSKNLRBzcP4PwxGE6vbrHPxL3gG6wDNzIUiUD-W1ziW-HSz1EMexxyY7aVT9mHhFcGfozkidlVJsdDWyVO21KRPtb6bNj66ZqdFiD36DrOCVyQ1WEeGSlw5GhldITNwosHo76QKKvNng7u5uNZKYLrZksG3r05bjaKkSDhMeupsY_LfS3w7we2Gbf5yAJnE3ivqYH7o2ha-gT7MxLFuNbkXNZv8SHFxRQoCmd3sv5OFtl_blPjNiCA2ucPH-AjLe2l_GfQoW5_PE-kiQxunsTBO6d6Gd8FVE2lYgw0v_QkLvoDxJevPZzQ", + "n": "zL1XBD26XOGwV9_lq_nQDUs5_89OAa5951wkapIE6bQDhERk7DH3tpPTqO_QS0TeROZmvcqV4kFK3l_Tfrj8K_59oUfWkjojdpHjvwv5cj0ulXTcrW8OHoUsew6zRVQ6yKBVgQidgHUWnD8C9jYtrW7IxSODcjzgCNpvOnEglVAG6eFZPfueqPlpBNPmtkEOxXRk0LOyWRknob7NYWgp6tLLieW0RwSxtgtSsxUG0qXpOZa2QP3V45sNIdzzfPsXhbDZuezsdLmbOGDFNIuqYY5DPxc5l3mAzXBTYC64QV2qsTx-NCyndOui0aRUYog_e0_MgqWH5fHWywmsBlljPQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185383, - "updated": 1637185383, + "created": 1640018498, + "updated": 1640018498, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -132,15 +131,15 @@ "Cache-Control": "no-cache", "Content-Length": "238", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:02 GMT", + "Date": "Mon, 20 Dec 2021 16:41:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "089a6ef9-d0ab-45c6-97de-aacf7d643f15", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "cf1db816-f503-4c75-a348-cd2746a5aa12", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -157,8 +156,8 @@ ], "attributes": { "expiryTime": "P90D", - "created": 1637185383, - "updated": 1637185383 + "created": 1640018498, + "updated": 1640018498 } } }, @@ -181,23 +180,23 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:02 GMT", + "Date": "Mon, 20 Dec 2021 16:41:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "7e6f54da-57a1-4b99-9086-f93630b57274", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "771b9e30-7d4e-4c97-9c46-8f2010f5dba6", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325", - "deletedDate": 1637185383, - "scheduledPurgeDate": 1637790183, + "deletedDate": 1640018498, + "scheduledPurgeDate": 1640623298, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key1190835325/0b032dbb7c2e4924bfd17b79876f6101", + "kid": "https://fakekvurl.vault.azure.net/keys/key1190835325/d94642e9f7e04dc0afbf70faf75a7434", "kty": "RSA", "key_ops": [ "encrypt", @@ -207,13 +206,13 @@ "wrapKey", "unwrapKey" ], - "n": "y15N8te8zgLJqe4bnppyuAaMscdvP7z_oSKNLRBzcP4PwxGE6vbrHPxL3gG6wDNzIUiUD-W1ziW-HSz1EMexxyY7aVT9mHhFcGfozkidlVJsdDWyVO21KRPtb6bNj66ZqdFiD36DrOCVyQ1WEeGSlw5GhldITNwosHo76QKKvNng7u5uNZKYLrZksG3r05bjaKkSDhMeupsY_LfS3w7we2Gbf5yAJnE3ivqYH7o2ha-gT7MxLFuNbkXNZv8SHFxRQoCmd3sv5OFtl_blPjNiCA2ucPH-AjLe2l_GfQoW5_PE-kiQxunsTBO6d6Gd8FVE2lYgw0v_QkLvoDxJevPZzQ", + "n": "zL1XBD26XOGwV9_lq_nQDUs5_89OAa5951wkapIE6bQDhERk7DH3tpPTqO_QS0TeROZmvcqV4kFK3l_Tfrj8K_59oUfWkjojdpHjvwv5cj0ulXTcrW8OHoUsew6zRVQ6yKBVgQidgHUWnD8C9jYtrW7IxSODcjzgCNpvOnEglVAG6eFZPfueqPlpBNPmtkEOxXRk0LOyWRknob7NYWgp6tLLieW0RwSxtgtSsxUG0qXpOZa2QP3V45sNIdzzfPsXhbDZuezsdLmbOGDFNIuqYY5DPxc5l3mAzXBTYC64QV2qsTx-NCyndOui0aRUYog_e0_MgqWH5fHWywmsBlljPQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185383, - "updated": 1637185383, + "created": 1640018498, + "updated": 1640018498, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -238,570 +237,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:02 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "2d6aa321-bd59-4053-81d8-330ceeb98562", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:03 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "0afc0458-ef2e-4b8c-9cce-c4debc0e340b", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:03 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "f3b52a9d-fd15-480a-af9d-d3bdd7d45d89", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:03 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "50462b82-8a2d-42a1-882e-2d6e7434e768", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "f510a591-e00d-4a70-8704-6350f4cd9d62", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "a3946f72-8c95-4d39-9bd8-53bf26f662c6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:04 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "89f04578-720e-4928-bd5c-2c977e5d73c6", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:05 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "b9b5f13e-b48c-434a-b8c8-4d2e2b6b4af5", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:05 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "08f4cae6-75c6-434b-97b1-731787b9b81e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:05 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "8b179434-afb5-4898-967d-b15055a40e19", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:06 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "9b05ffbd-0596-474d-91c5-b69ff2a92eaa", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:06 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "fee7228b-02fa-450f-9db1-e86686ec2d69", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:07 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "ed8e6c19-1d73-4cff-96e4-93c6f220c085", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:07 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "3419378d-c904-4217-9731-a343a566546e", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:07 GMT", - "Expires": "-1", - "Pragma": "no-cache", - "Strict-Transport-Security": "max-age=31536000;includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", - "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "5ed66a1a-45b1-4a19-97cd-5d66d686138c", - "X-Powered-By": "ASP.NET" - }, - "ResponseBody": { - "error": { - "code": "KeyNotFound", - "message": "Deleted Key not found: key1190835325" - } - } - }, - { - "RequestUri": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325?api-version=7.3-preview", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/deletedkeys/key1190835325?api-version=7.3-preview", - ":scheme": "https", - "Accept": "application/json", - "Accept-Encoding": "gzip", - "Authorization": "Sanitized", - "User-Agent": "azsdk-go-internal/v0.1.1 azsdk-go-azcore/v0.20.0 (go1.17; Windows_NT)" - }, - "RequestBody": null, - "StatusCode": 404, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "81", - "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:08 GMT", + "Date": "Mon, 20 Dec 2021 16:41:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "33f58cdb-b48c-46e2-ad8e-c206bebb4876", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "47d05912-8ae8-4d80-97e0-0a6342c499a0", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -830,15 +274,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:08 GMT", + "Date": "Mon, 20 Dec 2021 16:41:38 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "c27a3b7c-e9d9-4e2a-995a-57af87816abc", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "8dcf200d-5e33-488b-b9d3-82780ea3b203", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -867,15 +311,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:08 GMT", + "Date": "Mon, 20 Dec 2021 16:41:39 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "bc8e8f06-a7d0-4730-a043-f4c7c659e3df", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "bc419adf-a28b-4231-86f5-0e43e7dc081e", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -904,15 +348,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:10 GMT", + "Date": "Mon, 20 Dec 2021 16:41:39 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "0814bb23-bc24-489b-8cad-204e0c768b36", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "7d43a292-cee6-40f7-8ac2-da693f5de2b0", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -941,15 +385,15 @@ "Cache-Control": "no-cache", "Content-Length": "81", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:10 GMT", + "Date": "Mon, 20 Dec 2021 16:41:39 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "d4c69e49-e658-4c18-8aa6-56cd461a6bde", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "905f7f5a-bb82-4823-90c6-36d8a99952f6", "X-Powered-By": "ASP.NET" }, "ResponseBody": { @@ -978,23 +422,23 @@ "Cache-Control": "no-cache", "Content-Length": "819", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 17 Nov 2021 21:43:10 GMT", + "Date": "Mon, 20 Dec 2021 16:41:40 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "9efd718e-db8d-4bba-abf4-e692e088fa71", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "ae30799c-0599-4212-9204-f0cc1ff4c5fa", "X-Powered-By": "ASP.NET" }, "ResponseBody": { "recoveryId": "https://fakekvurl.vault.azure.net/deletedkeys/key1190835325", - "deletedDate": 1637185383, - "scheduledPurgeDate": 1637790183, + "deletedDate": 1640018498, + "scheduledPurgeDate": 1640623298, "key": { - "kid": "https://fakekvurl.vault.azure.net/keys/key1190835325/0b032dbb7c2e4924bfd17b79876f6101", + "kid": "https://fakekvurl.vault.azure.net/keys/key1190835325/d94642e9f7e04dc0afbf70faf75a7434", "kty": "RSA", "key_ops": [ "encrypt", @@ -1004,13 +448,13 @@ "wrapKey", "unwrapKey" ], - "n": "y15N8te8zgLJqe4bnppyuAaMscdvP7z_oSKNLRBzcP4PwxGE6vbrHPxL3gG6wDNzIUiUD-W1ziW-HSz1EMexxyY7aVT9mHhFcGfozkidlVJsdDWyVO21KRPtb6bNj66ZqdFiD36DrOCVyQ1WEeGSlw5GhldITNwosHo76QKKvNng7u5uNZKYLrZksG3r05bjaKkSDhMeupsY_LfS3w7we2Gbf5yAJnE3ivqYH7o2ha-gT7MxLFuNbkXNZv8SHFxRQoCmd3sv5OFtl_blPjNiCA2ucPH-AjLe2l_GfQoW5_PE-kiQxunsTBO6d6Gd8FVE2lYgw0v_QkLvoDxJevPZzQ", + "n": "zL1XBD26XOGwV9_lq_nQDUs5_89OAa5951wkapIE6bQDhERk7DH3tpPTqO_QS0TeROZmvcqV4kFK3l_Tfrj8K_59oUfWkjojdpHjvwv5cj0ulXTcrW8OHoUsew6zRVQ6yKBVgQidgHUWnD8C9jYtrW7IxSODcjzgCNpvOnEglVAG6eFZPfueqPlpBNPmtkEOxXRk0LOyWRknob7NYWgp6tLLieW0RwSxtgtSsxUG0qXpOZa2QP3V45sNIdzzfPsXhbDZuezsdLmbOGDFNIuqYY5DPxc5l3mAzXBTYC64QV2qsTx-NCyndOui0aRUYog_e0_MgqWH5fHWywmsBlljPQ", "e": "AQAB" }, "attributes": { "enabled": true, - "created": 1637185383, - "updated": 1637185383, + "created": 1640018498, + "updated": 1640018498, "recoveryLevel": "CustomizedRecoverable\u002BPurgeable", "recoverableDays": 7 } @@ -1033,15 +477,15 @@ "StatusCode": 204, "ResponseHeaders": { "Cache-Control": "no-cache", - "Date": "Wed, 17 Nov 2021 21:43:10 GMT", + "Date": "Mon, 20 Dec 2021 16:41:40 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000;includeSubDomains", "X-Content-Type-Options": "nosniff", "x-ms-keyvault-network-info": "conn_type=Ipv4;addr=72.49.29.93;act_addr_fam=InterNetwork;", "x-ms-keyvault-region": "westus2", - "x-ms-keyvault-service-version": "1.9.150.1", - "x-ms-request-id": "71454496-5d92-4495-8eb3-bcebe46db2a9", + "x-ms-keyvault-service-version": "1.9.195.1", + "x-ms-request-id": "9892913a-275b-4ba0-b3ea-80f9c43576b7", "X-Powered-By": "ASP.NET" }, "ResponseBody": null diff --git a/sdk/keyvault/azkeys/utils_test.go b/sdk/keyvault/azkeys/utils_test.go index 7788ae01e977..91d146ae486b 100644 --- a/sdk/keyvault/azkeys/utils_test.go +++ b/sdk/keyvault/azkeys/utils_test.go @@ -138,7 +138,7 @@ func lookupEnvVar(s string) string { func createClient(t *testing.T, testType string) (*Client, error) { vaultUrl := recording.GetEnvVariable("AZURE_KEYVAULT_URL", fakeKvURL) - var credOptions *azidentity.ClientSecretCredentialOptions + // var credOptions *azidentity.ClientSecretCredentialOptions if testType == HSMTEST { vaultUrl = recording.GetEnvVariable("AZURE_MANAGEDHSM_URL", fakeKvMHSMURL) } @@ -157,7 +157,7 @@ func createClient(t *testing.T, testType string) (*Client, error) { tenantId := lookupEnvVar("AZKEYS_TENANT_ID") clientId := lookupEnvVar("AZKEYS_CLIENT_ID") clientSecret := lookupEnvVar("AZKEYS_CLIENT_SECRET") - cred, err = azidentity.NewClientSecretCredential(tenantId, clientId, clientSecret, credOptions) + cred, err = azidentity.NewClientSecretCredential(tenantId, clientId, clientSecret, nil) require.NoError(t, err) } else { cred = NewFakeCredential("fake", "fake") diff --git a/sdk/keyvault/internal/challenge_policy.go b/sdk/keyvault/internal/challenge_policy.go index f45d86e3af5f..17f90fc9a4f3 100644 --- a/sdk/keyvault/internal/challenge_policy.go +++ b/sdk/keyvault/internal/challenge_policy.go @@ -7,9 +7,9 @@ package internal import ( + "bytes" "errors" "fmt" - "io" "net/http" "strings" "time" @@ -17,6 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" ) @@ -29,14 +30,12 @@ type KeyVaultChallengePolicy struct { cred azcore.TokenCredential scope *string tenantID *string - pipeline runtime.Pipeline } -func NewKeyVaultChallengePolicy(cred azcore.TokenCredential, pipeline runtime.Pipeline) *KeyVaultChallengePolicy { +func NewKeyVaultChallengePolicy(cred azcore.TokenCredential) *KeyVaultChallengePolicy { return &KeyVaultChallengePolicy{ cred: cred, mainResource: NewExpiringResource(acquire), - pipeline: pipeline, } } @@ -53,7 +52,7 @@ func (k *KeyVaultChallengePolicy) Do(req *policy.Request) (*http.Response, error return nil, err } - resp, err := k.pipeline.Do(challengeReq) + resp, err := challengeReq.Next() if err != nil { return nil, err } @@ -72,7 +71,7 @@ func (k *KeyVaultChallengePolicy) Do(req *policy.Request) (*http.Response, error if token, ok := tk.(*azcore.AccessToken); ok { req.Raw().Header.Set( headerAuthorization, - fmt.Sprintf(bearerHeader+token.Token), + fmt.Sprintf("%s%s", bearerHeader, token.Token), ) } @@ -92,7 +91,7 @@ func (k *KeyVaultChallengePolicy) Do(req *policy.Request) (*http.Response, error err := k.findScopeAndTenant(resp) if err != nil { // Error parsing challenge, doomed to fail. Return - return resp, err + return resp, cloneReqErr } tk, err := k.mainResource.GetResource(as) @@ -139,7 +138,7 @@ func (k *KeyVaultChallengePolicy) findScopeAndTenant(resp *http.Response) error // Strip down to auth and resource // Format is "Bearer authorization=\"\" resource=\"\"" OR // "Bearer authorization=\"\" scope=\"\" resource=\"\"" - authHeader = strings.ReplaceAll(authHeader, bearerHeader, "") + authHeader = strings.ReplaceAll(authHeader, "Bearer ", "") parts := strings.Split(authHeader, " ") @@ -168,21 +167,6 @@ func (k *KeyVaultChallengePolicy) findScopeAndTenant(resp *http.Response) error return nil } -// The next three methods are copied from azcore/internal/shared.go -type nopCloser struct { - io.ReadSeeker -} - -func (n nopCloser) Close() error { - return nil -} - -// NopCloser returns a ReadSeekCloser with a no-op close method wrapping the provided io.ReadSeeker. -func NopCloser(rs io.ReadSeeker) io.ReadSeekCloser { - return nopCloser{rs} -} - -// TODO: Why is this sending with a body? Proxy fails here func (k KeyVaultChallengePolicy) getChallengeRequest(orig policy.Request) (*policy.Request, error) { req, err := runtime.NewRequest(orig.Raw().Context(), orig.Raw().Method, orig.Raw().URL.String()) if err != nil { @@ -191,8 +175,19 @@ func (k KeyVaultChallengePolicy) getChallengeRequest(orig policy.Request) (*poli req.Raw().Header = orig.Raw().Header req.Raw().Header.Set("Content-Length", "0") + req.Raw().ContentLength = 0 + + copied := orig.Clone(orig.Raw().Context()) + copied.Raw().Body = req.Body() + copied.Raw().ContentLength = 0 + copied.Raw().Header.Set("Content-Length", "0") + err = copied.SetBody(streaming.NopCloser(bytes.NewReader([]byte{})), "application/json") + if err != nil { + return nil, err + } + copied.Raw().Header.Del("Content-Type") - return req, err + return copied, err } type acquiringResourceState struct { From d25e96ad457c5d8eaa4ba5aa6f0b4782c5350a62 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Mon, 3 Jan 2022 14:25:05 -0800 Subject: [PATCH 09/36] Add spell check warnings (#16656) * Add spell check warnings * Basic cspell.json * Ignore files in .vscode except cspell.json, new line before EOF in cspell.json * Spell check, ignore thyself --- .gitignore | 4 ++ .vscode/cspell.json | 56 +++++++++++++++++++ .../templates/jobs/archetype-sdk-client.yml | 2 + 3 files changed, 62 insertions(+) create mode 100644 .vscode/cspell.json diff --git a/.gitignore b/.gitignore index 6a6c28b77a6f..3ce3ffd7ba02 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,7 @@ vendor/ # environment variables .env + +# vscode +**/.vscode/* +!.vscode/cspell.json diff --git a/.vscode/cspell.json b/.vscode/cspell.json new file mode 100644 index 000000000000..248a2010ea15 --- /dev/null +++ b/.vscode/cspell.json @@ -0,0 +1,56 @@ +{ + "version": "0.2", + "language": "en", + "languageId": "golang", + "dictionaries": [ + "powershell", + "golang", + "softwareTerms", + "en_US", + "en-gb" + ], + "ignorePaths": [ + "eng/common/**", + ".vscode/cspell.json", + "*.PNG", + "*.pfx", + "**/recordings/**/*" + ], + "words": [ + "azcore", + "azidentity", + "unpopulate", + "etag", + "stretchr", + "Unmarshaller", + "AMQP", + "Kusto", + "azblob", + "Kubernetes", + "vnet", + "skus", + "azservicebus", + "azcosmos", + "Reimage", + "nolint", + "armkusto", + "msix", + "armiotsecurity", + "odata", + "mgmt", + "armkubernetesconfiguration", + "azruntime" + ], + "allowCompoundWords": true, + "overrides": [ + { + "filename": "{*.sum,*.mod}", + "words": [ + "davecgh", + "pmezard", + "gover", + "objx" + ] + } + ] +} diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index f2916275f0ad..85d9a5b2c42d 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -134,6 +134,8 @@ stages: name: azsdk-pool-mms-ubuntu-2004-general steps: + - template: /eng/common/pipelines/templates/steps/check-spelling.yml + - task: GoTool@0 inputs: version: '1.17' From c513fbb210c18b725892434a0d56fc94c0231dde Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Mon, 3 Jan 2022 17:39:27 -0500 Subject: [PATCH 10/36] Adding Smoketests to nightly runs (#16226) * Adding Smoketests to nightly runs * updating location, fixes to script * starting go script * finishing script * updating yml file * formatting * adding snippet for finding go code * adding funcitonality for copying examples * trimming out unused funcs * fixed regexp, thanks benbp * fixing smoke test program to create go.mod file correctly, update powershell for nightly * removing need for argument in go program, updating yml and powershell to reflect * scripts not common * smoketests, plural not singular * finally got the right directory * fixed script locally, running into permissions issue on ci * updating script to exit properly, logging an error instead of panicing * manually set go111module to on * removing references to go111module * issue with duplicated function names... * updating to only pull examples from the service directory if one is provided * runs samples now too! * adding 'go run .' step to ps1, triggering for tables * adding step to analyze.yml file * adding debugging for ci * updating to work in ci * updating to specify go module name, removing print statements * updating scripts to fmt for prettier printing, find all environment variables * working on loading environment variables from file * removing env vars from example_test.go for testing * adding the environment variable portion to the generated main.go file * forgot to remove change to nightly script * adding import to the main file * cleaning up code, adding comments * don't import os if no env vars * small changes for checking all packages * removing _test suffix on copied files * converting to use cobra for better support * formatting --- eng/config.json | 7 +- .../templates/jobs/archetype-go-release.yml | 2 +- eng/pipelines/templates/steps/analyze.yml | 8 + eng/scripts/Smoke_Tests_Nightly.ps1 | 44 + eng/scripts/Smoke_Tests_Release.ps1 | 11 + eng/tools/smoketests/cmd/models.go | 38 + eng/tools/smoketests/cmd/root.go | 495 ++++++++++++ eng/tools/smoketests/go.mod | 10 + eng/tools/smoketests/go.sum | 758 ++++++++++++++++++ eng/tools/smoketests/main.go | 7 + 10 files changed, 1378 insertions(+), 2 deletions(-) create mode 100644 eng/scripts/Smoke_Tests_Nightly.ps1 create mode 100644 eng/scripts/Smoke_Tests_Release.ps1 create mode 100644 eng/tools/smoketests/cmd/models.go create mode 100644 eng/tools/smoketests/cmd/root.go create mode 100644 eng/tools/smoketests/go.mod create mode 100644 eng/tools/smoketests/go.sum create mode 100644 eng/tools/smoketests/main.go diff --git a/eng/config.json b/eng/config.json index 58fac1a16a52..1d595eb661ca 100644 --- a/eng/config.json +++ b/eng/config.json @@ -26,7 +26,12 @@ }, { "Name": "data", - "CoverageGoal": 0.62 + "CoverageGoal": 0.62, + "EnvironmentVariables": { + "TABLES_STORAGE_ACCOUNT_NAME": "fakeaccount", + "TABLES_PRIMARY_STORAGE_ACCOUNT_KEY": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==", + "TABLES_SHARED_ACCESS_SIGNATURE": "?sig=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" + } }, { "Name": "eng/tools", diff --git a/eng/pipelines/templates/jobs/archetype-go-release.yml b/eng/pipelines/templates/jobs/archetype-go-release.yml index e322b9f1eac4..9bf7ea5d489f 100644 --- a/eng/pipelines/templates/jobs/archetype-go-release.yml +++ b/eng/pipelines/templates/jobs/archetype-go-release.yml @@ -30,7 +30,7 @@ stages: displayName: 'Release: ${{ parameters.ServiceDirectory }}' dependsOn: CheckRelease condition: and(succeeded(), eq(dependencies.CheckRelease.outputs['CheckReleaseJob.Verify.NeedToRelease'], 'true')) - jobs: + jobs: - deployment: TagRepository displayName: "Create release tag" condition: and(succeeded(), ne(variables['Skip.TagRepository'], 'true')) diff --git a/eng/pipelines/templates/steps/analyze.yml b/eng/pipelines/templates/steps/analyze.yml index bad34a7a53c8..5381e0dd0488 100644 --- a/eng/pipelines/templates/steps/analyze.yml +++ b/eng/pipelines/templates/steps/analyze.yml @@ -91,3 +91,11 @@ steps: parameters: PackageName: 'sdk/${{parameters.ServiceDirectory}}' ForRelease: false + + - task: PowerShell@2 + displayName: 'Run Nightly SmokeTests' + inputs: + targetType: 'filePath' + filePath: ./eng/scripts/Smoke_Tests_Nightly.ps1 + pwsh: true + arguments: '${{ parameters.ServiceDirectory }}' diff --git a/eng/scripts/Smoke_Tests_Nightly.ps1 b/eng/scripts/Smoke_Tests_Nightly.ps1 new file mode 100644 index 000000000000..9cb01491e3eb --- /dev/null +++ b/eng/scripts/Smoke_Tests_Nightly.ps1 @@ -0,0 +1,44 @@ +#Requires -Version 7.0 + +Param( + [string] $serviceDirectory +) + +$repoRoot = Resolve-Path "$PSScriptRoot/../../" + +Push-Location $repoRoot/eng/tools/smoketests + +# create a smoketests directory +$smoketestsDir = Join-Path $repoRoot sdk smoketests +Write-Host "Creating a new directory for smoketests at $smoketestsDir" +New-Item -Path $smoketestsDir -ItemType Directory + +Push-Location $smoketestsDir +Write-Host "Running 'go mod init' in $pwd" +go mod init github.com/Azure/azure-sdk-for-go/sdk/smoketests +Pop-Location + +# Run smoketests script +Write-Host "Running 'go run . -serviceDirectory $serviceDirectory'" +go run . -serviceDirectory $serviceDirectory +if ($LASTEXITCODE) { + exit $LASTEXITCODE +} + +Pop-Location + +# Run go mod tidy and go build. If these succeed the smoke tests pass +Push-Location $smoketestsDir +go fmt ./... +Write-Host "Printing content of go.mod file:" +Get-Content go.mod +Write-Host "Printing content of main.go file" +Get-Content main.go +go mod tidy +go build ./... +go run . + +Pop-Location + +# Clean-up the directory created +Remove-Item -Path $smoketestsDir -Recurse -Force diff --git a/eng/scripts/Smoke_Tests_Release.ps1 b/eng/scripts/Smoke_Tests_Release.ps1 new file mode 100644 index 000000000000..b83111f91617 --- /dev/null +++ b/eng/scripts/Smoke_Tests_Release.ps1 @@ -0,0 +1,11 @@ +#Requires -Version 7.0 + +Param( + [string] $serviceDirectory +) + +Write-Host $PSScriptRoot + +# 1. Every module uses a replace directive to the local version +# 2. Include every module (data & mgmt) in a go.mod file +# 3. Run `go mod tidy` and ensure it succeeds \ No newline at end of file diff --git a/eng/tools/smoketests/cmd/models.go b/eng/tools/smoketests/cmd/models.go new file mode 100644 index 000000000000..e26ca7f5cd2d --- /dev/null +++ b/eng/tools/smoketests/cmd/models.go @@ -0,0 +1,38 @@ +package cmd + +import "fmt" + +type ConfigFile struct { + Packages []Package +} + +type Package struct { + Name string + CoverageGoal float64 + EnvironmentVariables map[string]string +} + +type Module struct { + Name string + Version string + Replace string +} + +type SemVer struct { + Major, Minor, Patch int +} + +func (s SemVer) Newer(s2 SemVer) bool { + if s.Major > s2.Major { + return true + } else if s.Major == s2.Major && s.Minor > s2.Minor { + return true + } else if s.Major == s2.Major && s.Minor == s2.Minor && s.Patch > s2.Patch { + return true + } + return false +} + +func (s SemVer) String() string { + return fmt.Sprintf("v%d.%d.%d", s.Major, s.Minor, s.Patch) +} diff --git a/eng/tools/smoketests/cmd/root.go b/eng/tools/smoketests/cmd/root.go new file mode 100644 index 000000000000..0f71392c1aa7 --- /dev/null +++ b/eng/tools/smoketests/cmd/root.go @@ -0,0 +1,495 @@ +package cmd + +import ( + "bytes" + "encoding/json" + "fmt" + "io/fs" + "io/ioutil" + "math/rand" + "os" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "strconv" + "strings" + + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: "smoketests [Options]", + Short: "Run smoketests for azure SDK for go", + RunE: func(c *cobra.Command, args []string) error { + return smokeTestCmd() + }, +} + +func Execute() { + if err := rootCmd.Execute(); err != nil { + os.Exit(-1) + } +} + +var serviceDirectory string +var daily bool + +func init() { + rootCmd.PersistentFlags().StringVarP(&serviceDirectory, "serviceDirectory", "s", "", "serviceDirectory to test against") + rootCmd.PersistentFlags().BoolVarP(&daily, "daily", "d", false, "For running daily tests set to true") +} + +var smoketestModFile string +var smoketestDir string +var exampleFuncs []string +var envVars []string + +func handle(e error) { + if e != nil { + panic(e) + } +} + +func getVersion() string { + v := runtime.Version() + if strings.Contains(v, "go") { + v = strings.TrimLeft(v, "go") + + return fmt.Sprintf("go %s", v) + } + + // Default, go is not from a tag + return "go 1.17" +} + +func inIgnoredDirectories(path string) bool { + if strings.Contains(path, "internal") { + return true + } + if strings.Contains(path, "samples") { + return true + } + if strings.Contains(path, "smoketests") { + return true + } + if strings.Contains(path, "template") { + return true + } + + return false +} + +// Walks the sdk directory to find all modules based on a go.mod file +func findModuleDirectories(root string) []string { + var ret []string + + err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + handle(err) + if strings.Contains(info.Name(), "go.mod") && !inIgnoredDirectories(path) { + path = strings.ReplaceAll(path, "\\", "/") + path = strings.ReplaceAll(path, "/go.mod", "") + parts := strings.Split(path, "/sdk/") + formatted := fmt.Sprintf("github.com/Azure/azure-sdk-for-go/sdk/%s", parts[1]) + ret = append(ret, formatted) + } + return nil + }) + handle(err) + + return ret +} + +// Reads all tags using the 'git tag -l' command and returns them as a string slice +func getAllTags() []string { + result, err := exec.Command("git", "tag", "-l").Output() + handle(err) + res := bytes.NewBuffer(result).String() + return strings.Split(res, "\n") +} + +// Convert a string to an integer and handle errors +func toInt(a string) int { + r, err := strconv.Atoi(a) + handle(err) + return r +} + +// Create a new SemVer type +func NewSemVerFromTag(s string) SemVer { + path := strings.Split(s, "/") + versionStr := path[len(path)-1] + versionStr = strings.TrimLeft(versionStr, "v") + parts := strings.Split(versionStr, ".") + return SemVer{ + Major: toInt(parts[0]), + Minor: toInt(parts[1]), + Patch: toInt(parts[2]), + } +} + +// Find the most recent SemVer tag for a given package. +func findLatestTag(p string, tags []string) (string, error) { + var v SemVer + for i, tag := range tags { + if strings.Contains(tag, p) { + v = NewSemVerFromTag(tag) + for strings.Contains(tags[i+1], p) { + newV := NewSemVerFromTag(tags[i+1]) + if newV.Newer(v) { + v = newV + } + i += 1 + } + return v.String(), nil + } + } + return "", fmt.Errorf("could not find a version for module %s", p) +} + +// Creates a slice of modules matched with the most recent version +func matchModulesAndTags(goModFiles []string, tags []string) []Module { + var m []Module + + for _, goModFile := range goModFiles { + packagePath := strings.Split(goModFile, "github.com/Azure/azure-sdk-for-go/sdk/") + relativePackagePath := packagePath[1] + version, err := findLatestTag(relativePackagePath, tags) + if err != nil { + fmt.Println(err.Error()) + } else { + m = append(m, Module{ + Name: goModFile, + Replace: fmt.Sprintf("../%s", relativePackagePath), + Version: version, + }) + } + } + + return m +} + +// GetTopLevel runs "git rev-parse --show-toplevel" to get the an absolute path to the current repo +func GetTopLevel() string { + topLevel, err := exec.Command("git", "rev-parse", "--show-toplevel").CombinedOutput() + handle(err) + return strings.ReplaceAll(bytes.NewBuffer(topLevel).String(), "\n", "") +} + +// BuildModFile creates a go.mod file and adds replace directives for the appropriate modules. +// If serviceDirectory is a blank string it replaces all modules, otherwise it only replaces matching modules +func BuildModFile(modules []Module, serviceDirectory string) error { + f, err := os.OpenFile(smoketestModFile, os.O_RDWR, 0666) + handle(err) + defer f.Close() + + _, err = f.WriteString(fmt.Sprintf("module github.com/Azure/azure-sdk-for-go/sdk/smoketests\n\n%s\n\n", getVersion())) + if err != nil { + return err + } + + replaceString := "replace %s => %s\n" + if serviceDirectory == "notset" { + for _, module := range modules { + s := fmt.Sprintf(replaceString, module.Name, module.Replace) + _, err = f.Write([]byte(s)) + handle(err) + } + } else { + fmt.Printf("Replace directive for %s\n", serviceDirectory) + for _, module := range modules { + if strings.Contains(module.Name, serviceDirectory) { + s := fmt.Sprintf(replaceString, module.Name, module.Replace) + _, err = f.Write([]byte(s)) + handle(err) + } + } + } + + _, err = f.WriteString("\n\nrequire (\n") + + if err != nil { + return err + } + + requireString := "\t%s %s\n" + for _, module := range modules { + s := fmt.Sprintf(requireString, module.Name, module.Version) + _, err = f.Write([]byte(s)) + handle(err) + } + + _, err = f.WriteString(")") + handle(err) + return nil +} + +// FindExampleFiles finds all files that are named "example_*.go". +// If serviceDirectory +func FindExampleFiles(root, serviceDirectory string) ([]string, error) { + var ret []string + + err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + handle(err) + if strings.HasPrefix(info.Name(), "example_") && !inIgnoredDirectories(path) && strings.HasSuffix(info.Name(), ".go") { + path = strings.ReplaceAll(path, "\\", "/") + if serviceDirectory == "" || strings.Contains(path, serviceDirectory) { + ret = append(ret, path) + } + + } + return nil + }) + + return ret, err +} + +// copyFile copies the contents from src to dest. Creating the dest file first +func copyFile(src, dest string) error { + f, err := os.Create(dest) + if err != nil { + return err + } + err = f.Close() + if err != nil { + return err + } + + data, err := ioutil.ReadFile(src) + if err != nil { + return err + } + + stringData := bytes.NewBuffer(data).String() + + functionRegex := regexp.MustCompile(`(?m)^func\sExampleNew(.*)\(\)\s{`) + functions := functionRegex.FindAllString(stringData, -1) + for i, l := range functions { + l = strings.ReplaceAll(l, "()", "") + parts := strings.Split(l, " ") + functions[i] = parts[1] + } + + // do a name change for clashing + var newNames []string + for _, f := range functions { + newNames = append(newNames, fmt.Sprintf("%s%d", f, rand.Intn(100000))) + } + + for i := 0; i < len(functions); i++ { + stringData = strings.Replace(stringData, functions[i], newNames[i], 1) + exampleFuncs = append(exampleFuncs, newNames[i]) + } + + err = ioutil.WriteFile(dest, []byte(stringData), 0644) + return err +} + +// CopyExampleFiles copies all the example files to the destination directory. +// This creates a hash of the fileName for the destination path +func CopyExampleFiles(exFiles []string, dest string) { + fmt.Printf("Copying %d example files to %s\n", len(exFiles), dest) + + for _, exFile := range exFiles { + newFileName := strings.ReplaceAll(exFile[10:], "/", "_") + newFileName = strings.ReplaceAll(newFileName, " ", "") + newFileName = strings.ReplaceAll(newFileName, "_test", "") + destinationPath := filepath.Join(dest, newFileName) + + err := copyFile(exFile, destinationPath) + handle(err) + } +} + +// ReplacePackageStatement replaces all "package ***" with a common "package main" statement +func ReplacePackageStatement(root string) error { + packageName := "package main" + return filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + if strings.HasSuffix(info.Name(), ".go") { + handle(err) + data, err := ioutil.ReadFile(path) + handle(err) + + datastring := bytes.NewBuffer(data).String() + + m := regexp.MustCompile("(?m)^package (.*)$") + datastring = m.ReplaceAllString(datastring, packageName) + + err = ioutil.WriteFile(path, []byte(datastring), 0666) + if err != nil { + return err + } + } + return nil + }) +} + +// Create the main.go file with environment variables, example functions, and imports. +func BuildMainFile(root string, c ConfigFile) error { + mainFile := filepath.Join(root, "main.go") + f, err := os.Create(mainFile) + if err != nil { + panic(err) + } + err = f.Close() + if err != nil { + panic(err) + } + + // Write the main.go file + + src := "package main\nimport \"os\"\nfunc main() {" + if len(envVars) == 0 { + src = "package main\nfunc main() {\n" + } + + for _, envVar := range envVars { + src += fmt.Sprintf(`os.Setenv("%s", "%s")`, envVar, FindEnvVarFromConfig(c, envVar)) + src += "\n" + } + + src += "\n" + + for _, exampleFunc := range exampleFuncs { + src += fmt.Sprintf("%s()\n", exampleFunc) + } + + src += "}" + + err = ioutil.WriteFile(mainFile, []byte(src), 0666) + return err +} + +// Find all the environment variables looked up within a .go file +func FindEnvVars(root string) error { + fmt.Println("Find all environment variables using `os.Getenv` or `os.LookupEnv`") + + err := filepath.Walk(root, func(path string, info fs.FileInfo, err error) error { + if strings.HasSuffix(path, ".go") { + // Find Env Vars + searchFile(path) + } + return nil + }) + return err +} + +// Search for both os.Getenv and os.LookupEnv in go file +func searchFile(path string) error { + envVarRegex := regexp.MustCompile(`(?m)os.LookupEnv\("(.*)"\)`) + data, err := ioutil.ReadFile(path) + if err != nil { + return err + } + stringData := bytes.NewBuffer(data).String() + LookupEnvs := envVarRegex.FindAllString(stringData, -1) + envVars = append(envVars, trimLookupEnvs(LookupEnvs)...) + + envVarRegex = regexp.MustCompile(`(?m)os.Getenv(.*)\r\n`) + Getenvs := envVarRegex.FindAllString(stringData, -1) + envVars = append(envVars, trimGetenvs(Getenvs)...) + return nil +} + +// Search for a default value in the eng/config.json file +func FindEnvVarFromConfig(c ConfigFile, envVar string) string { + for _, p := range c.Packages { + for key, value := range p.EnvironmentVariables { + if key == envVar { + return value + } + } + } + + return "" +} + +func trimLookupEnvs(values []string) []string { + pseudoSet := make(map[string]struct{}) + + for _, value := range values { + value = strings.TrimSpace(value) + value = strings.TrimPrefix(value, `os.LookupEnv("`) + value = strings.TrimSuffix(value, `")`) + pseudoSet[value] = struct{}{} + } + + var ret []string + for v := range pseudoSet { + ret = append(ret, v) + } + + return ret +} + +func trimGetenvs(values []string) []string { + var ret []string + + for _, value := range values { + value = strings.TrimPrefix(value, `os.Getenv("`) + value = strings.TrimSuffix(value, `")`) + ret = append(ret, value) + } + + return ret +} + +// Read the eng/config.json file to parse environment variables +func LoadEngConfig(rootDirectory string) ConfigFile { + fileName := filepath.Join(rootDirectory, "eng", "config.json") + buffer, err := ioutil.ReadFile(fileName) + if err != nil { + panic(err) + } + var p ConfigFile + err = json.Unmarshal(buffer, &p) + handle(err) + return p +} + +func smokeTestCmd() error { + + if serviceDirectory == "" && !daily { + fmt.Println("Arguments could not be understood. Either specify a serviceDirectory or set --daily to true") + os.Exit(-1) + } else if serviceDirectory != "" && !daily { + fmt.Printf("Running smoke tests on the %s directory\n", serviceDirectory) + } + + rootDirectory := GetTopLevel() + + configFile := LoadEngConfig(rootDirectory) + + absSDKPath, err := filepath.Abs(fmt.Sprintf("%s/sdk", rootDirectory)) + handle(err) + fmt.Println("Root SDK directory: ", absSDKPath) + + smoketestDir = filepath.Join(absSDKPath, "smoketests") + fmt.Println("Smoke test directory: ", smoketestDir) + + smoketestModFile = filepath.Join(smoketestDir, "go.mod") + + exampleFiles, err := FindExampleFiles(absSDKPath, serviceDirectory) + handle(err) + fmt.Printf("Found %d example files for smoke tests\n", len(exampleFiles)) + for _, e := range exampleFiles { + fmt.Printf("\t%s\n", e) + } + + moduleDirectories := findModuleDirectories(absSDKPath) + allTags := getAllTags() + modules := matchModulesAndTags(moduleDirectories, allTags) + + CopyExampleFiles(exampleFiles, smoketestDir) + + err = BuildModFile(modules, serviceDirectory) + handle(err) + + err = ReplacePackageStatement(smoketestDir) + handle(err) + + err = FindEnvVars(smoketestDir) + handle(err) + + return BuildMainFile(smoketestDir, configFile) +} diff --git a/eng/tools/smoketests/go.mod b/eng/tools/smoketests/go.mod new file mode 100644 index 000000000000..105bb136fcc1 --- /dev/null +++ b/eng/tools/smoketests/go.mod @@ -0,0 +1,10 @@ +module github.com/Azure/azure-sdk-for-go/eng/tools/smoketests + +go 1.17 + +require github.com/spf13/cobra v1.3.0 + +require ( + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect +) diff --git a/eng/tools/smoketests/go.sum b/eng/tools/smoketests/go.sum new file mode 100644 index 000000000000..73a92e482272 --- /dev/null +++ b/eng/tools/smoketests/go.sum @@ -0,0 +1,758 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= +github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/eng/tools/smoketests/main.go b/eng/tools/smoketests/main.go new file mode 100644 index 000000000000..38d810a132aa --- /dev/null +++ b/eng/tools/smoketests/main.go @@ -0,0 +1,7 @@ +package main + +import "github.com/Azure/azure-sdk-for-go/eng/tools/smoketests/cmd" + +func main() { + cmd.Execute() +} From 575e9bee5cbee95c7e062bffd2a6e762ee0df746 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Mon, 3 Jan 2022 16:00:42 -0800 Subject: [PATCH 11/36] Sync eng/common directory with azure-sdk-tools for PR 2464 (#16730) * Support AAD graph and Microsoft Graph service principal APIs * Consolidate service principal wrapper creation Co-authored-by: Ben Broderick Phillips --- .../TestResources/New-TestResources.ps1 | 54 +++++++++++++++---- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/eng/common/TestResources/New-TestResources.ps1 b/eng/common/TestResources/New-TestResources.ps1 index 914f68d9a98d..368f3717b8e8 100644 --- a/eng/common/TestResources/New-TestResources.ps1 +++ b/eng/common/TestResources/New-TestResources.ps1 @@ -127,6 +127,42 @@ function Retry([scriptblock] $Action, [int] $Attempts = 5) } } +# NewServicePrincipalWrapper creates an object from an AAD graph or Microsoft Graph service principal object type. +# This is necessary to work around breaking changes introduced in Az version 7.0.0: +# https://azure.microsoft.com/en-us/updates/update-your-apps-to-use-microsoft-graph-before-30-june-2022/ +function NewServicePrincipalWrapper([string]$subscription, [string]$resourceGroup, [string]$displayName) +{ + $servicePrincipal = Retry { + New-AzADServicePrincipal -Role "Owner" -Scope "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName" -DisplayName $displayName + } + $spPassword = "" + $appId = "" + if (Get-Member -Name "Secret" -InputObject $servicePrincipal -MemberType property) { + Write-Verbose "Using legacy PSADServicePrincipal object type from AAD graph API" + # Secret property exists on PSADServicePrincipal type from AAD graph in Az # module versions < 7.0.0 + $spPassword = $servicePrincipal.Secret + $appId = $servicePrincipal.ApplicationId + } else { + Write-Verbose "Creating password for service principal via MS Graph API" + # Microsoft graph objects (Az version >= 7.0.0) do not provision a secret # on creation so it must be added separately. + # Submitting a password credential object without specifying a password will result in one being generated on the server side. + $password = New-Object -TypeName "Microsoft.Azure.PowerShell.Cmdlets.Resources.MSGraph.Models.ApiV10.MicrosoftGraphPasswordCredential" + $password.DisplayName = "Password for $displayName" + $credential = Retry { New-AzADSpCredential -PasswordCredentials $password -ServicePrincipalObject $servicePrincipal } + $spPassword = ConvertTo-SecureString $credential.SecretText -AsPlainText -Force + $appId = $servicePrincipal.AppId + } + + return @{ + AppId = $appId + ApplicationId = $appId + # This is the ObjectId/OID but most return objects use .Id so keep it consistent to prevent confusion + Id = $servicePrincipal.Id + DisplayName = $servicePrincipal.DisplayName + Secret = $spPassword + } +} + function LoadCloudConfig([string] $env) { $configPath = "$PSScriptRoot/clouds/$env.json" @@ -522,8 +558,8 @@ try { # If no test application ID was specified during an interactive session, create a new service principal. if (!$CI -and !$TestApplicationId) { # Cache the created service principal in this session for frequent reuse. - $servicePrincipal = if ($AzureTestPrincipal -and (Get-AzADServicePrincipal -ApplicationId $AzureTestPrincipal.ApplicationId) -and $AzureTestSubscription -eq $SubscriptionId) { - Log "TestApplicationId was not specified; loading cached service principal '$($AzureTestPrincipal.ApplicationId)'" + $servicePrincipal = if ($AzureTestPrincipal -and (Get-AzADServicePrincipal -ApplicationId $AzureTestPrincipal.AppId) -and $AzureTestSubscription -eq $SubscriptionId) { + Log "TestApplicationId was not specified; loading cached service principal '$($AzureTestPrincipal.AppId)'" $AzureTestPrincipal } else { Log "TestApplicationId was not specified; creating a new service principal in subscription '$SubscriptionId'" @@ -537,19 +573,17 @@ try { $displayName = "$($baseName)$suffix.test-resources.azure.sdk" } - $servicePrincipal = Retry { - New-AzADServicePrincipal -Role "Owner" -Scope "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName" -DisplayName $displayName - } + $servicePrincipalWrapper = NewServicePrincipalWrapper -subscription $SubscriptionId -resourceGroup $ResourceGroupName -displayName $DisplayName - $global:AzureTestPrincipal = $servicePrincipal + $global:AzureTestPrincipal = $servicePrincipalWrapper $global:AzureTestSubscription = $SubscriptionId - Log "Created service principal '$($AzureTestPrincipal.ApplicationId)'" - $AzureTestPrincipal + Log "Created service principal. AppId: '$($AzureTestPrincipal.AppId)' ObjectId: '$($AzureTestPrincipal.Id)'" + $servicePrincipalWrapper $resourceGroupRoleAssigned = $true } - $TestApplicationId = $servicePrincipal.ApplicationId + $TestApplicationId = $servicePrincipal.AppId $TestApplicationOid = $servicePrincipal.Id $TestApplicationSecret = (ConvertFrom-SecureString $servicePrincipal.Secret -AsPlainText) } @@ -886,7 +920,7 @@ Bicep templates, test-resources.bicep.env. .PARAMETER SuppressVsoCommands By default, the -CI parameter will print out secrets to logs with Azure Pipelines log -commands that cause them to be redacted. For CI environments that don't support this (like +commands that cause them to be redacted. For CI environments that don't support this (like stress test clusters), this flag can be set to $false to avoid printing out these secrets to the logs. .EXAMPLE From a375c84de732b4d84714292cfb2b44b0bf688d9a Mon Sep 17 00:00:00 2001 From: Charles Lowell <10964656+chlowell@users.noreply.github.com> Date: Tue, 4 Jan 2022 14:06:32 -0800 Subject: [PATCH 12/36] Make EndpointToScope resilient to subdomains (#16737) --- sdk/azcore/internal/shared/shared.go | 18 ++++++++++++++++ sdk/azcore/internal/shared/shared_test.go | 26 +++++++++++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/sdk/azcore/internal/shared/shared.go b/sdk/azcore/internal/shared/shared.go index 5e008b18e588..1e44f27c28ff 100644 --- a/sdk/azcore/internal/shared/shared.go +++ b/sdk/azcore/internal/shared/shared.go @@ -14,7 +14,9 @@ import ( "io" "io/ioutil" "net/http" + "net/url" "strconv" + "strings" "time" ) @@ -179,9 +181,25 @@ func (r *NopClosingBytesReader) Seek(offset int64, whence int) (int64, error) { } const defaultScope = "/.default" +const chinaCloudARMScope = "https://management.core.chinacloudapi.cn/" + defaultScope +const publicCloudARMScope = "https://management.core.windows.net/" + defaultScope +const usGovCloudARMScope = "https://management.core.usgovcloudapi.net/" + defaultScope // EndpointToScope converts the provided URL endpoint to its default scope. func EndpointToScope(endpoint string) string { + parsed, err := url.Parse(endpoint) + if err == nil { + host := parsed.Hostname() + switch { + case strings.HasSuffix(host, "management.azure.com"): + return publicCloudARMScope + case strings.HasSuffix(host, "management.usgovcloudapi.net"): + return usGovCloudARMScope + case strings.HasSuffix(host, "management.chinacloudapi.cn"): + return chinaCloudARMScope + } + } + // fall back to legacy behavior when endpoint doesn't parse or match a known cloud's ARM endpoint if endpoint[len(endpoint)-1] != '/' { endpoint += "/" } diff --git a/sdk/azcore/internal/shared/shared_test.go b/sdk/azcore/internal/shared/shared_test.go index b40818b34d17..e8422eac29c2 100644 --- a/sdk/azcore/internal/shared/shared_test.go +++ b/sdk/azcore/internal/shared/shared_test.go @@ -98,8 +98,30 @@ func TestHasStatusCode(t *testing.T) { } func TestEndpointToScope(t *testing.T) { - if s := EndpointToScope("https://management.usgovcloudapi.net"); s != "https://management.usgovcloudapi.net//.default" { - t.Fatalf("unexpected scope %s", s) + knownClouds := map[string][]string{ + chinaCloudARMScope: {"https://foo.management.chinacloudapi.cn", "https://management.chinacloudapi.cn"}, + publicCloudARMScope: {"https://centraluseuap.management.azure.com", "https://management.azure.com"}, + usGovCloudARMScope: {"https://foo.management.usgovcloudapi.net", "https://management.usgovcloudapi.net"}, + } + for expected, endpoints := range knownClouds { + for _, endpoint := range endpoints { + if actual := EndpointToScope(endpoint); actual != expected { + t.Fatalf(`unexpected scope "%s" for endpoint "%s"`, actual, endpoint) + } + if actual := EndpointToScope(endpoint + "/"); actual != expected { + t.Fatalf(`unexpected scope "%s" for endpoint "%s"/`, actual, endpoint) + } + } + } + + // legacy behavior for unknown clouds: add "//.default" suffix to endpoint + for _, endpoint := range []string{"localhost", "http://foo.bar"} { + if actual := EndpointToScope(endpoint); actual != endpoint+"//.default" { + t.Fatalf(`unexpected scope "%s" for endpoint "%s"`, actual, endpoint) + } + if actual := EndpointToScope(endpoint + "/"); actual != endpoint+"//.default" { + t.Fatalf(`unexpected scope "%s" for endpoint "%s"/`, actual, endpoint) + } } } From 4c52aafa7e9862e4d4981fde7a15b4eeab869bc2 Mon Sep 17 00:00:00 2001 From: Charles Lowell <10964656+chlowell@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:37:26 -0800 Subject: [PATCH 13/36] Add user assigned managed identity example to docs (#16738) --- sdk/azidentity/example_shared_test.go | 27 +++++++++++++++++++++++++ sdk/azidentity/example_test.go | 29 +++++++++++++-------------- sdk/azidentity/go.mod | 3 +++ sdk/azidentity/go.sum | 9 ++++++--- 4 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 sdk/azidentity/example_shared_test.go diff --git a/sdk/azidentity/example_shared_test.go b/sdk/azidentity/example_shared_test.go new file mode 100644 index 000000000000..413eda01f753 --- /dev/null +++ b/sdk/azidentity/example_shared_test.go @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package azidentity_test + +import ( + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" +) + +// Helpers and variables to keep the examples tidy + +const ( + certPath = "testdata/certificate.pem" + clientID = "fake-client-id" + tenantID = "fake-tenant" +) + +func handleError(err error) { + if err != nil { + log.Panicf("example failed: %v", err) + } +} + +var cred azcore.TokenCredential +var err error diff --git a/sdk/azidentity/example_test.go b/sdk/azidentity/example_test.go index 4f398be928f8..66da3b84314c 100644 --- a/sdk/azidentity/example_test.go +++ b/sdk/azidentity/example_test.go @@ -4,26 +4,11 @@ package azidentity_test import ( - "log" "os" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" ) -const ( - certPath = "testdata/certificate.pem" - clientID = "fake-client-id" - tenantID = "fake-tenant" -) - -var cred *azidentity.ClientCertificateCredential - -func handleError(err error) { - if err != nil { - log.Panicf("example failed: %v", err) - } -} - func ExampleNewClientCertificateCredential() { data, err := os.ReadFile(certPath) handleError(err) @@ -39,3 +24,17 @@ func ExampleNewClientCertificateCredential() { // Output: } + +func ExampleNewManagedIdentityCredential_userAssigned() { + // select a user assigned identity with its client ID... + clientID := azidentity.ClientID("abcd1234-...") + opts := azidentity.ManagedIdentityCredentialOptions{ID: clientID} + cred, err = azidentity.NewManagedIdentityCredential(&opts) + handleError(err) + + // ...or its resource ID + resourceID := azidentity.ResourceID("/subscriptions/...") + opts = azidentity.ManagedIdentityCredentialOptions{ID: resourceID} + cred, err = azidentity.NewManagedIdentityCredential(&opts) + handleError(err) +} diff --git a/sdk/azidentity/go.mod b/sdk/azidentity/go.mod index c2c8385cfb4e..b1a21a0f0f05 100644 --- a/sdk/azidentity/go.mod +++ b/sdk/azidentity/go.mod @@ -10,5 +10,8 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/azidentity/go.sum b/sdk/azidentity/go.sum index c2eba5938b04..ace9e01be592 100644 --- a/sdk/azidentity/go.sum +++ b/sdk/azidentity/go.sum @@ -29,20 +29,23 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From ac331057c5bbfd6d0134a25ea13400332ba3e6b0 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:03:31 -0500 Subject: [PATCH 14/36] [KeyVault] fixing broken live test (#16752) * fixing broken live test * coverage * forcing ci --- eng/config.json | 4 ++-- sdk/keyvault/azkeys/client_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/config.json b/eng/config.json index 1d595eb661ca..8842697d3dc5 100644 --- a/eng/config.json +++ b/eng/config.json @@ -17,8 +17,8 @@ "CoverageGoal": 0.68 }, { - "Name": "azkeys", - "CoverageGoal": 0.84 + "Name": "keyvault/azkeys", + "CoverageGoal": 0.82 }, { "Name": "azsecrets", diff --git a/sdk/keyvault/azkeys/client_test.go b/sdk/keyvault/azkeys/client_test.go index 9ed0275ee9fa..aec011af9979 100644 --- a/sdk/keyvault/azkeys/client_test.go +++ b/sdk/keyvault/azkeys/client_test.go @@ -643,7 +643,7 @@ func TestReleaseKey(t *testing.T) { t.Skip("Skipping test in playback") } _, err = http.DefaultClient.Do(req) - require.NoError(t, err) + require.Error(t, err) // This URL doesn't exist so this should fail, will pass after 7.4-preview release // require.Equal(t, resp.StatusCode, http.StatusOK) // defer resp.Body.Close() From 9bfda37fae62d450c5a611384a9f1414a64717d8 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 5 Jan 2022 15:59:26 -0800 Subject: [PATCH 15/36] Sync eng/common directory with azure-sdk-tools for PR 2484 (#16753) * Add weekly pipeline generation to prepare-pipelines template * Add succeeded condition to pipeline generation pipelines Co-authored-by: Ben Broderick Phillips --- .../templates/steps/prepare-pipelines.yml | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/eng/common/pipelines/templates/steps/prepare-pipelines.yml b/eng/common/pipelines/templates/steps/prepare-pipelines.yml index 47fc611316d1..d85c48caf3a8 100644 --- a/eng/common/pipelines/templates/steps/prepare-pipelines.yml +++ b/eng/common/pipelines/templates/steps/prepare-pipelines.yml @@ -71,7 +71,26 @@ steps: --debug ${{parameters.TestsConventionOptions}} displayName: Create Live Test pipelines for public repository - condition: ne('${{parameters.TestsConventionOptions}}','') + condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}','')) + env: + PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat) + - script: > + $(Pipeline.Workspace)/pipeline-generator/pipeline-generator + --organization https://dev.azure.com/azure-sdk + --project internal + --prefix ${{parameters.Prefix}} + --devopspath "\${{parameters.Prefix}}" + --path $(System.DefaultWorkingDirectory)/sdk + --endpoint Azure + --repository ${{parameters.Repository}} + --convention weekly + --agentpool Hosted + --branch refs/heads/$(DefaultBranch) + --patvar PATVAR + --debug + ${{parameters.TestsConventionOptions}} + displayName: Create Weekly (Multi-Cloud) Live Test pipelines for public repository + condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}','')) env: PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat) @@ -132,6 +151,6 @@ steps: --no-schedule ${{parameters.TestsConventionOptions}} displayName: Create Live Test pipelines for private repository - condition: ne('${{parameters.TestsConventionOptions}}','') + condition: and(succeeded(), ne('${{parameters.TestsConventionOptions}}','')) env: PATVAR: $(azuresdk-azure-sdk-devops-pipeline-generation-pat) From 0b36b2e9ebb4773e2b5dae08a9c96b00b66dee9b Mon Sep 17 00:00:00 2001 From: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:42:44 +0800 Subject: [PATCH 16/36] Release v61.1.0 1641448664 (#16762) * Generated from specification/automation/resource-manager/readme.md tag package-2020-01-13-preview (commit hash: 3b9b0a930e29cbead33df69ae46c7080408e4c0f) * Generated from specification/compute/resource-manager/readme.md tag package-2021-08-01 (commit hash: 3b9b0a930e29cbead33df69ae46c7080408e4c0f) * v61.1.0 --- CHANGELOG.md | 9 +- .../compute/mgmt/compute/computeapi/models.go | 2 +- .../latest/compute/mgmt/compute/models.go | 27 +- .../compute/mgmt/compute/computeapi/models.go | 2 +- .../preview/compute/mgmt/compute/models.go | 27 +- .../mgmt/automation/automationapi/models.go | 4 +- .../automation/mgmt/automation/models.go | 269 +- .../mgmt/2021-08-01/compute/CHANGELOG.md | 2 + .../mgmt/2021-08-01/compute/_meta.json | 11 + .../2021-08-01/compute/availabilitysets.go | 652 + .../compute/capacityreservationgroups.go | 596 + .../compute/capacityreservations.go | 493 + .../compute/mgmt/2021-08-01/compute/client.go | 41 + .../compute/cloudserviceoperatingsystems.go | 422 + .../compute/cloudserviceroleinstances.go | 699 + .../2021-08-01/compute/cloudserviceroles.go | 224 + .../mgmt/2021-08-01/compute/cloudservices.go | 1198 + .../compute/cloudservicesupdatedomain.go | 319 + .../2021-08-01/compute/communitygalleries.go | 108 + .../compute/communitygalleryimages.go | 110 + .../compute/communitygalleryimageversions.go | 114 + .../compute/computeapi/interfaces.go | 640 + .../2021-08-01/compute/dedicatedhostgroups.go | 589 + .../mgmt/2021-08-01/compute/dedicatedhosts.go | 492 + .../mgmt/2021-08-01/compute/diskaccesses.go | 1045 + .../2021-08-01/compute/diskencryptionsets.go | 719 + .../2021-08-01/compute/diskrestorepoint.go | 407 + .../compute/mgmt/2021-08-01/compute/disks.go | 779 + .../compute/mgmt/2021-08-01/compute/enums.go | 2061 ++ .../mgmt/2021-08-01/compute/galleries.go | 584 + .../2021-08-01/compute/galleryapplications.go | 485 + .../compute/galleryapplicationversions.go | 516 + .../mgmt/2021-08-01/compute/galleryimages.go | 492 + .../compute/galleryimageversions.go | 503 + .../compute/gallerysharingprofile.go | 114 + .../compute/mgmt/2021-08-01/compute/images.go | 583 + .../mgmt/2021-08-01/compute/loganalytics.go | 206 + .../compute/mgmt/2021-08-01/compute/models.go | 23435 ++++++++++++++++ .../mgmt/2021-08-01/compute/operations.go | 98 + .../compute/proximityplacementgroups.go | 575 + .../mgmt/2021-08-01/compute/resourceskus.go | 153 + .../compute/restorepointcollections.go | 582 + .../mgmt/2021-08-01/compute/restorepoints.go | 297 + .../2021-08-01/compute/sharedgalleries.go | 227 + .../2021-08-01/compute/sharedgalleryimages.go | 233 + .../compute/sharedgalleryimageversions.go | 240 + .../mgmt/2021-08-01/compute/snapshots.go | 778 + .../mgmt/2021-08-01/compute/sshpublickeys.go | 649 + .../compute/mgmt/2021-08-01/compute/usage.go | 155 + .../mgmt/2021-08-01/compute/version.go | 19 + .../compute/virtualmachineextensionimages.go | 270 + .../compute/virtualmachineextensions.go | 442 + .../compute/virtualmachineimages.go | 432 + .../compute/virtualmachineimagesedgezone.go | 445 + .../compute/virtualmachineruncommands.go | 689 + .../2021-08-01/compute/virtualmachines.go | 2193 ++ .../virtualmachinescalesetextensions.go | 483 + .../virtualmachinescalesetrollingupgrades.go | 346 + .../compute/virtualmachinescalesets.go | 2154 ++ .../virtualmachinescalesetvmextensions.go | 457 + .../virtualmachinescalesetvmruncommands.go | 495 + .../compute/virtualmachinescalesetvms.go | 1430 + .../2021-08-01/compute/virtualmachinesizes.go | 113 + .../automation/CHANGELOG.md | 2 + .../2020-01-13-preview/automation/_meta.json | 11 + .../2020-01-13-preview/automation/account.go | 610 + .../2020-01-13-preview/automation/activity.go | 248 + .../agentregistrationinformation.go | 204 + .../automation/automationapi/interfaces.go | 452 + .../automation/certificate.go | 511 + .../2020-01-13-preview/automation/client.go | 41 + .../automation/connection.go | 511 + .../automation/connectiontype.go | 422 + .../automation/credential.go | 513 + .../automation/dsccompilationjob.go | 433 + .../automation/dsccompilationjobstream.go | 120 + .../automation/dscconfiguration.go | 622 + .../2020-01-13-preview/automation/dscnode.go | 434 + .../automation/dscnodeconfiguration.go | 448 + .../2020-01-13-preview/automation/enums.go | 680 + .../2020-01-13-preview/automation/fields.go | 120 + .../automation/hybridrunbookworkergroup.go | 423 + .../mgmt/2020-01-13-preview/automation/job.go | 806 + .../automation/jobschedule.go | 428 + .../automation/jobstream.go | 262 + .../2020-01-13-preview/automation/keys.go | 116 + .../automation/linkedworkspace.go | 116 + .../2020-01-13-preview/automation/models.go | 11239 ++++++++ .../2020-01-13-preview/automation/module.go | 516 + .../automation/nodecountinformation.go | 119 + .../automation/nodereports.go | 340 + .../automation/objectdatatypes.go | 206 + .../automation/operations.go | 98 + .../automation/privateendpointconnections.go | 382 + .../automation/privatelinkresources.go | 117 + .../automation/python2package.go | 516 + .../2020-01-13-preview/automation/runbook.go | 698 + .../automation/runbookdraft.go | 382 + .../2020-01-13-preview/automation/schedule.go | 511 + .../softwareupdateconfigurationmachineruns.go | 228 + .../softwareupdateconfigurationruns.go | 227 + .../softwareupdateconfigurations.go | 409 + .../automation/sourcecontrol.go | 528 + .../automation/sourcecontrolsyncjob.go | 350 + .../automation/sourcecontrolsyncjobstreams.go | 258 + .../automation/statistics.go | 120 + .../2020-01-13-preview/automation/testjob.go | 462 + .../automation/testjobstreams.go | 252 + .../2020-01-13-preview/automation/usages.go | 116 + .../2020-01-13-preview/automation/variable.go | 510 + .../2020-01-13-preview/automation/version.go | 19 + .../2020-01-13-preview/automation/watcher.go | 681 + .../2020-01-13-preview/automation/webhook.go | 598 + version/version.go | 2 +- 114 files changed, 81215 insertions(+), 136 deletions(-) create mode 100644 services/compute/mgmt/2021-08-01/compute/CHANGELOG.md create mode 100644 services/compute/mgmt/2021-08-01/compute/_meta.json create mode 100644 services/compute/mgmt/2021-08-01/compute/availabilitysets.go create mode 100644 services/compute/mgmt/2021-08-01/compute/capacityreservationgroups.go create mode 100644 services/compute/mgmt/2021-08-01/compute/capacityreservations.go create mode 100644 services/compute/mgmt/2021-08-01/compute/client.go create mode 100644 services/compute/mgmt/2021-08-01/compute/cloudserviceoperatingsystems.go create mode 100644 services/compute/mgmt/2021-08-01/compute/cloudserviceroleinstances.go create mode 100644 services/compute/mgmt/2021-08-01/compute/cloudserviceroles.go create mode 100644 services/compute/mgmt/2021-08-01/compute/cloudservices.go create mode 100644 services/compute/mgmt/2021-08-01/compute/cloudservicesupdatedomain.go create mode 100644 services/compute/mgmt/2021-08-01/compute/communitygalleries.go create mode 100644 services/compute/mgmt/2021-08-01/compute/communitygalleryimages.go create mode 100644 services/compute/mgmt/2021-08-01/compute/communitygalleryimageversions.go create mode 100644 services/compute/mgmt/2021-08-01/compute/computeapi/interfaces.go create mode 100644 services/compute/mgmt/2021-08-01/compute/dedicatedhostgroups.go create mode 100644 services/compute/mgmt/2021-08-01/compute/dedicatedhosts.go create mode 100644 services/compute/mgmt/2021-08-01/compute/diskaccesses.go create mode 100644 services/compute/mgmt/2021-08-01/compute/diskencryptionsets.go create mode 100644 services/compute/mgmt/2021-08-01/compute/diskrestorepoint.go create mode 100644 services/compute/mgmt/2021-08-01/compute/disks.go create mode 100644 services/compute/mgmt/2021-08-01/compute/enums.go create mode 100644 services/compute/mgmt/2021-08-01/compute/galleries.go create mode 100644 services/compute/mgmt/2021-08-01/compute/galleryapplications.go create mode 100644 services/compute/mgmt/2021-08-01/compute/galleryapplicationversions.go create mode 100644 services/compute/mgmt/2021-08-01/compute/galleryimages.go create mode 100644 services/compute/mgmt/2021-08-01/compute/galleryimageversions.go create mode 100644 services/compute/mgmt/2021-08-01/compute/gallerysharingprofile.go create mode 100644 services/compute/mgmt/2021-08-01/compute/images.go create mode 100644 services/compute/mgmt/2021-08-01/compute/loganalytics.go create mode 100644 services/compute/mgmt/2021-08-01/compute/models.go create mode 100644 services/compute/mgmt/2021-08-01/compute/operations.go create mode 100644 services/compute/mgmt/2021-08-01/compute/proximityplacementgroups.go create mode 100644 services/compute/mgmt/2021-08-01/compute/resourceskus.go create mode 100644 services/compute/mgmt/2021-08-01/compute/restorepointcollections.go create mode 100644 services/compute/mgmt/2021-08-01/compute/restorepoints.go create mode 100644 services/compute/mgmt/2021-08-01/compute/sharedgalleries.go create mode 100644 services/compute/mgmt/2021-08-01/compute/sharedgalleryimages.go create mode 100644 services/compute/mgmt/2021-08-01/compute/sharedgalleryimageversions.go create mode 100644 services/compute/mgmt/2021-08-01/compute/snapshots.go create mode 100644 services/compute/mgmt/2021-08-01/compute/sshpublickeys.go create mode 100644 services/compute/mgmt/2021-08-01/compute/usage.go create mode 100644 services/compute/mgmt/2021-08-01/compute/version.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachineextensionimages.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachineextensions.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachineimages.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachineimagesedgezone.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachineruncommands.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachines.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetextensions.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetrollingupgrades.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachinescalesets.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmextensions.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmruncommands.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvms.go create mode 100644 services/compute/mgmt/2021-08-01/compute/virtualmachinesizes.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/CHANGELOG.md create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/_meta.json create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/account.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/activity.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/agentregistrationinformation.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/automationapi/interfaces.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/certificate.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/client.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/connection.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/connectiontype.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/credential.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjob.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjobstream.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/dscnode.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/dscnodeconfiguration.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/enums.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/fields.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/hybridrunbookworkergroup.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/job.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/jobschedule.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/jobstream.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/keys.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/linkedworkspace.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/models.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/module.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/nodecountinformation.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/nodereports.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/objectdatatypes.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/operations.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/privateendpointconnections.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/privatelinkresources.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/python2package.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/runbook.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/runbookdraft.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/schedule.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationmachineruns.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationruns.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurations.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrol.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjob.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjobstreams.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/statistics.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/testjob.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/testjobstreams.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/usages.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/variable.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/version.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/watcher.go create mode 100644 services/preview/automation/mgmt/2020-01-13-preview/automation/webhook.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 65f0fa716279..ee96e332e5a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## `v61.1.0` + +### New Packages + +- `github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute` +- `github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation` + ## `v61.0.0` ### New Packages @@ -11,7 +18,7 @@ | Package Path | Changelog | | :--- | :---: | -| `github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/notificationhubs/mgmt/2017-04-01/notificationhubs/CHANGELOG.md) | +| `github.com/Azure/azure-sdk-for-go/services/notificationhubs/mgmt/2017-04-01/notificationhubs` | [details](https://github.com/Azure/azure-sdk-for-go/blob/v61.0.0/services/notificationhubs/mgmt/2017-04-01/notificationhubs/CHANGELOG.md) | ## `v60.3.0` diff --git a/profiles/latest/compute/mgmt/compute/computeapi/models.go b/profiles/latest/compute/mgmt/compute/computeapi/models.go index 53a5cb23bab1..e041a22bbf69 100644 --- a/profiles/latest/compute/mgmt/compute/computeapi/models.go +++ b/profiles/latest/compute/mgmt/compute/computeapi/models.go @@ -9,7 +9,7 @@ package computeapi -import original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute/computeapi" +import original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute/computeapi" type AvailabilitySetsClientAPI = original.AvailabilitySetsClientAPI type CapacityReservationGroupsClientAPI = original.CapacityReservationGroupsClientAPI diff --git a/profiles/latest/compute/mgmt/compute/models.go b/profiles/latest/compute/mgmt/compute/models.go index 4f936dacc295..00ba711213ee 100644 --- a/profiles/latest/compute/mgmt/compute/models.go +++ b/profiles/latest/compute/mgmt/compute/models.go @@ -12,7 +12,7 @@ package compute import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" + original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute" ) const ( @@ -116,14 +116,16 @@ const ( type DiskCreateOption = original.DiskCreateOption const ( - DiskCreateOptionAttach DiskCreateOption = original.DiskCreateOptionAttach - DiskCreateOptionCopy DiskCreateOption = original.DiskCreateOptionCopy - DiskCreateOptionCopyStart DiskCreateOption = original.DiskCreateOptionCopyStart - DiskCreateOptionEmpty DiskCreateOption = original.DiskCreateOptionEmpty - DiskCreateOptionFromImage DiskCreateOption = original.DiskCreateOptionFromImage - DiskCreateOptionImport DiskCreateOption = original.DiskCreateOptionImport - DiskCreateOptionRestore DiskCreateOption = original.DiskCreateOptionRestore - DiskCreateOptionUpload DiskCreateOption = original.DiskCreateOptionUpload + DiskCreateOptionAttach DiskCreateOption = original.DiskCreateOptionAttach + DiskCreateOptionCopy DiskCreateOption = original.DiskCreateOptionCopy + DiskCreateOptionCopyStart DiskCreateOption = original.DiskCreateOptionCopyStart + DiskCreateOptionEmpty DiskCreateOption = original.DiskCreateOptionEmpty + DiskCreateOptionFromImage DiskCreateOption = original.DiskCreateOptionFromImage + DiskCreateOptionImport DiskCreateOption = original.DiskCreateOptionImport + DiskCreateOptionImportSecure DiskCreateOption = original.DiskCreateOptionImportSecure + DiskCreateOptionRestore DiskCreateOption = original.DiskCreateOptionRestore + DiskCreateOptionUpload DiskCreateOption = original.DiskCreateOptionUpload + DiskCreateOptionUploadPreparedSecure DiskCreateOption = original.DiskCreateOptionUploadPreparedSecure ) type DiskCreateOptionTypes = original.DiskCreateOptionTypes @@ -157,6 +159,7 @@ const ( type DiskEncryptionSetType = original.DiskEncryptionSetType const ( + DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = original.DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = original.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = original.DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys ) @@ -164,7 +167,10 @@ const ( type DiskSecurityTypes = original.DiskSecurityTypes const ( - DiskSecurityTypesTrustedLaunch DiskSecurityTypes = original.DiskSecurityTypesTrustedLaunch + DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = original.DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey + DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = original.DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey + DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = original.DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey + DiskSecurityTypesTrustedLaunch DiskSecurityTypes = original.DiskSecurityTypesTrustedLaunch ) type DiskState = original.DiskState @@ -1355,7 +1361,6 @@ type RestorePointCollectionUpdate = original.RestorePointCollectionUpdate type RestorePointCollectionsClient = original.RestorePointCollectionsClient type RestorePointCollectionsDeleteFuture = original.RestorePointCollectionsDeleteFuture type RestorePointProperties = original.RestorePointProperties -type RestorePointProvisioningDetails = original.RestorePointProvisioningDetails type RestorePointSourceMetadata = original.RestorePointSourceMetadata type RestorePointSourceVMDataDisk = original.RestorePointSourceVMDataDisk type RestorePointSourceVMOSDisk = original.RestorePointSourceVMOSDisk diff --git a/profiles/preview/compute/mgmt/compute/computeapi/models.go b/profiles/preview/compute/mgmt/compute/computeapi/models.go index 53a5cb23bab1..e041a22bbf69 100644 --- a/profiles/preview/compute/mgmt/compute/computeapi/models.go +++ b/profiles/preview/compute/mgmt/compute/computeapi/models.go @@ -9,7 +9,7 @@ package computeapi -import original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute/computeapi" +import original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute/computeapi" type AvailabilitySetsClientAPI = original.AvailabilitySetsClientAPI type CapacityReservationGroupsClientAPI = original.CapacityReservationGroupsClientAPI diff --git a/profiles/preview/compute/mgmt/compute/models.go b/profiles/preview/compute/mgmt/compute/models.go index fb6f81586c8f..c4f1512686a5 100644 --- a/profiles/preview/compute/mgmt/compute/models.go +++ b/profiles/preview/compute/mgmt/compute/models.go @@ -12,7 +12,7 @@ package compute import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-07-01/compute" + original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute" ) const ( @@ -116,14 +116,16 @@ const ( type DiskCreateOption = original.DiskCreateOption const ( - DiskCreateOptionAttach DiskCreateOption = original.DiskCreateOptionAttach - DiskCreateOptionCopy DiskCreateOption = original.DiskCreateOptionCopy - DiskCreateOptionCopyStart DiskCreateOption = original.DiskCreateOptionCopyStart - DiskCreateOptionEmpty DiskCreateOption = original.DiskCreateOptionEmpty - DiskCreateOptionFromImage DiskCreateOption = original.DiskCreateOptionFromImage - DiskCreateOptionImport DiskCreateOption = original.DiskCreateOptionImport - DiskCreateOptionRestore DiskCreateOption = original.DiskCreateOptionRestore - DiskCreateOptionUpload DiskCreateOption = original.DiskCreateOptionUpload + DiskCreateOptionAttach DiskCreateOption = original.DiskCreateOptionAttach + DiskCreateOptionCopy DiskCreateOption = original.DiskCreateOptionCopy + DiskCreateOptionCopyStart DiskCreateOption = original.DiskCreateOptionCopyStart + DiskCreateOptionEmpty DiskCreateOption = original.DiskCreateOptionEmpty + DiskCreateOptionFromImage DiskCreateOption = original.DiskCreateOptionFromImage + DiskCreateOptionImport DiskCreateOption = original.DiskCreateOptionImport + DiskCreateOptionImportSecure DiskCreateOption = original.DiskCreateOptionImportSecure + DiskCreateOptionRestore DiskCreateOption = original.DiskCreateOptionRestore + DiskCreateOptionUpload DiskCreateOption = original.DiskCreateOptionUpload + DiskCreateOptionUploadPreparedSecure DiskCreateOption = original.DiskCreateOptionUploadPreparedSecure ) type DiskCreateOptionTypes = original.DiskCreateOptionTypes @@ -157,6 +159,7 @@ const ( type DiskEncryptionSetType = original.DiskEncryptionSetType const ( + DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = original.DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = original.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = original.DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys ) @@ -164,7 +167,10 @@ const ( type DiskSecurityTypes = original.DiskSecurityTypes const ( - DiskSecurityTypesTrustedLaunch DiskSecurityTypes = original.DiskSecurityTypesTrustedLaunch + DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = original.DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey + DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = original.DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey + DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = original.DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey + DiskSecurityTypesTrustedLaunch DiskSecurityTypes = original.DiskSecurityTypesTrustedLaunch ) type DiskState = original.DiskState @@ -1355,7 +1361,6 @@ type RestorePointCollectionUpdate = original.RestorePointCollectionUpdate type RestorePointCollectionsClient = original.RestorePointCollectionsClient type RestorePointCollectionsDeleteFuture = original.RestorePointCollectionsDeleteFuture type RestorePointProperties = original.RestorePointProperties -type RestorePointProvisioningDetails = original.RestorePointProvisioningDetails type RestorePointSourceMetadata = original.RestorePointSourceMetadata type RestorePointSourceVMDataDisk = original.RestorePointSourceVMDataDisk type RestorePointSourceVMOSDisk = original.RestorePointSourceVMOSDisk diff --git a/profiles/preview/preview/automation/mgmt/automation/automationapi/models.go b/profiles/preview/preview/automation/mgmt/automation/automationapi/models.go index 12618f30848c..5a4ec4e7ebd5 100644 --- a/profiles/preview/preview/automation/mgmt/automation/automationapi/models.go +++ b/profiles/preview/preview/automation/mgmt/automation/automationapi/models.go @@ -9,7 +9,7 @@ package automationapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-06-30-preview/automation/automationapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation/automationapi" type AccountClientAPI = original.AccountClientAPI type ActivityClientAPI = original.ActivityClientAPI @@ -35,6 +35,8 @@ type NodeCountInformationClientAPI = original.NodeCountInformationClientAPI type NodeReportsClientAPI = original.NodeReportsClientAPI type ObjectDataTypesClientAPI = original.ObjectDataTypesClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type Python2PackageClientAPI = original.Python2PackageClientAPI type RunbookClientAPI = original.RunbookClientAPI type RunbookDraftClientAPI = original.RunbookDraftClientAPI diff --git a/profiles/preview/preview/automation/mgmt/automation/models.go b/profiles/preview/preview/automation/mgmt/automation/models.go index 9bab9f472a5f..c5b39dd8bfd6 100644 --- a/profiles/preview/preview/automation/mgmt/automation/models.go +++ b/profiles/preview/preview/automation/mgmt/automation/models.go @@ -12,7 +12,7 @@ package automation import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2018-06-30-preview/automation" + original "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" ) const ( @@ -22,36 +22,36 @@ const ( type AccountState = original.AccountState const ( - Ok AccountState = original.Ok - Suspended AccountState = original.Suspended - Unavailable AccountState = original.Unavailable + AccountStateOk AccountState = original.AccountStateOk + AccountStateSuspended AccountState = original.AccountStateSuspended + AccountStateUnavailable AccountState = original.AccountStateUnavailable ) type AgentRegistrationKeyName = original.AgentRegistrationKeyName const ( - Primary AgentRegistrationKeyName = original.Primary - Secondary AgentRegistrationKeyName = original.Secondary + AgentRegistrationKeyNamePrimary AgentRegistrationKeyName = original.AgentRegistrationKeyNamePrimary + AgentRegistrationKeyNameSecondary AgentRegistrationKeyName = original.AgentRegistrationKeyNameSecondary ) type ContentSourceType = original.ContentSourceType const ( - EmbeddedContent ContentSourceType = original.EmbeddedContent - URI ContentSourceType = original.URI + ContentSourceTypeEmbeddedContent ContentSourceType = original.ContentSourceTypeEmbeddedContent + ContentSourceTypeURI ContentSourceType = original.ContentSourceTypeURI ) type CountType = original.CountType const ( - Nodeconfiguration CountType = original.Nodeconfiguration - Status CountType = original.Status + CountTypeNodeconfiguration CountType = original.CountTypeNodeconfiguration + CountTypeStatus CountType = original.CountTypeStatus ) type DscConfigurationProvisioningState = original.DscConfigurationProvisioningState const ( - Succeeded DscConfigurationProvisioningState = original.Succeeded + DscConfigurationProvisioningStateSucceeded DscConfigurationProvisioningState = original.DscConfigurationProvisioningStateSucceeded ) type DscConfigurationState = original.DscConfigurationState @@ -62,63 +62,70 @@ const ( DscConfigurationStatePublished DscConfigurationState = original.DscConfigurationStatePublished ) +type EncryptionKeySourceType = original.EncryptionKeySourceType + +const ( + EncryptionKeySourceTypeMicrosoftAutomation EncryptionKeySourceType = original.EncryptionKeySourceTypeMicrosoftAutomation + EncryptionKeySourceTypeMicrosoftKeyvault EncryptionKeySourceType = original.EncryptionKeySourceTypeMicrosoftKeyvault +) + type GroupTypeEnum = original.GroupTypeEnum const ( - System GroupTypeEnum = original.System - User GroupTypeEnum = original.User + GroupTypeEnumSystem GroupTypeEnum = original.GroupTypeEnumSystem + GroupTypeEnumUser GroupTypeEnum = original.GroupTypeEnumUser ) type HTTPStatusCode = original.HTTPStatusCode const ( - Accepted HTTPStatusCode = original.Accepted - Ambiguous HTTPStatusCode = original.Ambiguous - BadGateway HTTPStatusCode = original.BadGateway - BadRequest HTTPStatusCode = original.BadRequest - Conflict HTTPStatusCode = original.Conflict - Continue HTTPStatusCode = original.Continue - Created HTTPStatusCode = original.Created - ExpectationFailed HTTPStatusCode = original.ExpectationFailed - Forbidden HTTPStatusCode = original.Forbidden - Found HTTPStatusCode = original.Found - GatewayTimeout HTTPStatusCode = original.GatewayTimeout - Gone HTTPStatusCode = original.Gone - HTTPVersionNotSupported HTTPStatusCode = original.HTTPVersionNotSupported - InternalServerError HTTPStatusCode = original.InternalServerError - LengthRequired HTTPStatusCode = original.LengthRequired - MethodNotAllowed HTTPStatusCode = original.MethodNotAllowed - Moved HTTPStatusCode = original.Moved - MovedPermanently HTTPStatusCode = original.MovedPermanently - MultipleChoices HTTPStatusCode = original.MultipleChoices - NoContent HTTPStatusCode = original.NoContent - NonAuthoritativeInformation HTTPStatusCode = original.NonAuthoritativeInformation - NotAcceptable HTTPStatusCode = original.NotAcceptable - NotFound HTTPStatusCode = original.NotFound - NotImplemented HTTPStatusCode = original.NotImplemented - NotModified HTTPStatusCode = original.NotModified - OK HTTPStatusCode = original.OK - PartialContent HTTPStatusCode = original.PartialContent - PaymentRequired HTTPStatusCode = original.PaymentRequired - PreconditionFailed HTTPStatusCode = original.PreconditionFailed - ProxyAuthenticationRequired HTTPStatusCode = original.ProxyAuthenticationRequired - Redirect HTTPStatusCode = original.Redirect - RedirectKeepVerb HTTPStatusCode = original.RedirectKeepVerb - RedirectMethod HTTPStatusCode = original.RedirectMethod - RequestedRangeNotSatisfiable HTTPStatusCode = original.RequestedRangeNotSatisfiable - RequestEntityTooLarge HTTPStatusCode = original.RequestEntityTooLarge - RequestTimeout HTTPStatusCode = original.RequestTimeout - RequestURITooLong HTTPStatusCode = original.RequestURITooLong - ResetContent HTTPStatusCode = original.ResetContent - SeeOther HTTPStatusCode = original.SeeOther - ServiceUnavailable HTTPStatusCode = original.ServiceUnavailable - SwitchingProtocols HTTPStatusCode = original.SwitchingProtocols - TemporaryRedirect HTTPStatusCode = original.TemporaryRedirect - Unauthorized HTTPStatusCode = original.Unauthorized - UnsupportedMediaType HTTPStatusCode = original.UnsupportedMediaType - Unused HTTPStatusCode = original.Unused - UpgradeRequired HTTPStatusCode = original.UpgradeRequired - UseProxy HTTPStatusCode = original.UseProxy + HTTPStatusCodeAccepted HTTPStatusCode = original.HTTPStatusCodeAccepted + HTTPStatusCodeAmbiguous HTTPStatusCode = original.HTTPStatusCodeAmbiguous + HTTPStatusCodeBadGateway HTTPStatusCode = original.HTTPStatusCodeBadGateway + HTTPStatusCodeBadRequest HTTPStatusCode = original.HTTPStatusCodeBadRequest + HTTPStatusCodeConflict HTTPStatusCode = original.HTTPStatusCodeConflict + HTTPStatusCodeContinue HTTPStatusCode = original.HTTPStatusCodeContinue + HTTPStatusCodeCreated HTTPStatusCode = original.HTTPStatusCodeCreated + HTTPStatusCodeExpectationFailed HTTPStatusCode = original.HTTPStatusCodeExpectationFailed + HTTPStatusCodeForbidden HTTPStatusCode = original.HTTPStatusCodeForbidden + HTTPStatusCodeFound HTTPStatusCode = original.HTTPStatusCodeFound + HTTPStatusCodeGatewayTimeout HTTPStatusCode = original.HTTPStatusCodeGatewayTimeout + HTTPStatusCodeGone HTTPStatusCode = original.HTTPStatusCodeGone + HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = original.HTTPStatusCodeHTTPVersionNotSupported + HTTPStatusCodeInternalServerError HTTPStatusCode = original.HTTPStatusCodeInternalServerError + HTTPStatusCodeLengthRequired HTTPStatusCode = original.HTTPStatusCodeLengthRequired + HTTPStatusCodeMethodNotAllowed HTTPStatusCode = original.HTTPStatusCodeMethodNotAllowed + HTTPStatusCodeMoved HTTPStatusCode = original.HTTPStatusCodeMoved + HTTPStatusCodeMovedPermanently HTTPStatusCode = original.HTTPStatusCodeMovedPermanently + HTTPStatusCodeMultipleChoices HTTPStatusCode = original.HTTPStatusCodeMultipleChoices + HTTPStatusCodeNoContent HTTPStatusCode = original.HTTPStatusCodeNoContent + HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = original.HTTPStatusCodeNonAuthoritativeInformation + HTTPStatusCodeNotAcceptable HTTPStatusCode = original.HTTPStatusCodeNotAcceptable + HTTPStatusCodeNotFound HTTPStatusCode = original.HTTPStatusCodeNotFound + HTTPStatusCodeNotImplemented HTTPStatusCode = original.HTTPStatusCodeNotImplemented + HTTPStatusCodeNotModified HTTPStatusCode = original.HTTPStatusCodeNotModified + HTTPStatusCodeOK HTTPStatusCode = original.HTTPStatusCodeOK + HTTPStatusCodePartialContent HTTPStatusCode = original.HTTPStatusCodePartialContent + HTTPStatusCodePaymentRequired HTTPStatusCode = original.HTTPStatusCodePaymentRequired + HTTPStatusCodePreconditionFailed HTTPStatusCode = original.HTTPStatusCodePreconditionFailed + HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = original.HTTPStatusCodeProxyAuthenticationRequired + HTTPStatusCodeRedirect HTTPStatusCode = original.HTTPStatusCodeRedirect + HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = original.HTTPStatusCodeRedirectKeepVerb + HTTPStatusCodeRedirectMethod HTTPStatusCode = original.HTTPStatusCodeRedirectMethod + HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = original.HTTPStatusCodeRequestedRangeNotSatisfiable + HTTPStatusCodeRequestEntityTooLarge HTTPStatusCode = original.HTTPStatusCodeRequestEntityTooLarge + HTTPStatusCodeRequestTimeout HTTPStatusCode = original.HTTPStatusCodeRequestTimeout + HTTPStatusCodeRequestURITooLong HTTPStatusCode = original.HTTPStatusCodeRequestURITooLong + HTTPStatusCodeResetContent HTTPStatusCode = original.HTTPStatusCodeResetContent + HTTPStatusCodeSeeOther HTTPStatusCode = original.HTTPStatusCodeSeeOther + HTTPStatusCodeServiceUnavailable HTTPStatusCode = original.HTTPStatusCodeServiceUnavailable + HTTPStatusCodeSwitchingProtocols HTTPStatusCode = original.HTTPStatusCodeSwitchingProtocols + HTTPStatusCodeTemporaryRedirect HTTPStatusCode = original.HTTPStatusCodeTemporaryRedirect + HTTPStatusCodeUnauthorized HTTPStatusCode = original.HTTPStatusCodeUnauthorized + HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = original.HTTPStatusCodeUnsupportedMediaType + HTTPStatusCodeUnused HTTPStatusCode = original.HTTPStatusCodeUnused + HTTPStatusCodeUpgradeRequired HTTPStatusCode = original.HTTPStatusCodeUpgradeRequired + HTTPStatusCodeUseProxy HTTPStatusCode = original.HTTPStatusCodeUseProxy ) type JobProvisioningState = original.JobProvisioningState @@ -151,13 +158,13 @@ const ( type JobStreamType = original.JobStreamType const ( - Any JobStreamType = original.Any - Debug JobStreamType = original.Debug - Error JobStreamType = original.Error - Output JobStreamType = original.Output - Progress JobStreamType = original.Progress - Verbose JobStreamType = original.Verbose - Warning JobStreamType = original.Warning + JobStreamTypeAny JobStreamType = original.JobStreamTypeAny + JobStreamTypeDebug JobStreamType = original.JobStreamTypeDebug + JobStreamTypeError JobStreamType = original.JobStreamTypeError + JobStreamTypeOutput JobStreamType = original.JobStreamTypeOutput + JobStreamTypeProgress JobStreamType = original.JobStreamTypeProgress + JobStreamTypeVerbose JobStreamType = original.JobStreamTypeVerbose + JobStreamTypeWarning JobStreamType = original.JobStreamTypeWarning ) type KeyName = original.KeyName @@ -170,17 +177,17 @@ const ( type KeyPermissions = original.KeyPermissions const ( - Full KeyPermissions = original.Full - Read KeyPermissions = original.Read + KeyPermissionsFull KeyPermissions = original.KeyPermissionsFull + KeyPermissionsRead KeyPermissions = original.KeyPermissionsRead ) type LinuxUpdateClasses = original.LinuxUpdateClasses const ( - Critical LinuxUpdateClasses = original.Critical - Other LinuxUpdateClasses = original.Other - Security LinuxUpdateClasses = original.Security - Unclassified LinuxUpdateClasses = original.Unclassified + LinuxUpdateClassesCritical LinuxUpdateClasses = original.LinuxUpdateClassesCritical + LinuxUpdateClassesOther LinuxUpdateClasses = original.LinuxUpdateClassesOther + LinuxUpdateClassesSecurity LinuxUpdateClasses = original.LinuxUpdateClassesSecurity + LinuxUpdateClassesUnclassified LinuxUpdateClasses = original.LinuxUpdateClassesUnclassified ) type ModuleProvisioningState = original.ModuleProvisioningState @@ -207,16 +214,25 @@ const ( type OperatingSystemType = original.OperatingSystemType const ( - Linux OperatingSystemType = original.Linux - Windows OperatingSystemType = original.Windows + OperatingSystemTypeLinux OperatingSystemType = original.OperatingSystemTypeLinux + OperatingSystemTypeWindows OperatingSystemType = original.OperatingSystemTypeWindows ) type ProvisioningState = original.ProvisioningState const ( - Completed ProvisioningState = original.Completed - Failed ProvisioningState = original.Failed - Running ProvisioningState = original.Running + ProvisioningStateCompleted ProvisioningState = original.ProvisioningStateCompleted + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateRunning ProvisioningState = original.ProvisioningStateRunning +) + +type ResourceIdentityType = original.ResourceIdentityType + +const ( + ResourceIdentityTypeNone ResourceIdentityType = original.ResourceIdentityTypeNone + ResourceIdentityTypeSystemAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssigned + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssignedUserAssigned + ResourceIdentityTypeUserAssigned ResourceIdentityType = original.ResourceIdentityTypeUserAssigned ) type RunbookProvisioningState = original.RunbookProvisioningState @@ -236,50 +252,50 @@ const ( type RunbookTypeEnum = original.RunbookTypeEnum const ( - Graph RunbookTypeEnum = original.Graph - GraphPowerShell RunbookTypeEnum = original.GraphPowerShell - GraphPowerShellWorkflow RunbookTypeEnum = original.GraphPowerShellWorkflow - PowerShell RunbookTypeEnum = original.PowerShell - PowerShellWorkflow RunbookTypeEnum = original.PowerShellWorkflow - Script RunbookTypeEnum = original.Script + RunbookTypeEnumGraph RunbookTypeEnum = original.RunbookTypeEnumGraph + RunbookTypeEnumGraphPowerShell RunbookTypeEnum = original.RunbookTypeEnumGraphPowerShell + RunbookTypeEnumGraphPowerShellWorkflow RunbookTypeEnum = original.RunbookTypeEnumGraphPowerShellWorkflow + RunbookTypeEnumPowerShell RunbookTypeEnum = original.RunbookTypeEnumPowerShell + RunbookTypeEnumPowerShellWorkflow RunbookTypeEnum = original.RunbookTypeEnumPowerShellWorkflow + RunbookTypeEnumScript RunbookTypeEnum = original.RunbookTypeEnumScript ) type ScheduleDay = original.ScheduleDay const ( - Friday ScheduleDay = original.Friday - Monday ScheduleDay = original.Monday - Saturday ScheduleDay = original.Saturday - Sunday ScheduleDay = original.Sunday - Thursday ScheduleDay = original.Thursday - Tuesday ScheduleDay = original.Tuesday - Wednesday ScheduleDay = original.Wednesday + ScheduleDayFriday ScheduleDay = original.ScheduleDayFriday + ScheduleDayMonday ScheduleDay = original.ScheduleDayMonday + ScheduleDaySaturday ScheduleDay = original.ScheduleDaySaturday + ScheduleDaySunday ScheduleDay = original.ScheduleDaySunday + ScheduleDayThursday ScheduleDay = original.ScheduleDayThursday + ScheduleDayTuesday ScheduleDay = original.ScheduleDayTuesday + ScheduleDayWednesday ScheduleDay = original.ScheduleDayWednesday ) type ScheduleFrequency = original.ScheduleFrequency const ( - Day ScheduleFrequency = original.Day - Hour ScheduleFrequency = original.Hour - Minute ScheduleFrequency = original.Minute - Month ScheduleFrequency = original.Month - OneTime ScheduleFrequency = original.OneTime - Week ScheduleFrequency = original.Week + ScheduleFrequencyDay ScheduleFrequency = original.ScheduleFrequencyDay + ScheduleFrequencyHour ScheduleFrequency = original.ScheduleFrequencyHour + ScheduleFrequencyMinute ScheduleFrequency = original.ScheduleFrequencyMinute + ScheduleFrequencyMonth ScheduleFrequency = original.ScheduleFrequencyMonth + ScheduleFrequencyOneTime ScheduleFrequency = original.ScheduleFrequencyOneTime + ScheduleFrequencyWeek ScheduleFrequency = original.ScheduleFrequencyWeek ) type SkuNameEnum = original.SkuNameEnum const ( - Basic SkuNameEnum = original.Basic - Free SkuNameEnum = original.Free + SkuNameEnumBasic SkuNameEnum = original.SkuNameEnumBasic + SkuNameEnumFree SkuNameEnum = original.SkuNameEnumFree ) type SourceType = original.SourceType const ( - GitHub SourceType = original.GitHub - VsoGit SourceType = original.VsoGit - VsoTfvc SourceType = original.VsoTfvc + SourceTypeGitHub SourceType = original.SourceTypeGitHub + SourceTypeVsoGit SourceType = original.SourceTypeVsoGit + SourceTypeVsoTfvc SourceType = original.SourceTypeVsoTfvc ) type StreamType = original.StreamType @@ -292,8 +308,8 @@ const ( type SyncType = original.SyncType const ( - FullSync SyncType = original.FullSync - PartialSync SyncType = original.PartialSync + SyncTypeFullSync SyncType = original.SyncTypeFullSync + SyncTypePartialSync SyncType = original.SyncTypePartialSync ) type TagOperators = original.TagOperators @@ -306,8 +322,8 @@ const ( type TokenType = original.TokenType const ( - Oauth TokenType = original.Oauth - PersonalAccessToken TokenType = original.PersonalAccessToken + TokenTypeOauth TokenType = original.TokenTypeOauth + TokenTypePersonalAccessToken TokenType = original.TokenTypePersonalAccessToken ) type WindowsUpdateClasses = original.WindowsUpdateClasses @@ -362,7 +378,6 @@ type CertificateListResultPage = original.CertificateListResultPage type CertificateProperties = original.CertificateProperties type CertificateUpdateParameters = original.CertificateUpdateParameters type CertificateUpdateProperties = original.CertificateUpdateProperties -type CollectionItemUpdateConfiguration = original.CollectionItemUpdateConfiguration type Connection = original.Connection type ConnectionClient = original.ConnectionClient type ConnectionCreateOrUpdateParameters = original.ConnectionCreateOrUpdateParameters @@ -443,6 +458,8 @@ type DscNodeUpdateParametersProperties = original.DscNodeUpdateParametersPropert type DscReportError = original.DscReportError type DscReportResource = original.DscReportResource type DscReportResourceNavigation = original.DscReportResourceNavigation +type EncryptionProperties = original.EncryptionProperties +type EncryptionPropertiesIdentity = original.EncryptionPropertiesIdentity type ErrorResponse = original.ErrorResponse type FieldDefinition = original.FieldDefinition type FieldsClient = original.FieldsClient @@ -453,6 +470,8 @@ type HybridRunbookWorkerGroupUpdateParameters = original.HybridRunbookWorkerGrou type HybridRunbookWorkerGroupsListResult = original.HybridRunbookWorkerGroupsListResult type HybridRunbookWorkerGroupsListResultIterator = original.HybridRunbookWorkerGroupsListResultIterator type HybridRunbookWorkerGroupsListResultPage = original.HybridRunbookWorkerGroupsListResultPage +type Identity = original.Identity +type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue type Job = original.Job type JobClient = original.JobClient type JobCollectionItem = original.JobCollectionItem @@ -480,6 +499,7 @@ type JobStreamListResultPage = original.JobStreamListResultPage type JobStreamProperties = original.JobStreamProperties type Key = original.Key type KeyListResult = original.KeyListResult +type KeyVaultProperties = original.KeyVaultProperties type KeysClient = original.KeysClient type LinkedWorkspace = original.LinkedWorkspace type LinkedWorkspaceClient = original.LinkedWorkspaceClient @@ -506,6 +526,18 @@ type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationsClient = original.OperationsClient +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionListResult = original.PrivateEndpointConnectionListResult +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateEndpointConnectionsCreateOrUpdateFuture = original.PrivateEndpointConnectionsCreateOrUpdateFuture +type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture +type PrivateEndpointProperty = original.PrivateEndpointProperty +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionStateProperty = original.PrivateLinkServiceConnectionStateProperty type ProxyResource = original.ProxyResource type Python2PackageClient = original.Python2PackageClient type PythonPackageCreateParameters = original.PythonPackageCreateParameters @@ -533,6 +565,7 @@ type RunbookProperties = original.RunbookProperties type RunbookPublishFuture = original.RunbookPublishFuture type RunbookUpdateParameters = original.RunbookUpdateParameters type RunbookUpdateProperties = original.RunbookUpdateProperties +type SUCScheduleProperties = original.SUCScheduleProperties type Schedule = original.Schedule type ScheduleAssociationProperty = original.ScheduleAssociationProperty type ScheduleClient = original.ScheduleClient @@ -546,8 +579,6 @@ type ScheduleUpdateParameters = original.ScheduleUpdateParameters type ScheduleUpdateProperties = original.ScheduleUpdateProperties type SetObject = original.SetObject type Sku = original.Sku -type SoftareUpdateConfigurationRunTaskProperties = original.SoftareUpdateConfigurationRunTaskProperties -type SoftareUpdateConfigurationRunTasks = original.SoftareUpdateConfigurationRunTasks type SoftwareUpdateConfiguration = original.SoftwareUpdateConfiguration type SoftwareUpdateConfigurationCollectionItem = original.SoftwareUpdateConfigurationCollectionItem type SoftwareUpdateConfigurationCollectionItemProperties = original.SoftwareUpdateConfigurationCollectionItemProperties @@ -559,6 +590,8 @@ type SoftwareUpdateConfigurationProperties = original.SoftwareUpdateConfiguratio type SoftwareUpdateConfigurationRun = original.SoftwareUpdateConfigurationRun type SoftwareUpdateConfigurationRunListResult = original.SoftwareUpdateConfigurationRunListResult type SoftwareUpdateConfigurationRunProperties = original.SoftwareUpdateConfigurationRunProperties +type SoftwareUpdateConfigurationRunTaskProperties = original.SoftwareUpdateConfigurationRunTaskProperties +type SoftwareUpdateConfigurationRunTasks = original.SoftwareUpdateConfigurationRunTasks type SoftwareUpdateConfigurationRunsClient = original.SoftwareUpdateConfigurationRunsClient type SoftwareUpdateConfigurationTasks = original.SoftwareUpdateConfigurationTasks type SoftwareUpdateConfigurationsClient = original.SoftwareUpdateConfigurationsClient @@ -885,6 +918,18 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewPython2PackageClient(subscriptionID string) Python2PackageClient { return original.NewPython2PackageClient(subscriptionID) } @@ -1056,6 +1101,9 @@ func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisi func PossibleDscConfigurationStateValues() []DscConfigurationState { return original.PossibleDscConfigurationStateValues() } +func PossibleEncryptionKeySourceTypeValues() []EncryptionKeySourceType { + return original.PossibleEncryptionKeySourceTypeValues() +} func PossibleGroupTypeEnumValues() []GroupTypeEnum { return original.PossibleGroupTypeEnumValues() } @@ -1089,6 +1137,9 @@ func PossibleOperatingSystemTypeValues() []OperatingSystemType { func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return original.PossibleResourceIdentityTypeValues() +} func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { return original.PossibleRunbookProvisioningStateValues() } diff --git a/services/compute/mgmt/2021-08-01/compute/CHANGELOG.md b/services/compute/mgmt/2021-08-01/compute/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/compute/mgmt/2021-08-01/compute/_meta.json b/services/compute/mgmt/2021-08-01/compute/_meta.json new file mode 100644 index 000000000000..a3d5fa330476 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3b9b0a930e29cbead33df69ae46c7080408e4c0f", + "readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", + "tag": "package-2021-08-01", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-08-01 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/services/compute/mgmt/2021-08-01/compute/availabilitysets.go b/services/compute/mgmt/2021-08-01/compute/availabilitysets.go new file mode 100644 index 000000000000..7953c6555084 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/availabilitysets.go @@ -0,0 +1,652 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AvailabilitySetsClient is the compute Client +type AvailabilitySetsClient struct { + BaseClient +} + +// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client. +func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { + return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { + return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update an availability set. +// Parameters: +// resourceGroupName - the name of the resource group. +// availabilitySetName - the name of the availability set. +// parameters - parameters supplied to the Create Availability Set operation. +func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "availabilitySetName": autorest.Encode("path", availabilitySetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an availability set. +// Parameters: +// resourceGroupName - the name of the resource group. +// availabilitySetName - the name of the availability set. +func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "availabilitySetName": autorest.Encode("path", availabilitySetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about an availability set. +// Parameters: +// resourceGroupName - the name of the resource group. +// availabilitySetName - the name of the availability set. +func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "availabilitySetName": autorest.Encode("path", availabilitySetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all availability sets in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") + defer func() { + sc := -1 + if result.aslr.Response.Response != nil { + sc = result.aslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request") + return + } + + result.aslr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") + return + } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { + req, err := lastResults.availabilitySetListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an +// existing availability set. +// Parameters: +// resourceGroupName - the name of the resource group. +// availabilitySetName - the name of the availability set. +func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request") + return + } + + resp, err := client.ListAvailableSizesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request") + return + } + + result, err = client.ListAvailableSizesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request") + return + } + + return +} + +// ListAvailableSizesPreparer prepares the ListAvailableSizes request. +func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "availabilitySetName": autorest.Encode("path", availabilitySetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the +// http.Response Body if it receives an error. +func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always +// closes the http.Response Body. +func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySubscription lists all availability sets in a subscription. +// Parameters: +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. +func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") + defer func() { + sc := -1 + if result.aslr.Response.Response != nil { + sc = result.aslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.aslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.aslr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.aslr.hasNextLink() && result.aslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { + req, err := lastResults.availabilitySetListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx, expand) + return +} + +// Update update an availability set. +// Parameters: +// resourceGroupName - the name of the resource group. +// availabilitySetName - the name of the availability set. +// parameters - parameters supplied to the Update Availability Set operation. +func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "availabilitySetName": autorest.Encode("path", availabilitySetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/capacityreservationgroups.go b/services/compute/mgmt/2021-08-01/compute/capacityreservationgroups.go new file mode 100644 index 000000000000..a525a29711a9 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/capacityreservationgroups.go @@ -0,0 +1,596 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CapacityReservationGroupsClient is the compute Client +type CapacityReservationGroupsClient struct { + BaseClient +} + +// NewCapacityReservationGroupsClient creates an instance of the CapacityReservationGroupsClient client. +func NewCapacityReservationGroupsClient(subscriptionID string) CapacityReservationGroupsClient { + return NewCapacityReservationGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCapacityReservationGroupsClientWithBaseURI creates an instance of the CapacityReservationGroupsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewCapacityReservationGroupsClientWithBaseURI(baseURI string, subscriptionID string) CapacityReservationGroupsClient { + return CapacityReservationGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update a capacity reservation group. When updating a capacity reservation +// group, only tags may be modified. Please refer to https://aka.ms/CapacityReservation for more details. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +// parameters - parameters supplied to the Create capacity reservation Group. +func (client CapacityReservationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup) (result CapacityReservationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CapacityReservationGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CapacityReservationGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityReservationGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a capacity reservation group. This operation is allowed only if all the associated +// resources are disassociated from the reservation group and all capacity reservations under the reservation group +// have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +func (client CapacityReservationGroupsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, capacityReservationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CapacityReservationGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CapacityReservationGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation that retrieves information about a capacity reservation group. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance +// views of the capacity reservations under the capacity reservation group which is a snapshot of the runtime +// properties of a capacity reservation that is managed by the platform and can change outside of control plane +// operations. +func (client CapacityReservationGroupsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, expand CapacityReservationGroupInstanceViewTypes) (result CapacityReservationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, capacityReservationGroupName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CapacityReservationGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, expand CapacityReservationGroupInstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CapacityReservationGroupsClient) GetResponder(resp *http.Response) (result CapacityReservationGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all of the capacity reservation groups in the specified resource group. Use the nextLink +// property in the response to get the next page of capacity reservation groups. +// Parameters: +// resourceGroupName - the name of the resource group. +// expand - the expand expression to apply on the operation. Based on the expand param(s) specified we return +// Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation +// group in the response. +func (client CapacityReservationGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.crglr.Response.Response != nil { + sc = result.crglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.crglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.crglr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.crglr.hasNextLink() && result.crglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CapacityReservationGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CapacityReservationGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result CapacityReservationGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CapacityReservationGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults CapacityReservationGroupListResult) (result CapacityReservationGroupListResult, err error) { + req, err := lastResults.capacityReservationGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CapacityReservationGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, expand) + return +} + +// ListBySubscription lists all of the capacity reservation groups in the subscription. Use the nextLink property in +// the response to get the next page of capacity reservation groups. +// Parameters: +// expand - the expand expression to apply on the operation. Based on the expand param(s) specified we return +// Virtual Machine or ScaleSet VM Instance or both resource Ids which are associated to capacity reservation +// group in the response. +func (client CapacityReservationGroupsClient) ListBySubscription(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.crglr.Response.Response != nil { + sc = result.crglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.crglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.crglr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.crglr.hasNextLink() && result.crglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client CapacityReservationGroupsClient) ListBySubscriptionPreparer(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/capacityReservationGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client CapacityReservationGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result CapacityReservationGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client CapacityReservationGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults CapacityReservationGroupListResult) (result CapacityReservationGroupListResult, err error) { + req, err := lastResults.capacityReservationGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client CapacityReservationGroupsClient) ListBySubscriptionComplete(ctx context.Context, expand ExpandTypesForGetCapacityReservationGroups) (result CapacityReservationGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx, expand) + return +} + +// Update the operation to update a capacity reservation group. When updating a capacity reservation group, only tags +// may be modified. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +// parameters - parameters supplied to the Update capacity reservation Group operation. +func (client CapacityReservationGroupsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate) (result CapacityReservationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationGroupsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CapacityReservationGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters CapacityReservationGroupUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CapacityReservationGroupsClient) UpdateResponder(resp *http.Response) (result CapacityReservationGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/capacityreservations.go b/services/compute/mgmt/2021-08-01/compute/capacityreservations.go new file mode 100644 index 000000000000..fc894216ae13 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/capacityreservations.go @@ -0,0 +1,493 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CapacityReservationsClient is the compute Client +type CapacityReservationsClient struct { + BaseClient +} + +// NewCapacityReservationsClient creates an instance of the CapacityReservationsClient client. +func NewCapacityReservationsClient(subscriptionID string) CapacityReservationsClient { + return NewCapacityReservationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCapacityReservationsClientWithBaseURI creates an instance of the CapacityReservationsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCapacityReservationsClientWithBaseURI(baseURI string, subscriptionID string) CapacityReservationsClient { + return CapacityReservationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update a capacity reservation. Please note some properties can be set only +// during capacity reservation creation. Please refer to https://aka.ms/CapacityReservation for more details. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +// capacityReservationName - the name of the capacity reservation. +// parameters - parameters supplied to the Create capacity reservation. +func (client CapacityReservationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation) (result CapacityReservationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.CapacityReservationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CapacityReservationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "capacityReservationName": autorest.Encode("path", capacityReservationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationsClient) CreateOrUpdateSender(req *http.Request) (future CapacityReservationsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CapacityReservationsClient) CreateOrUpdateResponder(resp *http.Response) (result CapacityReservation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete a capacity reservation. This operation is allowed only when all the associated +// resources are disassociated from the capacity reservation. Please refer to https://aka.ms/CapacityReservation for +// more details. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +// capacityReservationName - the name of the capacity reservation. +func (client CapacityReservationsClient) Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) (result CapacityReservationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CapacityReservationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "capacityReservationName": autorest.Encode("path", capacityReservationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationsClient) DeleteSender(req *http.Request) (future CapacityReservationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CapacityReservationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation that retrieves information about the capacity reservation. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +// capacityReservationName - the name of the capacity reservation. +// expand - the expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime +// properties of the capacity reservation that is managed by the platform and can change outside of control +// plane operations. +func (client CapacityReservationsClient) Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, expand CapacityReservationInstanceViewTypes) (result CapacityReservation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CapacityReservationsClient) GetPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, expand CapacityReservationInstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "capacityReservationName": autorest.Encode("path", capacityReservationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CapacityReservationsClient) GetResponder(resp *http.Response) (result CapacityReservation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByCapacityReservationGroup lists all of the capacity reservations in the specified capacity reservation group. +// Use the nextLink property in the response to get the next page of capacity reservations. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +func (client CapacityReservationsClient) ListByCapacityReservationGroup(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result CapacityReservationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.ListByCapacityReservationGroup") + defer func() { + sc := -1 + if result.crlr.Response.Response != nil { + sc = result.crlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByCapacityReservationGroupNextResults + req, err := client.ListByCapacityReservationGroupPreparer(ctx, resourceGroupName, capacityReservationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByCapacityReservationGroupSender(req) + if err != nil { + result.crlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", resp, "Failure sending request") + return + } + + result.crlr, err = client.ListByCapacityReservationGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "ListByCapacityReservationGroup", resp, "Failure responding to request") + return + } + if result.crlr.hasNextLink() && result.crlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByCapacityReservationGroupPreparer prepares the ListByCapacityReservationGroup request. +func (client CapacityReservationsClient) ListByCapacityReservationGroupPreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByCapacityReservationGroupSender sends the ListByCapacityReservationGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationsClient) ListByCapacityReservationGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByCapacityReservationGroupResponder handles the response to the ListByCapacityReservationGroup request. The method always +// closes the http.Response Body. +func (client CapacityReservationsClient) ListByCapacityReservationGroupResponder(resp *http.Response) (result CapacityReservationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByCapacityReservationGroupNextResults retrieves the next set of results, if any. +func (client CapacityReservationsClient) listByCapacityReservationGroupNextResults(ctx context.Context, lastResults CapacityReservationListResult) (result CapacityReservationListResult, err error) { + req, err := lastResults.capacityReservationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByCapacityReservationGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByCapacityReservationGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "listByCapacityReservationGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByCapacityReservationGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CapacityReservationsClient) ListByCapacityReservationGroupComplete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result CapacityReservationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.ListByCapacityReservationGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByCapacityReservationGroup(ctx, resourceGroupName, capacityReservationGroupName) + return +} + +// Update the operation to update a capacity reservation. +// Parameters: +// resourceGroupName - the name of the resource group. +// capacityReservationGroupName - the name of the capacity reservation group. +// capacityReservationName - the name of the capacity reservation. +// parameters - parameters supplied to the Update capacity reservation operation. +func (client CapacityReservationsClient) Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate) (result CapacityReservationsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, capacityReservationGroupName, capacityReservationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CapacityReservationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "capacityReservationGroupName": autorest.Encode("path", capacityReservationGroupName), + "capacityReservationName": autorest.Encode("path", capacityReservationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CapacityReservationsClient) UpdateSender(req *http.Request) (future CapacityReservationsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CapacityReservationsClient) UpdateResponder(resp *http.Response) (result CapacityReservation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/client.go b/services/compute/mgmt/2021-08-01/compute/client.go new file mode 100644 index 000000000000..1812f27feb99 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/client.go @@ -0,0 +1,41 @@ +// Package compute implements the Azure ARM Compute service API version . +// +// Compute Client +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Compute + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Compute. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/compute/mgmt/2021-08-01/compute/cloudserviceoperatingsystems.go b/services/compute/mgmt/2021-08-01/compute/cloudserviceoperatingsystems.go new file mode 100644 index 000000000000..7dfce08d9096 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/cloudserviceoperatingsystems.go @@ -0,0 +1,422 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CloudServiceOperatingSystemsClient is the compute Client +type CloudServiceOperatingSystemsClient struct { + BaseClient +} + +// NewCloudServiceOperatingSystemsClient creates an instance of the CloudServiceOperatingSystemsClient client. +func NewCloudServiceOperatingSystemsClient(subscriptionID string) CloudServiceOperatingSystemsClient { + return NewCloudServiceOperatingSystemsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCloudServiceOperatingSystemsClientWithBaseURI creates an instance of the CloudServiceOperatingSystemsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewCloudServiceOperatingSystemsClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceOperatingSystemsClient { + return CloudServiceOperatingSystemsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetOSFamily gets properties of a guest operating system family that can be specified in the XML service +// configuration (.cscfg) for a cloud service. +// Parameters: +// location - name of the location that the OS family pertains to. +// osFamilyName - name of the OS family. +func (client CloudServiceOperatingSystemsClient) GetOSFamily(ctx context.Context, location string, osFamilyName string) (result OSFamily, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.GetOSFamily") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOSFamilyPreparer(ctx, location, osFamilyName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", nil, "Failure preparing request") + return + } + + resp, err := client.GetOSFamilySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", resp, "Failure sending request") + return + } + + result, err = client.GetOSFamilyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSFamily", resp, "Failure responding to request") + return + } + + return +} + +// GetOSFamilyPreparer prepares the GetOSFamily request. +func (client CloudServiceOperatingSystemsClient) GetOSFamilyPreparer(ctx context.Context, location string, osFamilyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "osFamilyName": autorest.Encode("path", osFamilyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies/{osFamilyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOSFamilySender sends the GetOSFamily request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceOperatingSystemsClient) GetOSFamilySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOSFamilyResponder handles the response to the GetOSFamily request. The method always +// closes the http.Response Body. +func (client CloudServiceOperatingSystemsClient) GetOSFamilyResponder(resp *http.Response) (result OSFamily, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOSVersion gets properties of a guest operating system version that can be specified in the XML service +// configuration (.cscfg) for a cloud service. +// Parameters: +// location - name of the location that the OS version pertains to. +// osVersionName - name of the OS version. +func (client CloudServiceOperatingSystemsClient) GetOSVersion(ctx context.Context, location string, osVersionName string) (result OSVersion, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.GetOSVersion") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOSVersionPreparer(ctx, location, osVersionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", nil, "Failure preparing request") + return + } + + resp, err := client.GetOSVersionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", resp, "Failure sending request") + return + } + + result, err = client.GetOSVersionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "GetOSVersion", resp, "Failure responding to request") + return + } + + return +} + +// GetOSVersionPreparer prepares the GetOSVersion request. +func (client CloudServiceOperatingSystemsClient) GetOSVersionPreparer(ctx context.Context, location string, osVersionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "osVersionName": autorest.Encode("path", osVersionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions/{osVersionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOSVersionSender sends the GetOSVersion request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceOperatingSystemsClient) GetOSVersionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOSVersionResponder handles the response to the GetOSVersion request. The method always +// closes the http.Response Body. +func (client CloudServiceOperatingSystemsClient) GetOSVersionResponder(resp *http.Response) (result OSVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOSFamilies gets a list of all guest operating system families available to be specified in the XML service +// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS +// Families. Do this till nextLink is null to fetch all the OS Families. +// Parameters: +// location - name of the location that the OS families pertain to. +func (client CloudServiceOperatingSystemsClient) ListOSFamilies(ctx context.Context, location string) (result OSFamilyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSFamilies") + defer func() { + sc := -1 + if result.oflr.Response.Response != nil { + sc = result.oflr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOSFamiliesNextResults + req, err := client.ListOSFamiliesPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", nil, "Failure preparing request") + return + } + + resp, err := client.ListOSFamiliesSender(req) + if err != nil { + result.oflr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", resp, "Failure sending request") + return + } + + result.oflr, err = client.ListOSFamiliesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSFamilies", resp, "Failure responding to request") + return + } + if result.oflr.hasNextLink() && result.oflr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOSFamiliesPreparer prepares the ListOSFamilies request. +func (client CloudServiceOperatingSystemsClient) ListOSFamiliesPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsFamilies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOSFamiliesSender sends the ListOSFamilies request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceOperatingSystemsClient) ListOSFamiliesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOSFamiliesResponder handles the response to the ListOSFamilies request. The method always +// closes the http.Response Body. +func (client CloudServiceOperatingSystemsClient) ListOSFamiliesResponder(resp *http.Response) (result OSFamilyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOSFamiliesNextResults retrieves the next set of results, if any. +func (client CloudServiceOperatingSystemsClient) listOSFamiliesNextResults(ctx context.Context, lastResults OSFamilyListResult) (result OSFamilyListResult, err error) { + req, err := lastResults.oSFamilyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOSFamiliesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOSFamiliesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSFamiliesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOSFamiliesComplete enumerates all values, automatically crossing page boundaries as required. +func (client CloudServiceOperatingSystemsClient) ListOSFamiliesComplete(ctx context.Context, location string) (result OSFamilyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSFamilies") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOSFamilies(ctx, location) + return +} + +// ListOSVersions gets a list of all guest operating system versions available to be specified in the XML service +// configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page of OS +// versions. Do this till nextLink is null to fetch all the OS versions. +// Parameters: +// location - name of the location that the OS versions pertain to. +func (client CloudServiceOperatingSystemsClient) ListOSVersions(ctx context.Context, location string) (result OSVersionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSVersions") + defer func() { + sc := -1 + if result.ovlr.Response.Response != nil { + sc = result.ovlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOSVersionsNextResults + req, err := client.ListOSVersionsPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", nil, "Failure preparing request") + return + } + + resp, err := client.ListOSVersionsSender(req) + if err != nil { + result.ovlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", resp, "Failure sending request") + return + } + + result.ovlr, err = client.ListOSVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "ListOSVersions", resp, "Failure responding to request") + return + } + if result.ovlr.hasNextLink() && result.ovlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOSVersionsPreparer prepares the ListOSVersions request. +func (client CloudServiceOperatingSystemsClient) ListOSVersionsPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/cloudServiceOsVersions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOSVersionsSender sends the ListOSVersions request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceOperatingSystemsClient) ListOSVersionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOSVersionsResponder handles the response to the ListOSVersions request. The method always +// closes the http.Response Body. +func (client CloudServiceOperatingSystemsClient) ListOSVersionsResponder(resp *http.Response) (result OSVersionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOSVersionsNextResults retrieves the next set of results, if any. +func (client CloudServiceOperatingSystemsClient) listOSVersionsNextResults(ctx context.Context, lastResults OSVersionListResult) (result OSVersionListResult, err error) { + req, err := lastResults.oSVersionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOSVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOSVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceOperatingSystemsClient", "listOSVersionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOSVersionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client CloudServiceOperatingSystemsClient) ListOSVersionsComplete(ctx context.Context, location string) (result OSVersionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceOperatingSystemsClient.ListOSVersions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOSVersions(ctx, location) + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/cloudserviceroleinstances.go b/services/compute/mgmt/2021-08-01/compute/cloudserviceroleinstances.go new file mode 100644 index 000000000000..4edea0aec5d7 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/cloudserviceroleinstances.go @@ -0,0 +1,699 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CloudServiceRoleInstancesClient is the compute Client +type CloudServiceRoleInstancesClient struct { + BaseClient +} + +// NewCloudServiceRoleInstancesClient creates an instance of the CloudServiceRoleInstancesClient client. +func NewCloudServiceRoleInstancesClient(subscriptionID string) CloudServiceRoleInstancesClient { + return NewCloudServiceRoleInstancesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCloudServiceRoleInstancesClientWithBaseURI creates an instance of the CloudServiceRoleInstancesClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewCloudServiceRoleInstancesClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceRoleInstancesClient { + return CloudServiceRoleInstancesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete deletes a role instance from a cloud service. +// Parameters: +// roleInstanceName - name of the role instance. +func (client CloudServiceRoleInstancesClient) Delete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CloudServiceRoleInstancesClient) DeletePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleInstanceName": autorest.Encode("path", roleInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) DeleteSender(req *http.Request) (future CloudServiceRoleInstancesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a role instance from a cloud service. +// Parameters: +// roleInstanceName - name of the role instance. +// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services. +func (client CloudServiceRoleInstancesClient) Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CloudServiceRoleInstancesClient) GetPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleInstanceName": autorest.Encode("path", roleInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) GetResponder(resp *http.Response) (result RoleInstance, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceView retrieves information about the run-time state of a role instance in a cloud service. +// Parameters: +// roleInstanceName - name of the role instance. +func (client CloudServiceRoleInstancesClient) GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result RoleInstanceInstanceView, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetInstanceView") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetInstanceViewPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceViewSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceViewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetInstanceView", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceViewPreparer prepares the GetInstanceView request. +func (client CloudServiceRoleInstancesClient) GetInstanceViewPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleInstanceName": autorest.Encode("path", roleInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/instanceView", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceViewSender sends the GetInstanceView request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) GetInstanceViewResponder(resp *http.Response) (result RoleInstanceInstanceView, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRemoteDesktopFile gets a remote desktop file for a role instance in a cloud service. +// Parameters: +// roleInstanceName - name of the role instance. +func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.GetRemoteDesktopFile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetRemoteDesktopFilePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", nil, "Failure preparing request") + return + } + + resp, err := client.GetRemoteDesktopFileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", resp, "Failure sending request") + return + } + + result, err = client.GetRemoteDesktopFileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "GetRemoteDesktopFile", resp, "Failure responding to request") + return + } + + return +} + +// GetRemoteDesktopFilePreparer prepares the GetRemoteDesktopFile request. +func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFilePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleInstanceName": autorest.Encode("path", roleInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/remoteDesktopFile", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRemoteDesktopFileSender sends the GetRemoteDesktopFile request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRemoteDesktopFileResponder handles the response to the GetRemoteDesktopFile request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) GetRemoteDesktopFileResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of all role instances in a cloud service. Use nextLink property in the response to get the next +// page of role instances. Do this till nextLink is null to fetch all the role instances. +// Parameters: +// expand - the expand expression to apply to the operation. 'UserData' is not supported for cloud services. +func (client CloudServiceRoleInstancesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstanceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.List") + defer func() { + sc := -1 + if result.rilr.Response.Response != nil { + sc = result.rilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, cloudServiceName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", resp, "Failure sending request") + return + } + + result.rilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "List", resp, "Failure responding to request") + return + } + if result.rilr.hasNextLink() && result.rilr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client CloudServiceRoleInstancesClient) ListPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) ListResponder(resp *http.Response) (result RoleInstanceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client CloudServiceRoleInstancesClient) listNextResults(ctx context.Context, lastResults RoleInstanceListResult) (result RoleInstanceListResult, err error) { + req, err := lastResults.roleInstanceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client CloudServiceRoleInstancesClient) ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string, expand InstanceViewTypes) (result RoleInstanceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, cloudServiceName, expand) + return +} + +// Rebuild the Rebuild Role Instance asynchronous operation reinstalls the operating system on instances of web roles +// or worker roles and initializes the storage resources that are used by them. If you do not want to initialize +// storage resources, you can use Reimage Role Instance. +// Parameters: +// roleInstanceName - name of the role instance. +func (client CloudServiceRoleInstancesClient) Rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRebuildFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Rebuild") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RebuildPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Rebuild", nil, "Failure preparing request") + return + } + + result, err = client.RebuildSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Rebuild", result.Response(), "Failure sending request") + return + } + + return +} + +// RebuildPreparer prepares the Rebuild request. +func (client CloudServiceRoleInstancesClient) RebuildPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleInstanceName": autorest.Encode("path", roleInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/rebuild", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RebuildSender sends the Rebuild request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) RebuildSender(req *http.Request) (future CloudServiceRoleInstancesRebuildFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RebuildResponder handles the response to the Rebuild request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) RebuildResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Reimage the Reimage Role Instance asynchronous operation reinstalls the operating system on instances of web roles +// or worker roles. +// Parameters: +// roleInstanceName - name of the role instance. +func (client CloudServiceRoleInstancesClient) Reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesReimageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Reimage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReimagePreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = client.ReimageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Reimage", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimagePreparer prepares the Reimage request. +func (client CloudServiceRoleInstancesClient) ReimagePreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleInstanceName": autorest.Encode("path", roleInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/reimage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageSender sends the Reimage request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) ReimageSender(req *http.Request) (future CloudServiceRoleInstancesReimageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageResponder handles the response to the Reimage request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restart the Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. +// Parameters: +// roleInstanceName - name of the role instance. +func (client CloudServiceRoleInstancesClient) Restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleInstancesRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleInstancesClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, roleInstanceName, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client CloudServiceRoleInstancesClient) RestartPreparer(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleInstanceName": autorest.Encode("path", roleInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roleInstances/{roleInstanceName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRoleInstancesClient) RestartSender(req *http.Request) (future CloudServiceRoleInstancesRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client CloudServiceRoleInstancesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/cloudserviceroles.go b/services/compute/mgmt/2021-08-01/compute/cloudserviceroles.go new file mode 100644 index 000000000000..dac28bd988b1 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/cloudserviceroles.go @@ -0,0 +1,224 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CloudServiceRolesClient is the compute Client +type CloudServiceRolesClient struct { + BaseClient +} + +// NewCloudServiceRolesClient creates an instance of the CloudServiceRolesClient client. +func NewCloudServiceRolesClient(subscriptionID string) CloudServiceRolesClient { + return NewCloudServiceRolesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCloudServiceRolesClientWithBaseURI creates an instance of the CloudServiceRolesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCloudServiceRolesClientWithBaseURI(baseURI string, subscriptionID string) CloudServiceRolesClient { + return CloudServiceRolesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a role from a cloud service. +// Parameters: +// roleName - name of the role. +func (client CloudServiceRolesClient) Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (result CloudServiceRole, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, roleName, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CloudServiceRolesClient) GetPreparer(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "roleName": autorest.Encode("path", roleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles/{roleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRolesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CloudServiceRolesClient) GetResponder(resp *http.Response) (result CloudServiceRole, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page of +// roles. Do this till nextLink is null to fetch all the roles. +func (client CloudServiceRolesClient) List(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.List") + defer func() { + sc := -1 + if result.csrlr.Response.Response != nil { + sc = result.csrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.csrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", resp, "Failure sending request") + return + } + + result.csrlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "List", resp, "Failure responding to request") + return + } + if result.csrlr.hasNextLink() && result.csrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client CloudServiceRolesClient) ListPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/roles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServiceRolesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client CloudServiceRolesClient) ListResponder(resp *http.Response) (result CloudServiceRoleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client CloudServiceRolesClient) listNextResults(ctx context.Context, lastResults CloudServiceRoleListResult) (result CloudServiceRoleListResult, err error) { + req, err := lastResults.cloudServiceRoleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRolesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client CloudServiceRolesClient) ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceRoleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRolesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, cloudServiceName) + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/cloudservices.go b/services/compute/mgmt/2021-08-01/compute/cloudservices.go new file mode 100644 index 000000000000..7086dd644a08 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/cloudservices.go @@ -0,0 +1,1198 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CloudServicesClient is the compute Client +type CloudServicesClient struct { + BaseClient +} + +// NewCloudServicesClient creates an instance of the CloudServicesClient client. +func NewCloudServicesClient(subscriptionID string) CloudServicesClient { + return NewCloudServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCloudServicesClientWithBaseURI creates an instance of the CloudServicesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCloudServicesClientWithBaseURI(baseURI string, subscriptionID string) CloudServicesClient { + return CloudServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a cloud service. Please note some properties can be set only during cloud service +// creation. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// parameters - the cloud service object. +func (client CloudServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudService) (result CloudServicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("compute.CloudServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, cloudServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CloudServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) CreateOrUpdateSender(req *http.Request) (future CloudServicesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) CreateOrUpdateResponder(resp *http.Response) (result CloudService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +func (client CloudServicesClient) Delete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CloudServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) DeleteSender(req *http.Request) (future CloudServicesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteInstances deletes role instances in a cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// parameters - list of cloud service role instance names. +func (client CloudServicesClient) DeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesDeleteInstancesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.DeleteInstances") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("compute.CloudServicesClient", "DeleteInstances", err.Error()) + } + + req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, cloudServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "DeleteInstances", nil, "Failure preparing request") + return + } + + result, err = client.DeleteInstancesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "DeleteInstances", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteInstancesPreparer prepares the DeleteInstances request. +func (client CloudServicesClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/delete", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteInstancesSender sends the DeleteInstances request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) DeleteInstancesSender(req *http.Request) (future CloudServicesDeleteInstancesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get display information about a cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +func (client CloudServicesClient) Get(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudService, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CloudServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) GetResponder(resp *http.Response) (result CloudService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceView gets the status of a cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +func (client CloudServicesClient) GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServiceInstanceView, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.GetInstanceView") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceViewSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceViewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "GetInstanceView", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceViewPreparer prepares the GetInstanceView request. +func (client CloudServicesClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/instanceView", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceViewSender sends the GetInstanceView request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) GetInstanceViewResponder(resp *http.Response) (result CloudServiceInstanceView, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all cloud services under a resource group. Use nextLink property in the response to get the next +// page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. +// Parameters: +// resourceGroupName - name of the resource group. +func (client CloudServicesClient) List(ctx context.Context, resourceGroupName string) (result CloudServiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.List") + defer func() { + sc := -1 + if result.cslr.Response.Response != nil { + sc = result.cslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", resp, "Failure sending request") + return + } + + result.cslr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "List", resp, "Failure responding to request") + return + } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client CloudServicesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) ListResponder(resp *http.Response) (result CloudServiceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client CloudServicesClient) listNextResults(ctx context.Context, lastResults CloudServiceListResult) (result CloudServiceListResult, err error) { + req, err := lastResults.cloudServiceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client CloudServicesClient) ListComplete(ctx context.Context, resourceGroupName string) (result CloudServiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListAll gets a list of all cloud services in the subscription, regardless of the associated resource group. Use +// nextLink property in the response to get the next page of Cloud Services. Do this till nextLink is null to fetch all +// the Cloud Services. +func (client CloudServicesClient) ListAll(ctx context.Context) (result CloudServiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.ListAll") + defer func() { + sc := -1 + if result.cslr.Response.Response != nil { + sc = result.cslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.cslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", resp, "Failure sending request") + return + } + + result.cslr, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.cslr.hasNextLink() && result.cslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client CloudServicesClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/cloudServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) ListAllSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) ListAllResponder(resp *http.Response) (result CloudServiceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client CloudServicesClient) listAllNextResults(ctx context.Context, lastResults CloudServiceListResult) (result CloudServiceListResult, err error) { + req, err := lastResults.cloudServiceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client CloudServicesClient) ListAllComplete(ctx context.Context) (result CloudServiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.ListAll") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAll(ctx) + return +} + +// PowerOff power off the cloud service. Note that resources are still attached and you are getting charged for the +// resources. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +func (client CloudServicesClient) PowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesPowerOffFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.PowerOff") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PowerOffPreparer(ctx, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "PowerOff", nil, "Failure preparing request") + return + } + + result, err = client.PowerOffSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "PowerOff", result.Response(), "Failure sending request") + return + } + + return +} + +// PowerOffPreparer prepares the PowerOff request. +func (client CloudServicesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/poweroff", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PowerOffSender sends the PowerOff request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) PowerOffSender(req *http.Request) (future CloudServicesPowerOffFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PowerOffResponder handles the response to the PowerOff request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Rebuild rebuild Role Instances reinstalls the operating system on instances of web roles or worker roles and +// initializes the storage resources that are used by them. If you do not want to initialize storage resources, you can +// use Reimage Role Instances. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// parameters - list of cloud service role instance names. +func (client CloudServicesClient) Rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesRebuildFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Rebuild") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("compute.CloudServicesClient", "Rebuild", err.Error()) + } + + req, err := client.RebuildPreparer(ctx, resourceGroupName, cloudServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Rebuild", nil, "Failure preparing request") + return + } + + result, err = client.RebuildSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Rebuild", result.Response(), "Failure sending request") + return + } + + return +} + +// RebuildPreparer prepares the Rebuild request. +func (client CloudServicesClient) RebuildPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/rebuild", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RebuildSender sends the Rebuild request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) RebuildSender(req *http.Request) (future CloudServicesRebuildFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RebuildResponder handles the response to the Rebuild request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) RebuildResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Reimage reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// parameters - list of cloud service role instance names. +func (client CloudServicesClient) Reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesReimageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Reimage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("compute.CloudServicesClient", "Reimage", err.Error()) + } + + req, err := client.ReimagePreparer(ctx, resourceGroupName, cloudServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = client.ReimageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Reimage", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimagePreparer prepares the Reimage request. +func (client CloudServicesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/reimage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageSender sends the Reimage request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) ReimageSender(req *http.Request) (future CloudServicesReimageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageResponder handles the response to the Reimage request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restart restarts one or more role instances in a cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// parameters - list of cloud service role instance names. +func (client CloudServicesClient) Restart(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (result CloudServicesRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RoleInstances", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("compute.CloudServicesClient", "Restart", err.Error()) + } + + req, err := client.RestartPreparer(ctx, resourceGroupName, cloudServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client CloudServicesClient) RestartPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *RoleInstances) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) RestartSender(req *http.Request) (future CloudServicesRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts the cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +func (client CloudServicesClient) Start(ctx context.Context, resourceGroupName string, cloudServiceName string) (result CloudServicesStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client CloudServicesClient) StartPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) StartSender(req *http.Request) (future CloudServicesStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update a cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// parameters - the cloud service object. +func (client CloudServicesClient) Update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudServiceUpdate) (result CloudServicesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, cloudServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CloudServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *CloudServiceUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesClient) UpdateSender(req *http.Request) (future CloudServicesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CloudServicesClient) UpdateResponder(resp *http.Response) (result CloudService, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/cloudservicesupdatedomain.go b/services/compute/mgmt/2021-08-01/compute/cloudservicesupdatedomain.go new file mode 100644 index 000000000000..eabe4deefce2 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/cloudservicesupdatedomain.go @@ -0,0 +1,319 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CloudServicesUpdateDomainClient is the compute Client +type CloudServicesUpdateDomainClient struct { + BaseClient +} + +// NewCloudServicesUpdateDomainClient creates an instance of the CloudServicesUpdateDomainClient client. +func NewCloudServicesUpdateDomainClient(subscriptionID string) CloudServicesUpdateDomainClient { + return NewCloudServicesUpdateDomainClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCloudServicesUpdateDomainClientWithBaseURI creates an instance of the CloudServicesUpdateDomainClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewCloudServicesUpdateDomainClientWithBaseURI(baseURI string, subscriptionID string) CloudServicesUpdateDomainClient { + return CloudServicesUpdateDomainClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetUpdateDomain gets the specified update domain of a cloud service. Use nextLink property in the response to get +// the next page of update domains. Do this till nextLink is null to fetch all the update domains. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// updateDomain - specifies an integer value that identifies the update domain. Update domains are identified +// with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. +func (client CloudServicesUpdateDomainClient) GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32) (result UpdateDomain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.GetUpdateDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetUpdateDomainPreparer(ctx, resourceGroupName, cloudServiceName, updateDomain) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpdateDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", resp, "Failure sending request") + return + } + + result, err = client.GetUpdateDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "GetUpdateDomain", resp, "Failure responding to request") + return + } + + return +} + +// GetUpdateDomainPreparer prepares the GetUpdateDomain request. +func (client CloudServicesUpdateDomainClient) GetUpdateDomainPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "updateDomain": autorest.Encode("path", updateDomain), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpdateDomainSender sends the GetUpdateDomain request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesUpdateDomainClient) GetUpdateDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUpdateDomainResponder handles the response to the GetUpdateDomain request. The method always +// closes the http.Response Body. +func (client CloudServicesUpdateDomainClient) GetUpdateDomainResponder(resp *http.Response) (result UpdateDomain, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUpdateDomains gets a list of all update domains in a cloud service. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +func (client CloudServicesUpdateDomainClient) ListUpdateDomains(ctx context.Context, resourceGroupName string, cloudServiceName string) (result UpdateDomainListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.ListUpdateDomains") + defer func() { + sc := -1 + if result.udlr.Response.Response != nil { + sc = result.udlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listUpdateDomainsNextResults + req, err := client.ListUpdateDomainsPreparer(ctx, resourceGroupName, cloudServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", nil, "Failure preparing request") + return + } + + resp, err := client.ListUpdateDomainsSender(req) + if err != nil { + result.udlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", resp, "Failure sending request") + return + } + + result.udlr, err = client.ListUpdateDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "ListUpdateDomains", resp, "Failure responding to request") + return + } + if result.udlr.hasNextLink() && result.udlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListUpdateDomainsPreparer prepares the ListUpdateDomains request. +func (client CloudServicesUpdateDomainClient) ListUpdateDomainsPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUpdateDomainsSender sends the ListUpdateDomains request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesUpdateDomainClient) ListUpdateDomainsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUpdateDomainsResponder handles the response to the ListUpdateDomains request. The method always +// closes the http.Response Body. +func (client CloudServicesUpdateDomainClient) ListUpdateDomainsResponder(resp *http.Response) (result UpdateDomainListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listUpdateDomainsNextResults retrieves the next set of results, if any. +func (client CloudServicesUpdateDomainClient) listUpdateDomainsNextResults(ctx context.Context, lastResults UpdateDomainListResult) (result UpdateDomainListResult, err error) { + req, err := lastResults.updateDomainListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListUpdateDomainsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListUpdateDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "listUpdateDomainsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListUpdateDomainsComplete enumerates all values, automatically crossing page boundaries as required. +func (client CloudServicesUpdateDomainClient) ListUpdateDomainsComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result UpdateDomainListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.ListUpdateDomains") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListUpdateDomains(ctx, resourceGroupName, cloudServiceName) + return +} + +// WalkUpdateDomain updates the role instances in the specified update domain. +// Parameters: +// resourceGroupName - name of the resource group. +// cloudServiceName - name of the cloud service. +// updateDomain - specifies an integer value that identifies the update domain. Update domains are identified +// with a zero-based index: the first update domain has an ID of 0, the second has an ID of 1, and so on. +// parameters - the update domain object. +func (client CloudServicesUpdateDomainClient) WalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters *UpdateDomain) (result CloudServicesUpdateDomainWalkUpdateDomainFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServicesUpdateDomainClient.WalkUpdateDomain") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.WalkUpdateDomainPreparer(ctx, resourceGroupName, cloudServiceName, updateDomain, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "WalkUpdateDomain", nil, "Failure preparing request") + return + } + + result, err = client.WalkUpdateDomainSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainClient", "WalkUpdateDomain", result.Response(), "Failure sending request") + return + } + + return +} + +// WalkUpdateDomainPreparer prepares the WalkUpdateDomain request. +func (client CloudServicesUpdateDomainClient) WalkUpdateDomainPreparer(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters *UpdateDomain) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cloudServiceName": autorest.Encode("path", cloudServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "updateDomain": autorest.Encode("path", updateDomain), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName}/updateDomains/{updateDomain}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// WalkUpdateDomainSender sends the WalkUpdateDomain request. The method will close the +// http.Response Body if it receives an error. +func (client CloudServicesUpdateDomainClient) WalkUpdateDomainSender(req *http.Request) (future CloudServicesUpdateDomainWalkUpdateDomainFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// WalkUpdateDomainResponder handles the response to the WalkUpdateDomain request. The method always +// closes the http.Response Body. +func (client CloudServicesUpdateDomainClient) WalkUpdateDomainResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/communitygalleries.go b/services/compute/mgmt/2021-08-01/compute/communitygalleries.go new file mode 100644 index 000000000000..99596387171d --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/communitygalleries.go @@ -0,0 +1,108 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CommunityGalleriesClient is the compute Client +type CommunityGalleriesClient struct { + BaseClient +} + +// NewCommunityGalleriesClient creates an instance of the CommunityGalleriesClient client. +func NewCommunityGalleriesClient(subscriptionID string) CommunityGalleriesClient { + return NewCommunityGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCommunityGalleriesClientWithBaseURI creates an instance of the CommunityGalleriesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewCommunityGalleriesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleriesClient { + return CommunityGalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a community gallery by gallery public name. +// Parameters: +// location - resource location. +// publicGalleryName - the public name of the community gallery. +func (client CommunityGalleriesClient) Get(ctx context.Context, location string, publicGalleryName string) (result CommunityGallery, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleriesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, publicGalleryName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CommunityGalleriesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CommunityGalleriesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "publicGalleryName": autorest.Encode("path", publicGalleryName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CommunityGalleriesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CommunityGalleriesClient) GetResponder(resp *http.Response) (result CommunityGallery, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/communitygalleryimages.go b/services/compute/mgmt/2021-08-01/compute/communitygalleryimages.go new file mode 100644 index 000000000000..ef82a37bc941 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/communitygalleryimages.go @@ -0,0 +1,110 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CommunityGalleryImagesClient is the compute Client +type CommunityGalleryImagesClient struct { + BaseClient +} + +// NewCommunityGalleryImagesClient creates an instance of the CommunityGalleryImagesClient client. +func NewCommunityGalleryImagesClient(subscriptionID string) CommunityGalleryImagesClient { + return NewCommunityGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCommunityGalleryImagesClientWithBaseURI creates an instance of the CommunityGalleryImagesClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewCommunityGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImagesClient { + return CommunityGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a community gallery image. +// Parameters: +// location - resource location. +// publicGalleryName - the public name of the community gallery. +// galleryImageName - the name of the community gallery image definition. +func (client CommunityGalleryImagesClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result CommunityGalleryImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImagesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImagesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CommunityGalleryImagesClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "location": autorest.Encode("path", location), + "publicGalleryName": autorest.Encode("path", publicGalleryName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CommunityGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CommunityGalleryImagesClient) GetResponder(resp *http.Response) (result CommunityGalleryImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/communitygalleryimageversions.go b/services/compute/mgmt/2021-08-01/compute/communitygalleryimageversions.go new file mode 100644 index 000000000000..03d67523dff7 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/communitygalleryimageversions.go @@ -0,0 +1,114 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CommunityGalleryImageVersionsClient is the compute Client +type CommunityGalleryImageVersionsClient struct { + BaseClient +} + +// NewCommunityGalleryImageVersionsClient creates an instance of the CommunityGalleryImageVersionsClient client. +func NewCommunityGalleryImageVersionsClient(subscriptionID string) CommunityGalleryImageVersionsClient { + return NewCommunityGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCommunityGalleryImageVersionsClientWithBaseURI creates an instance of the CommunityGalleryImageVersionsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewCommunityGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) CommunityGalleryImageVersionsClient { + return CommunityGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a community gallery image version. +// Parameters: +// location - resource location. +// publicGalleryName - the public name of the community gallery. +// galleryImageName - the name of the community gallery image definition. +// galleryImageVersionName - the name of the community gallery image version. Needs to follow semantic version +// name pattern: The allowed characters are digit and period. Digits must be within the range of a 32-bit +// integer. Format: .. +func (client CommunityGalleryImageVersionsClient) Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (result CommunityGalleryImageVersion, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CommunityGalleryImageVersionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, publicGalleryName, galleryImageName, galleryImageVersionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CommunityGalleryImageVersionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CommunityGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), + "location": autorest.Encode("path", location), + "publicGalleryName": autorest.Encode("path", publicGalleryName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CommunityGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CommunityGalleryImageVersionsClient) GetResponder(resp *http.Response) (result CommunityGalleryImageVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2021-08-01/compute/computeapi/interfaces.go new file mode 100644 index 000000000000..338bd80d29c1 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/computeapi/interfaces.go @@ -0,0 +1,640 @@ +package computeapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result compute.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*compute.OperationsClient)(nil) + +// AvailabilitySetsClientAPI contains the set of methods on the AvailabilitySetsClient type. +type AvailabilitySetsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySet) (result compute.AvailabilitySet, err error) + Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.AvailabilitySet, err error) + List(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result compute.AvailabilitySetListResultIterator, err error) + ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result compute.VirtualMachineSizeListResult, err error) + ListBySubscription(ctx context.Context, expand string) (result compute.AvailabilitySetListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context, expand string) (result compute.AvailabilitySetListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters compute.AvailabilitySetUpdate) (result compute.AvailabilitySet, err error) +} + +var _ AvailabilitySetsClientAPI = (*compute.AvailabilitySetsClient)(nil) + +// ProximityPlacementGroupsClientAPI contains the set of methods on the ProximityPlacementGroupsClient type. +type ProximityPlacementGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters compute.ProximityPlacementGroup) (result compute.ProximityPlacementGroup, err error) + Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (result compute.ProximityPlacementGroup, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.ProximityPlacementGroupListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.ProximityPlacementGroupListResultIterator, err error) + ListBySubscription(ctx context.Context) (result compute.ProximityPlacementGroupListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result compute.ProximityPlacementGroupListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters compute.ProximityPlacementGroupUpdate) (result compute.ProximityPlacementGroup, err error) +} + +var _ ProximityPlacementGroupsClientAPI = (*compute.ProximityPlacementGroupsClient)(nil) + +// DedicatedHostGroupsClientAPI contains the set of methods on the DedicatedHostGroupsClient type. +type DedicatedHostGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters compute.DedicatedHostGroup) (result compute.DedicatedHostGroup, err error) + Delete(ctx context.Context, resourceGroupName string, hostGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hostGroupName string, expand compute.InstanceViewTypes) (result compute.DedicatedHostGroup, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.DedicatedHostGroupListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.DedicatedHostGroupListResultIterator, err error) + ListBySubscription(ctx context.Context) (result compute.DedicatedHostGroupListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result compute.DedicatedHostGroupListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters compute.DedicatedHostGroupUpdate) (result compute.DedicatedHostGroup, err error) +} + +var _ DedicatedHostGroupsClientAPI = (*compute.DedicatedHostGroupsClient)(nil) + +// DedicatedHostsClientAPI contains the set of methods on the DedicatedHostsClient type. +type DedicatedHostsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters compute.DedicatedHost) (result compute.DedicatedHostsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result compute.DedicatedHostsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand compute.InstanceViewTypes) (result compute.DedicatedHost, err error) + ListByHostGroup(ctx context.Context, resourceGroupName string, hostGroupName string) (result compute.DedicatedHostListResultPage, err error) + ListByHostGroupComplete(ctx context.Context, resourceGroupName string, hostGroupName string) (result compute.DedicatedHostListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters compute.DedicatedHostUpdate) (result compute.DedicatedHostsUpdateFuture, err error) +} + +var _ DedicatedHostsClientAPI = (*compute.DedicatedHostsClient)(nil) + +// SSHPublicKeysClientAPI contains the set of methods on the SSHPublicKeysClient type. +type SSHPublicKeysClientAPI interface { + Create(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters compute.SSHPublicKeyResource) (result compute.SSHPublicKeyResource, err error) + Delete(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result autorest.Response, err error) + GenerateKeyPair(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result compute.SSHPublicKeyGenerateKeyPairResult, err error) + Get(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result compute.SSHPublicKeyResource, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.SSHPublicKeysGroupListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.SSHPublicKeysGroupListResultIterator, err error) + ListBySubscription(ctx context.Context) (result compute.SSHPublicKeysGroupListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result compute.SSHPublicKeysGroupListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters compute.SSHPublicKeyUpdateResource) (result compute.SSHPublicKeyResource, err error) +} + +var _ SSHPublicKeysClientAPI = (*compute.SSHPublicKeysClient)(nil) + +// VirtualMachineExtensionImagesClientAPI contains the set of methods on the VirtualMachineExtensionImagesClient type. +type VirtualMachineExtensionImagesClientAPI interface { + Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result compute.VirtualMachineExtensionImage, err error) + ListTypes(ctx context.Context, location string, publisherName string) (result compute.ListVirtualMachineExtensionImage, err error) + ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result compute.ListVirtualMachineExtensionImage, err error) +} + +var _ VirtualMachineExtensionImagesClientAPI = (*compute.VirtualMachineExtensionImagesClient)(nil) + +// VirtualMachineExtensionsClientAPI contains the set of methods on the VirtualMachineExtensionsClient type. +type VirtualMachineExtensionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters compute.VirtualMachineExtension) (result compute.VirtualMachineExtensionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result compute.VirtualMachineExtensionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result compute.VirtualMachineExtension, err error) + List(ctx context.Context, resourceGroupName string, VMName string, expand string) (result compute.VirtualMachineExtensionsListResult, err error) + Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters compute.VirtualMachineExtensionUpdate) (result compute.VirtualMachineExtensionsUpdateFuture, err error) +} + +var _ VirtualMachineExtensionsClientAPI = (*compute.VirtualMachineExtensionsClient)(nil) + +// VirtualMachineImagesClientAPI contains the set of methods on the VirtualMachineImagesClient type. +type VirtualMachineImagesClientAPI interface { + Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result compute.VirtualMachineImage, err error) + List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result compute.ListVirtualMachineImageResource, err error) + ListOffers(ctx context.Context, location string, publisherName string) (result compute.ListVirtualMachineImageResource, err error) + ListPublishers(ctx context.Context, location string) (result compute.ListVirtualMachineImageResource, err error) + ListSkus(ctx context.Context, location string, publisherName string, offer string) (result compute.ListVirtualMachineImageResource, err error) +} + +var _ VirtualMachineImagesClientAPI = (*compute.VirtualMachineImagesClient)(nil) + +// VirtualMachineImagesEdgeZoneClientAPI contains the set of methods on the VirtualMachineImagesEdgeZoneClient type. +type VirtualMachineImagesEdgeZoneClientAPI interface { + Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string) (result compute.VirtualMachineImage, err error) + List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result compute.ListVirtualMachineImageResource, err error) + ListOffers(ctx context.Context, location string, edgeZone string, publisherName string) (result compute.ListVirtualMachineImageResource, err error) + ListPublishers(ctx context.Context, location string, edgeZone string) (result compute.ListVirtualMachineImageResource, err error) + ListSkus(ctx context.Context, location string, edgeZone string, publisherName string, offer string) (result compute.ListVirtualMachineImageResource, err error) +} + +var _ VirtualMachineImagesEdgeZoneClientAPI = (*compute.VirtualMachineImagesEdgeZoneClient)(nil) + +// UsageClientAPI contains the set of methods on the UsageClient type. +type UsageClientAPI interface { + List(ctx context.Context, location string) (result compute.ListUsagesResultPage, err error) + ListComplete(ctx context.Context, location string) (result compute.ListUsagesResultIterator, err error) +} + +var _ UsageClientAPI = (*compute.UsageClient)(nil) + +// VirtualMachinesClientAPI contains the set of methods on the VirtualMachinesClient type. +type VirtualMachinesClientAPI interface { + AssessPatches(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesAssessPatchesFuture, err error) + Capture(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineCaptureParameters) (result compute.VirtualMachinesCaptureFuture, err error) + ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesConvertToManagedDisksFuture, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachine) (result compute.VirtualMachinesCreateOrUpdateFuture, err error) + Deallocate(ctx context.Context, resourceGroupName string, VMName string, hibernate *bool) (result compute.VirtualMachinesDeallocateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (result compute.VirtualMachinesDeleteFuture, err error) + Generalize(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (result compute.VirtualMachine, err error) + InstallPatches(ctx context.Context, resourceGroupName string, VMName string, installPatchesInput compute.VirtualMachineInstallPatchesParameters) (result compute.VirtualMachinesInstallPatchesFuture, err error) + InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachineInstanceView, err error) + List(ctx context.Context, resourceGroupName string) (result compute.VirtualMachineListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result compute.VirtualMachineListResultIterator, err error) + ListAll(ctx context.Context, statusOnly string) (result compute.VirtualMachineListResultPage, err error) + ListAllComplete(ctx context.Context, statusOnly string) (result compute.VirtualMachineListResultIterator, err error) + ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachineSizeListResult, err error) + ListByLocation(ctx context.Context, location string) (result compute.VirtualMachineListResultPage, err error) + ListByLocationComplete(ctx context.Context, location string) (result compute.VirtualMachineListResultIterator, err error) + PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesPerformMaintenanceFuture, err error) + PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result compute.VirtualMachinesPowerOffFuture, err error) + Reapply(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesReapplyFuture, err error) + Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesRedeployFuture, err error) + Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *compute.VirtualMachineReimageParameters) (result compute.VirtualMachinesReimageFuture, err error) + Restart(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesRestartFuture, err error) + RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMName string, sasURIExpirationTimeInMinutes *int32) (result compute.RetrieveBootDiagnosticsDataResult, err error) + RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters compute.RunCommandInput) (result compute.VirtualMachinesRunCommandFuture, err error) + SimulateEviction(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) + Start(ctx context.Context, resourceGroupName string, VMName string) (result compute.VirtualMachinesStartFuture, err error) + Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate) (result compute.VirtualMachinesUpdateFuture, err error) +} + +var _ VirtualMachinesClientAPI = (*compute.VirtualMachinesClient)(nil) + +// VirtualMachineScaleSetsClientAPI contains the set of methods on the VirtualMachineScaleSetsClient type. +type VirtualMachineScaleSetsClientAPI interface { + ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VMScaleSetConvertToSinglePlacementGroupInput) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) (result compute.VirtualMachineScaleSetsCreateOrUpdateFuture, err error) + Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) (result compute.VirtualMachineScaleSetsDeallocateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, forceDeletion *bool) (result compute.VirtualMachineScaleSetsDeleteFuture, err error) + DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs, forceDeletion *bool) (result compute.VirtualMachineScaleSetsDeleteInstancesFuture, err error) + ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (result compute.RecoveryWalkResponse, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, expand compute.ExpandTypesForGetVMScaleSets) (result compute.VirtualMachineScaleSet, err error) + GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetInstanceView, err error) + GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) + GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) + List(ctx context.Context, resourceGroupName string) (result compute.VirtualMachineScaleSetListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result compute.VirtualMachineScaleSetListResultIterator, err error) + ListAll(ctx context.Context) (result compute.VirtualMachineScaleSetListWithLinkResultPage, err error) + ListAllComplete(ctx context.Context) (result compute.VirtualMachineScaleSetListWithLinkResultIterator, err error) + ListByLocation(ctx context.Context, location string) (result compute.VirtualMachineScaleSetListResultPage, err error) + ListByLocationComplete(ctx context.Context, location string) (result compute.VirtualMachineScaleSetListResultIterator, err error) + ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetListSkusResultPage, err error) + ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetListSkusResultIterator, err error) + PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) (result compute.VirtualMachineScaleSetsPerformMaintenanceFuture, err error) + PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (result compute.VirtualMachineScaleSetsPowerOffFuture, err error) + Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) (result compute.VirtualMachineScaleSetsRedeployFuture, err error) + Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *compute.VirtualMachineScaleSetReimageParameters) (result compute.VirtualMachineScaleSetsReimageFuture, err error) + ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) (result compute.VirtualMachineScaleSetsReimageAllFuture, err error) + Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) (result compute.VirtualMachineScaleSetsRestartFuture, err error) + SetOrchestrationServiceState(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.OrchestrationServiceStateInput) (result compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) + Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *compute.VirtualMachineScaleSetVMInstanceIDs) (result compute.VirtualMachineScaleSetsStartFuture, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSetUpdate) (result compute.VirtualMachineScaleSetsUpdateFuture, err error) + UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (result compute.VirtualMachineScaleSetsUpdateInstancesFuture, err error) +} + +var _ VirtualMachineScaleSetsClientAPI = (*compute.VirtualMachineScaleSetsClient)(nil) + +// VirtualMachineSizesClientAPI contains the set of methods on the VirtualMachineSizesClient type. +type VirtualMachineSizesClientAPI interface { + List(ctx context.Context, location string) (result compute.VirtualMachineSizeListResult, err error) +} + +var _ VirtualMachineSizesClientAPI = (*compute.VirtualMachineSizesClient)(nil) + +// ImagesClientAPI contains the set of methods on the ImagesClient type. +type ImagesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters compute.Image) (result compute.ImagesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, imageName string) (result compute.ImagesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result compute.Image, err error) + List(ctx context.Context) (result compute.ImageListResultPage, err error) + ListComplete(ctx context.Context) (result compute.ImageListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.ImageListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.ImageListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, imageName string, parameters compute.ImageUpdate) (result compute.ImagesUpdateFuture, err error) +} + +var _ ImagesClientAPI = (*compute.ImagesClient)(nil) + +// RestorePointCollectionsClientAPI contains the set of methods on the RestorePointCollectionsClient type. +type RestorePointCollectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters compute.RestorePointCollection) (result compute.RestorePointCollection, err error) + Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string) (result compute.RestorePointCollectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, expand compute.RestorePointCollectionExpandOptions) (result compute.RestorePointCollection, err error) + List(ctx context.Context, resourceGroupName string) (result compute.RestorePointCollectionListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result compute.RestorePointCollectionListResultIterator, err error) + ListAll(ctx context.Context) (result compute.RestorePointCollectionListResultPage, err error) + ListAllComplete(ctx context.Context) (result compute.RestorePointCollectionListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters compute.RestorePointCollectionUpdate) (result compute.RestorePointCollection, err error) +} + +var _ RestorePointCollectionsClientAPI = (*compute.RestorePointCollectionsClient)(nil) + +// RestorePointsClientAPI contains the set of methods on the RestorePointsClient type. +type RestorePointsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters compute.RestorePoint) (result compute.RestorePointsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (result compute.RestorePointsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (result compute.RestorePoint, err error) +} + +var _ RestorePointsClientAPI = (*compute.RestorePointsClient)(nil) + +// CapacityReservationGroupsClientAPI contains the set of methods on the CapacityReservationGroupsClient type. +type CapacityReservationGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters compute.CapacityReservationGroup) (result compute.CapacityReservationGroup, err error) + Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, expand compute.CapacityReservationGroupInstanceViewTypes) (result compute.CapacityReservationGroup, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, expand compute.ExpandTypesForGetCapacityReservationGroups) (result compute.CapacityReservationGroupListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand compute.ExpandTypesForGetCapacityReservationGroups) (result compute.CapacityReservationGroupListResultIterator, err error) + ListBySubscription(ctx context.Context, expand compute.ExpandTypesForGetCapacityReservationGroups) (result compute.CapacityReservationGroupListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context, expand compute.ExpandTypesForGetCapacityReservationGroups) (result compute.CapacityReservationGroupListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, parameters compute.CapacityReservationGroupUpdate) (result compute.CapacityReservationGroup, err error) +} + +var _ CapacityReservationGroupsClientAPI = (*compute.CapacityReservationGroupsClient)(nil) + +// CapacityReservationsClientAPI contains the set of methods on the CapacityReservationsClient type. +type CapacityReservationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters compute.CapacityReservation) (result compute.CapacityReservationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string) (result compute.CapacityReservationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, expand compute.CapacityReservationInstanceViewTypes) (result compute.CapacityReservation, err error) + ListByCapacityReservationGroup(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result compute.CapacityReservationListResultPage, err error) + ListByCapacityReservationGroupComplete(ctx context.Context, resourceGroupName string, capacityReservationGroupName string) (result compute.CapacityReservationListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters compute.CapacityReservationUpdate) (result compute.CapacityReservationsUpdateFuture, err error) +} + +var _ CapacityReservationsClientAPI = (*compute.CapacityReservationsClient)(nil) + +// VirtualMachineScaleSetExtensionsClientAPI contains the set of methods on the VirtualMachineScaleSetExtensionsClient type. +type VirtualMachineScaleSetExtensionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters compute.VirtualMachineScaleSetExtension) (result compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result compute.VirtualMachineScaleSetExtensionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result compute.VirtualMachineScaleSetExtension, err error) + List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetExtensionListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetExtensionListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters compute.VirtualMachineScaleSetExtensionUpdate) (result compute.VirtualMachineScaleSetExtensionsUpdateFuture, err error) +} + +var _ VirtualMachineScaleSetExtensionsClientAPI = (*compute.VirtualMachineScaleSetExtensionsClient)(nil) + +// VirtualMachineScaleSetRollingUpgradesClientAPI contains the set of methods on the VirtualMachineScaleSetRollingUpgradesClient type. +type VirtualMachineScaleSetRollingUpgradesClientAPI interface { + Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) + GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.RollingUpgradeStatusInfo, err error) + StartExtensionUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) + StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) +} + +var _ VirtualMachineScaleSetRollingUpgradesClientAPI = (*compute.VirtualMachineScaleSetRollingUpgradesClient)(nil) + +// VirtualMachineScaleSetVMExtensionsClientAPI contains the set of methods on the VirtualMachineScaleSetVMExtensionsClient type. +type VirtualMachineScaleSetVMExtensionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineScaleSetVMExtension) (result compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result compute.VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result compute.VirtualMachineScaleSetVMExtension, err error) + List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineScaleSetVMExtensionsListResult, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters compute.VirtualMachineScaleSetVMExtensionUpdate) (result compute.VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) +} + +var _ VirtualMachineScaleSetVMExtensionsClientAPI = (*compute.VirtualMachineScaleSetVMExtensionsClient)(nil) + +// VirtualMachineScaleSetVMsClientAPI contains the set of methods on the VirtualMachineScaleSetVMsClient type. +type VirtualMachineScaleSetVMsClientAPI interface { + Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMsDeallocateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, forceDeletion *bool) (result compute.VirtualMachineScaleSetVMsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand compute.InstanceViewTypes) (result compute.VirtualMachineScaleSetVM, err error) + GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMInstanceView, err error) + List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result compute.VirtualMachineScaleSetVMListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result compute.VirtualMachineScaleSetVMListResultIterator, err error) + PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) + PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (result compute.VirtualMachineScaleSetVMsPowerOffFuture, err error) + Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMsRedeployFuture, err error) + Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *compute.VirtualMachineScaleSetVMReimageParameters) (result compute.VirtualMachineScaleSetVMsReimageFuture, err error) + ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMsReimageAllFuture, err error) + Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMsRestartFuture, err error) + RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, sasURIExpirationTimeInMinutes *int32) (result compute.RetrieveBootDiagnosticsDataResult, err error) + RunCommand(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.RunCommandInput) (result compute.VirtualMachineScaleSetVMsRunCommandFuture, err error) + SimulateEviction(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result autorest.Response, err error) + Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result compute.VirtualMachineScaleSetVMsStartFuture, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters compute.VirtualMachineScaleSetVM) (result compute.VirtualMachineScaleSetVMsUpdateFuture, err error) +} + +var _ VirtualMachineScaleSetVMsClientAPI = (*compute.VirtualMachineScaleSetVMsClient)(nil) + +// LogAnalyticsClientAPI contains the set of methods on the LogAnalyticsClient type. +type LogAnalyticsClientAPI interface { + ExportRequestRateByInterval(ctx context.Context, parameters compute.RequestRateByIntervalInput, location string) (result compute.LogAnalyticsExportRequestRateByIntervalFuture, err error) + ExportThrottledRequests(ctx context.Context, parameters compute.ThrottledRequestsInput, location string) (result compute.LogAnalyticsExportThrottledRequestsFuture, err error) +} + +var _ LogAnalyticsClientAPI = (*compute.LogAnalyticsClient)(nil) + +// VirtualMachineRunCommandsClientAPI contains the set of methods on the VirtualMachineRunCommandsClient type. +type VirtualMachineRunCommandsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand compute.VirtualMachineRunCommand) (result compute.VirtualMachineRunCommandsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (result compute.VirtualMachineRunCommandsDeleteFuture, err error) + Get(ctx context.Context, location string, commandID string) (result compute.RunCommandDocument, err error) + GetByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (result compute.VirtualMachineRunCommand, err error) + List(ctx context.Context, location string) (result compute.RunCommandListResultPage, err error) + ListComplete(ctx context.Context, location string) (result compute.RunCommandListResultIterator, err error) + ListByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, expand string) (result compute.VirtualMachineRunCommandsListResultPage, err error) + ListByVirtualMachineComplete(ctx context.Context, resourceGroupName string, VMName string, expand string) (result compute.VirtualMachineRunCommandsListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand compute.VirtualMachineRunCommandUpdate) (result compute.VirtualMachineRunCommandsUpdateFuture, err error) +} + +var _ VirtualMachineRunCommandsClientAPI = (*compute.VirtualMachineRunCommandsClient)(nil) + +// VirtualMachineScaleSetVMRunCommandsClientAPI contains the set of methods on the VirtualMachineScaleSetVMRunCommandsClient type. +type VirtualMachineScaleSetVMRunCommandsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand compute.VirtualMachineRunCommand) (result compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (result compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (result compute.VirtualMachineRunCommand, err error) + List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineRunCommandsListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result compute.VirtualMachineRunCommandsListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand compute.VirtualMachineRunCommandUpdate) (result compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) +} + +var _ VirtualMachineScaleSetVMRunCommandsClientAPI = (*compute.VirtualMachineScaleSetVMRunCommandsClient)(nil) + +// ResourceSkusClientAPI contains the set of methods on the ResourceSkusClient type. +type ResourceSkusClientAPI interface { + List(ctx context.Context, filter string, includeExtendedLocations string) (result compute.ResourceSkusResultPage, err error) + ListComplete(ctx context.Context, filter string, includeExtendedLocations string) (result compute.ResourceSkusResultIterator, err error) +} + +var _ ResourceSkusClientAPI = (*compute.ResourceSkusClient)(nil) + +// DisksClientAPI contains the set of methods on the DisksClient type. +type DisksClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk compute.Disk) (result compute.DisksCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, diskName string) (result compute.DisksDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, diskName string) (result compute.Disk, err error) + GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData compute.GrantAccessData) (result compute.DisksGrantAccessFuture, err error) + List(ctx context.Context) (result compute.DiskListPage, err error) + ListComplete(ctx context.Context) (result compute.DiskListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.DiskListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.DiskListIterator, err error) + RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result compute.DisksRevokeAccessFuture, err error) + Update(ctx context.Context, resourceGroupName string, diskName string, disk compute.DiskUpdate) (result compute.DisksUpdateFuture, err error) +} + +var _ DisksClientAPI = (*compute.DisksClient)(nil) + +// SnapshotsClientAPI contains the set of methods on the SnapshotsClient type. +type SnapshotsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot compute.Snapshot) (result compute.SnapshotsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result compute.SnapshotsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, snapshotName string) (result compute.Snapshot, err error) + GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData compute.GrantAccessData) (result compute.SnapshotsGrantAccessFuture, err error) + List(ctx context.Context) (result compute.SnapshotListPage, err error) + ListComplete(ctx context.Context) (result compute.SnapshotListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.SnapshotListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.SnapshotListIterator, err error) + RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result compute.SnapshotsRevokeAccessFuture, err error) + Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot compute.SnapshotUpdate) (result compute.SnapshotsUpdateFuture, err error) +} + +var _ SnapshotsClientAPI = (*compute.SnapshotsClient)(nil) + +// DiskEncryptionSetsClientAPI contains the set of methods on the DiskEncryptionSetsClient type. +type DiskEncryptionSetsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet compute.DiskEncryptionSet) (result compute.DiskEncryptionSetsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result compute.DiskEncryptionSetsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result compute.DiskEncryptionSet, err error) + List(ctx context.Context) (result compute.DiskEncryptionSetListPage, err error) + ListComplete(ctx context.Context) (result compute.DiskEncryptionSetListIterator, err error) + ListAssociatedResources(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result compute.ResourceURIListPage, err error) + ListAssociatedResourcesComplete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result compute.ResourceURIListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.DiskEncryptionSetListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.DiskEncryptionSetListIterator, err error) + Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet compute.DiskEncryptionSetUpdate) (result compute.DiskEncryptionSetsUpdateFuture, err error) +} + +var _ DiskEncryptionSetsClientAPI = (*compute.DiskEncryptionSetsClient)(nil) + +// DiskAccessesClientAPI contains the set of methods on the DiskAccessesClient type. +type DiskAccessesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess compute.DiskAccess) (result compute.DiskAccessesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, diskAccessName string) (result compute.DiskAccessesDeleteFuture, err error) + DeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture, err error) + Get(ctx context.Context, resourceGroupName string, diskAccessName string) (result compute.DiskAccess, err error) + GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result compute.PrivateEndpointConnection, err error) + GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string) (result compute.PrivateLinkResourceListResult, err error) + List(ctx context.Context) (result compute.DiskAccessListPage, err error) + ListComplete(ctx context.Context) (result compute.DiskAccessListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.DiskAccessListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.DiskAccessListIterator, err error) + ListPrivateEndpointConnections(ctx context.Context, resourceGroupName string, diskAccessName string) (result compute.PrivateEndpointConnectionListResultPage, err error) + ListPrivateEndpointConnectionsComplete(ctx context.Context, resourceGroupName string, diskAccessName string) (result compute.PrivateEndpointConnectionListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess compute.DiskAccessUpdate) (result compute.DiskAccessesUpdateFuture, err error) + UpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection compute.PrivateEndpointConnection) (result compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture, err error) +} + +var _ DiskAccessesClientAPI = (*compute.DiskAccessesClient)(nil) + +// DiskRestorePointClientAPI contains the set of methods on the DiskRestorePointClient type. +type DiskRestorePointClientAPI interface { + Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result compute.DiskRestorePoint, err error) + GrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string, grantAccessData compute.GrantAccessData) (result compute.DiskRestorePointGrantAccessFuture, err error) + ListByRestorePoint(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result compute.DiskRestorePointListPage, err error) + ListByRestorePointComplete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result compute.DiskRestorePointListIterator, err error) + RevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result compute.DiskRestorePointRevokeAccessFuture, err error) +} + +var _ DiskRestorePointClientAPI = (*compute.DiskRestorePointClient)(nil) + +// GalleriesClientAPI contains the set of methods on the GalleriesClient type. +type GalleriesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery compute.Gallery) (result compute.GalleriesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, galleryName string) (result compute.GalleriesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, galleryName string, selectParameter compute.SelectPermissions) (result compute.Gallery, err error) + List(ctx context.Context) (result compute.GalleryListPage, err error) + ListComplete(ctx context.Context) (result compute.GalleryListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.GalleryListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result compute.GalleryListIterator, err error) + Update(ctx context.Context, resourceGroupName string, galleryName string, gallery compute.GalleryUpdate) (result compute.GalleriesUpdateFuture, err error) +} + +var _ GalleriesClientAPI = (*compute.GalleriesClient)(nil) + +// GalleryImagesClientAPI contains the set of methods on the GalleryImagesClient type. +type GalleryImagesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage compute.GalleryImage) (result compute.GalleryImagesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result compute.GalleryImagesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result compute.GalleryImage, err error) + ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result compute.GalleryImageListPage, err error) + ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result compute.GalleryImageListIterator, err error) + Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage compute.GalleryImageUpdate) (result compute.GalleryImagesUpdateFuture, err error) +} + +var _ GalleryImagesClientAPI = (*compute.GalleryImagesClient)(nil) + +// GalleryImageVersionsClientAPI contains the set of methods on the GalleryImageVersionsClient type. +type GalleryImageVersionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion compute.GalleryImageVersion) (result compute.GalleryImageVersionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (result compute.GalleryImageVersionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand compute.ReplicationStatusTypes) (result compute.GalleryImageVersion, err error) + ListByGalleryImage(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result compute.GalleryImageVersionListPage, err error) + ListByGalleryImageComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result compute.GalleryImageVersionListIterator, err error) + Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion compute.GalleryImageVersionUpdate) (result compute.GalleryImageVersionsUpdateFuture, err error) +} + +var _ GalleryImageVersionsClientAPI = (*compute.GalleryImageVersionsClient)(nil) + +// GalleryApplicationsClientAPI contains the set of methods on the GalleryApplicationsClient type. +type GalleryApplicationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication compute.GalleryApplication) (result compute.GalleryApplicationsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result compute.GalleryApplicationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result compute.GalleryApplication, err error) + ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result compute.GalleryApplicationListPage, err error) + ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result compute.GalleryApplicationListIterator, err error) + Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication compute.GalleryApplicationUpdate) (result compute.GalleryApplicationsUpdateFuture, err error) +} + +var _ GalleryApplicationsClientAPI = (*compute.GalleryApplicationsClient)(nil) + +// GalleryApplicationVersionsClientAPI contains the set of methods on the GalleryApplicationVersionsClient type. +type GalleryApplicationVersionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion compute.GalleryApplicationVersion) (result compute.GalleryApplicationVersionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result compute.GalleryApplicationVersionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand compute.ReplicationStatusTypes) (result compute.GalleryApplicationVersion, err error) + ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result compute.GalleryApplicationVersionListPage, err error) + ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result compute.GalleryApplicationVersionListIterator, err error) + Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion compute.GalleryApplicationVersionUpdate) (result compute.GalleryApplicationVersionsUpdateFuture, err error) +} + +var _ GalleryApplicationVersionsClientAPI = (*compute.GalleryApplicationVersionsClient)(nil) + +// GallerySharingProfileClientAPI contains the set of methods on the GallerySharingProfileClient type. +type GallerySharingProfileClientAPI interface { + Update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate compute.SharingUpdate) (result compute.GallerySharingProfileUpdateFuture, err error) +} + +var _ GallerySharingProfileClientAPI = (*compute.GallerySharingProfileClient)(nil) + +// SharedGalleriesClientAPI contains the set of methods on the SharedGalleriesClient type. +type SharedGalleriesClientAPI interface { + Get(ctx context.Context, location string, galleryUniqueName string) (result compute.SharedGallery, err error) + List(ctx context.Context, location string, sharedTo compute.SharedToValues) (result compute.SharedGalleryListPage, err error) + ListComplete(ctx context.Context, location string, sharedTo compute.SharedToValues) (result compute.SharedGalleryListIterator, err error) +} + +var _ SharedGalleriesClientAPI = (*compute.SharedGalleriesClient)(nil) + +// SharedGalleryImagesClientAPI contains the set of methods on the SharedGalleryImagesClient type. +type SharedGalleryImagesClientAPI interface { + Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string) (result compute.SharedGalleryImage, err error) + List(ctx context.Context, location string, galleryUniqueName string, sharedTo compute.SharedToValues) (result compute.SharedGalleryImageListPage, err error) + ListComplete(ctx context.Context, location string, galleryUniqueName string, sharedTo compute.SharedToValues) (result compute.SharedGalleryImageListIterator, err error) +} + +var _ SharedGalleryImagesClientAPI = (*compute.SharedGalleryImagesClient)(nil) + +// SharedGalleryImageVersionsClientAPI contains the set of methods on the SharedGalleryImageVersionsClient type. +type SharedGalleryImageVersionsClientAPI interface { + Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string) (result compute.SharedGalleryImageVersion, err error) + List(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo compute.SharedToValues) (result compute.SharedGalleryImageVersionListPage, err error) + ListComplete(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo compute.SharedToValues) (result compute.SharedGalleryImageVersionListIterator, err error) +} + +var _ SharedGalleryImageVersionsClientAPI = (*compute.SharedGalleryImageVersionsClient)(nil) + +// CommunityGalleriesClientAPI contains the set of methods on the CommunityGalleriesClient type. +type CommunityGalleriesClientAPI interface { + Get(ctx context.Context, location string, publicGalleryName string) (result compute.CommunityGallery, err error) +} + +var _ CommunityGalleriesClientAPI = (*compute.CommunityGalleriesClient)(nil) + +// CommunityGalleryImagesClientAPI contains the set of methods on the CommunityGalleryImagesClient type. +type CommunityGalleryImagesClientAPI interface { + Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string) (result compute.CommunityGalleryImage, err error) +} + +var _ CommunityGalleryImagesClientAPI = (*compute.CommunityGalleryImagesClient)(nil) + +// CommunityGalleryImageVersionsClientAPI contains the set of methods on the CommunityGalleryImageVersionsClient type. +type CommunityGalleryImageVersionsClientAPI interface { + Get(ctx context.Context, location string, publicGalleryName string, galleryImageName string, galleryImageVersionName string) (result compute.CommunityGalleryImageVersion, err error) +} + +var _ CommunityGalleryImageVersionsClientAPI = (*compute.CommunityGalleryImageVersionsClient)(nil) + +// CloudServiceRoleInstancesClientAPI contains the set of methods on the CloudServiceRoleInstancesClient type. +type CloudServiceRoleInstancesClientAPI interface { + Delete(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceRoleInstancesDeleteFuture, err error) + Get(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, expand compute.InstanceViewTypes) (result compute.RoleInstance, err error) + GetInstanceView(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result compute.RoleInstanceInstanceView, err error) + GetRemoteDesktopFile(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result compute.ReadCloser, err error) + List(ctx context.Context, resourceGroupName string, cloudServiceName string, expand compute.InstanceViewTypes) (result compute.RoleInstanceListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string, expand compute.InstanceViewTypes) (result compute.RoleInstanceListResultIterator, err error) + Rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceRoleInstancesRebuildFuture, err error) + Reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceRoleInstancesReimageFuture, err error) + Restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceRoleInstancesRestartFuture, err error) +} + +var _ CloudServiceRoleInstancesClientAPI = (*compute.CloudServiceRoleInstancesClient)(nil) + +// CloudServiceRolesClientAPI contains the set of methods on the CloudServiceRolesClient type. +type CloudServiceRolesClientAPI interface { + Get(ctx context.Context, roleName string, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceRole, err error) + List(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceRoleListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceRoleListResultIterator, err error) +} + +var _ CloudServiceRolesClientAPI = (*compute.CloudServiceRolesClient)(nil) + +// CloudServicesClientAPI contains the set of methods on the CloudServicesClient type. +type CloudServicesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *compute.CloudService) (result compute.CloudServicesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.CloudServicesDeleteFuture, err error) + DeleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *compute.RoleInstances) (result compute.CloudServicesDeleteInstancesFuture, err error) + Get(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.CloudService, err error) + GetInstanceView(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.CloudServiceInstanceView, err error) + List(ctx context.Context, resourceGroupName string) (result compute.CloudServiceListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result compute.CloudServiceListResultIterator, err error) + ListAll(ctx context.Context) (result compute.CloudServiceListResultPage, err error) + ListAllComplete(ctx context.Context) (result compute.CloudServiceListResultIterator, err error) + PowerOff(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.CloudServicesPowerOffFuture, err error) + Rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *compute.RoleInstances) (result compute.CloudServicesRebuildFuture, err error) + Reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *compute.RoleInstances) (result compute.CloudServicesReimageFuture, err error) + Restart(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *compute.RoleInstances) (result compute.CloudServicesRestartFuture, err error) + Start(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.CloudServicesStartFuture, err error) + Update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters *compute.CloudServiceUpdate) (result compute.CloudServicesUpdateFuture, err error) +} + +var _ CloudServicesClientAPI = (*compute.CloudServicesClient)(nil) + +// CloudServicesUpdateDomainClientAPI contains the set of methods on the CloudServicesUpdateDomainClient type. +type CloudServicesUpdateDomainClientAPI interface { + GetUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32) (result compute.UpdateDomain, err error) + ListUpdateDomains(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.UpdateDomainListResultPage, err error) + ListUpdateDomainsComplete(ctx context.Context, resourceGroupName string, cloudServiceName string) (result compute.UpdateDomainListResultIterator, err error) + WalkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters *compute.UpdateDomain) (result compute.CloudServicesUpdateDomainWalkUpdateDomainFuture, err error) +} + +var _ CloudServicesUpdateDomainClientAPI = (*compute.CloudServicesUpdateDomainClient)(nil) + +// CloudServiceOperatingSystemsClientAPI contains the set of methods on the CloudServiceOperatingSystemsClient type. +type CloudServiceOperatingSystemsClientAPI interface { + GetOSFamily(ctx context.Context, location string, osFamilyName string) (result compute.OSFamily, err error) + GetOSVersion(ctx context.Context, location string, osVersionName string) (result compute.OSVersion, err error) + ListOSFamilies(ctx context.Context, location string) (result compute.OSFamilyListResultPage, err error) + ListOSFamiliesComplete(ctx context.Context, location string) (result compute.OSFamilyListResultIterator, err error) + ListOSVersions(ctx context.Context, location string) (result compute.OSVersionListResultPage, err error) + ListOSVersionsComplete(ctx context.Context, location string) (result compute.OSVersionListResultIterator, err error) +} + +var _ CloudServiceOperatingSystemsClientAPI = (*compute.CloudServiceOperatingSystemsClient)(nil) diff --git a/services/compute/mgmt/2021-08-01/compute/dedicatedhostgroups.go b/services/compute/mgmt/2021-08-01/compute/dedicatedhostgroups.go new file mode 100644 index 000000000000..67ace3df4d8e --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/dedicatedhostgroups.go @@ -0,0 +1,589 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DedicatedHostGroupsClient is the compute Client +type DedicatedHostGroupsClient struct { + BaseClient +} + +// NewDedicatedHostGroupsClient creates an instance of the DedicatedHostGroupsClient client. +func NewDedicatedHostGroupsClient(subscriptionID string) DedicatedHostGroupsClient { + return NewDedicatedHostGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDedicatedHostGroupsClientWithBaseURI creates an instance of the DedicatedHostGroupsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDedicatedHostGroupsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostGroupsClient { + return DedicatedHostGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups +// please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +// parameters - parameters supplied to the Create Dedicated Host Group. +func (client DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (result DedicatedHostGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("compute.DedicatedHostGroupsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DedicatedHostGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DedicatedHostGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a dedicated host group. +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +func (client DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DedicatedHostGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DedicatedHostGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a dedicated host group. +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance +// views of the dedicated hosts under the dedicated host group. 'UserData' is not supported for dedicated host +// group. +func (client DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, expand InstanceViewTypes) (result DedicatedHostGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DedicatedHostGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, expand InstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DedicatedHostGroupsClient) GetResponder(resp *http.Response) (result DedicatedHostGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all of the dedicated host groups in the specified resource group. Use the nextLink +// property in the response to get the next page of dedicated host groups. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.dhglr.Response.Response != nil { + sc = result.dhglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.dhglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.dhglr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DedicatedHostGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DedicatedHostGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client DedicatedHostGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { + req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DedicatedHostGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription lists all of the dedicated host groups in the subscription. Use the nextLink property in the +// response to get the next page of dedicated host groups. +func (client DedicatedHostGroupsClient) ListBySubscription(ctx context.Context) (result DedicatedHostGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.dhglr.Response.Response != nil { + sc = result.dhglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.dhglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.dhglr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client DedicatedHostGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client DedicatedHostGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client DedicatedHostGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { + req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client DedicatedHostGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result DedicatedHostGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update update an dedicated host group. +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +// parameters - parameters supplied to the Update Dedicated Host Group operation. +func (client DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (result DedicatedHostGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DedicatedHostGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DedicatedHostGroupsClient) UpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/dedicatedhosts.go b/services/compute/mgmt/2021-08-01/compute/dedicatedhosts.go new file mode 100644 index 000000000000..a58e6b2b84bb --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/dedicatedhosts.go @@ -0,0 +1,492 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DedicatedHostsClient is the compute Client +type DedicatedHostsClient struct { + BaseClient +} + +// NewDedicatedHostsClient creates an instance of the DedicatedHostsClient client. +func NewDedicatedHostsClient(subscriptionID string) DedicatedHostsClient { + return NewDedicatedHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDedicatedHostsClientWithBaseURI creates an instance of the DedicatedHostsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDedicatedHostsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostsClient { + return DedicatedHostsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a dedicated host . +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +// hostName - the name of the dedicated host . +// parameters - parameters supplied to the Create Dedicated Host. +func (client DedicatedHostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (result DedicatedHostsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + }}, + {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.DedicatedHostsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DedicatedHostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "hostName": autorest.Encode("path", hostName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (future DedicatedHostsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DedicatedHostsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHost, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a dedicated host. +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +// hostName - the name of the dedicated host. +func (client DedicatedHostsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result DedicatedHostsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName, hostName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DedicatedHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "hostName": autorest.Encode("path", hostName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostsClient) DeleteSender(req *http.Request) (future DedicatedHostsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DedicatedHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a dedicated host. +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +// hostName - the name of the dedicated host. +// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance +// views of the dedicated host. 'UserData' is not supported for dedicated host. +func (client DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (result DedicatedHost, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, hostName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DedicatedHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "hostName": autorest.Encode("path", hostName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DedicatedHostsClient) GetResponder(resp *http.Response) (result DedicatedHost, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByHostGroup lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in +// the response to get the next page of dedicated hosts. +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +func (client DedicatedHostsClient) ListByHostGroup(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") + defer func() { + sc := -1 + if result.dhlr.Response.Response != nil { + sc = result.dhlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByHostGroupNextResults + req, err := client.ListByHostGroupPreparer(ctx, resourceGroupName, hostGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByHostGroupSender(req) + if err != nil { + result.dhlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure sending request") + return + } + + result.dhlr, err = client.ListByHostGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure responding to request") + return + } + if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByHostGroupPreparer prepares the ListByHostGroup request. +func (client DedicatedHostsClient) ListByHostGroupPreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByHostGroupSender sends the ListByHostGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostsClient) ListByHostGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByHostGroupResponder handles the response to the ListByHostGroup request. The method always +// closes the http.Response Body. +func (client DedicatedHostsClient) ListByHostGroupResponder(resp *http.Response) (result DedicatedHostListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByHostGroupNextResults retrieves the next set of results, if any. +func (client DedicatedHostsClient) listByHostGroupNextResults(ctx context.Context, lastResults DedicatedHostListResult) (result DedicatedHostListResult, err error) { + req, err := lastResults.dedicatedHostListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByHostGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByHostGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByHostGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DedicatedHostsClient) ListByHostGroupComplete(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByHostGroup(ctx, resourceGroupName, hostGroupName) + return +} + +// Update update an dedicated host . +// Parameters: +// resourceGroupName - the name of the resource group. +// hostGroupName - the name of the dedicated host group. +// hostName - the name of the dedicated host . +// parameters - parameters supplied to the Update Dedicated Host operation. +func (client DedicatedHostsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (result DedicatedHostsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DedicatedHostsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostGroupName": autorest.Encode("path", hostGroupName), + "hostName": autorest.Encode("path", hostName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DedicatedHostsClient) UpdateSender(req *http.Request) (future DedicatedHostsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DedicatedHostsClient) UpdateResponder(resp *http.Response) (result DedicatedHost, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/diskaccesses.go b/services/compute/mgmt/2021-08-01/compute/diskaccesses.go new file mode 100644 index 000000000000..6edf4680774a --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/diskaccesses.go @@ -0,0 +1,1045 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DiskAccessesClient is the compute Client +type DiskAccessesClient struct { + BaseClient +} + +// NewDiskAccessesClient creates an instance of the DiskAccessesClient client. +func NewDiskAccessesClient(subscriptionID string) DiskAccessesClient { + return NewDiskAccessesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDiskAccessesClientWithBaseURI creates an instance of the DiskAccessesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDiskAccessesClientWithBaseURI(baseURI string, subscriptionID string) DiskAccessesClient { + return DiskAccessesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a disk access resource +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +// diskAccess - disk access object supplied in the body of the Put disk access operation. +func (client DiskAccessesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess) (result DiskAccessesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskAccessName, diskAccess) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DiskAccessesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccess) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), + autorest.WithJSON(diskAccess), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) CreateOrUpdateSender(req *http.Request) (future DiskAccessesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) CreateOrUpdateResponder(resp *http.Response) (result DiskAccess, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a disk access resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +func (client DiskAccessesClient) Delete(ctx context.Context, resourceGroupName string, diskAccessName string) (result DiskAccessesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, diskAccessName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DiskAccessesClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) DeleteSender(req *http.Request) (future DiskAccessesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteAPrivateEndpointConnection deletes a private endpoint connection under a disk access resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client DiskAccessesClient) DeleteAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result DiskAccessesDeleteAPrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.DeleteAPrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "DeleteAPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.DeleteAPrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "DeleteAPrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteAPrivateEndpointConnectionPreparer prepares the DeleteAPrivateEndpointConnection request. +func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteAPrivateEndpointConnectionSender sends the DeleteAPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionSender(req *http.Request) (future DiskAccessesDeleteAPrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteAPrivateEndpointConnectionResponder handles the response to the DeleteAPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) DeleteAPrivateEndpointConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets information about a disk access resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +func (client DiskAccessesClient) Get(ctx context.Context, resourceGroupName string, diskAccessName string) (result DiskAccess, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, diskAccessName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DiskAccessesClient) GetPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) GetResponder(resp *http.Response) (result DiskAccess, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAPrivateEndpointConnection gets information about a private endpoint connection under a disk access resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client DiskAccessesClient) GetAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.GetAPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetAPrivateEndpointConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.GetAPrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetAPrivateEndpointConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetAPrivateEndpointConnectionPreparer prepares the GetAPrivateEndpointConnection request. +func (client DiskAccessesClient) GetAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAPrivateEndpointConnectionSender sends the GetAPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) GetAPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAPrivateEndpointConnectionResponder handles the response to the GetAPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) GetAPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateLinkResources gets the private link resources possible under disk access resource +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +func (client DiskAccessesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateLinkResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.GetPrivateLinkResources") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, diskAccessName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "GetPrivateLinkResources", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. +func (client DiskAccessesClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the disk access resources under a subscription. +func (client DiskAccessesClient) List(ctx context.Context) (result DiskAccessListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.List") + defer func() { + sc := -1 + if result.dal.Response.Response != nil { + sc = result.dal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", resp, "Failure sending request") + return + } + + result.dal, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "List", resp, "Failure responding to request") + return + } + if result.dal.hasNextLink() && result.dal.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DiskAccessesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskAccesses", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) ListResponder(resp *http.Response) (result DiskAccessList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DiskAccessesClient) listNextResults(ctx context.Context, lastResults DiskAccessList) (result DiskAccessList, err error) { + req, err := lastResults.diskAccessListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskAccessesClient) ListComplete(ctx context.Context) (result DiskAccessListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the disk access resources under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client DiskAccessesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskAccessListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.dal.Response.Response != nil { + sc = result.dal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.dal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.dal, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dal.hasNextLink() && result.dal.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DiskAccessesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) ListByResourceGroupResponder(resp *http.Response) (result DiskAccessList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client DiskAccessesClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskAccessList) (result DiskAccessList, err error) { + req, err := lastResults.diskAccessListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskAccessesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskAccessListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListPrivateEndpointConnections list information about private endpoint connections under a disk access resource +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +func (client DiskAccessesClient) ListPrivateEndpointConnections(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateEndpointConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListPrivateEndpointConnections") + defer func() { + sc := -1 + if result.peclr.Response.Response != nil { + sc = result.peclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listPrivateEndpointConnectionsNextResults + req, err := client.ListPrivateEndpointConnectionsPreparer(ctx, resourceGroupName, diskAccessName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", nil, "Failure preparing request") + return + } + + resp, err := client.ListPrivateEndpointConnectionsSender(req) + if err != nil { + result.peclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", resp, "Failure sending request") + return + } + + result.peclr, err = client.ListPrivateEndpointConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "ListPrivateEndpointConnections", resp, "Failure responding to request") + return + } + if result.peclr.hasNextLink() && result.peclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPrivateEndpointConnectionsPreparer prepares the ListPrivateEndpointConnections request. +func (client DiskAccessesClient) ListPrivateEndpointConnectionsPreparer(ctx context.Context, resourceGroupName string, diskAccessName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPrivateEndpointConnectionsSender sends the ListPrivateEndpointConnections request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) ListPrivateEndpointConnectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPrivateEndpointConnectionsResponder handles the response to the ListPrivateEndpointConnections request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) ListPrivateEndpointConnectionsResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listPrivateEndpointConnectionsNextResults retrieves the next set of results, if any. +func (client DiskAccessesClient) listPrivateEndpointConnectionsNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { + req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListPrivateEndpointConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListPrivateEndpointConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "listPrivateEndpointConnectionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListPrivateEndpointConnectionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskAccessesClient) ListPrivateEndpointConnectionsComplete(ctx context.Context, resourceGroupName string, diskAccessName string) (result PrivateEndpointConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.ListPrivateEndpointConnections") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListPrivateEndpointConnections(ctx, resourceGroupName, diskAccessName) + return +} + +// Update updates (patches) a disk access resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +// diskAccess - disk access object supplied in the body of the Patch disk access operation. +func (client DiskAccessesClient) Update(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate) (result DiskAccessesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, diskAccessName, diskAccess) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DiskAccessesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskAccessName string, diskAccess DiskAccessUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}", pathParameters), + autorest.WithJSON(diskAccess), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) UpdateSender(req *http.Request) (future DiskAccessesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) UpdateResponder(resp *http.Response) (result DiskAccess, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAPrivateEndpointConnection approve or reject a private endpoint connection under disk access resource, this +// can't be used to create a new private endpoint connection. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskAccessName - the name of the disk access resource that is being created. The name can't be changed after +// the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +// privateEndpointConnectionName - the name of the private endpoint connection. +// privateEndpointConnection - private endpoint connection object supplied in the body of the Put private +// endpoint connection operation. +func (client DiskAccessesClient) UpdateAPrivateEndpointConnection(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (result DiskAccessesUpdateAPrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessesClient.UpdateAPrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: privateEndpointConnection, + Constraints: []validation.Constraint{{Target: "privateEndpointConnection.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "privateEndpointConnection.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", err.Error()) + } + + req, err := client.UpdateAPrivateEndpointConnectionPreparer(ctx, resourceGroupName, diskAccessName, privateEndpointConnectionName, privateEndpointConnection) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.UpdateAPrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesClient", "UpdateAPrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateAPrivateEndpointConnectionPreparer prepares the UpdateAPrivateEndpointConnection request. +func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, diskAccessName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskAccessName": autorest.Encode("path", diskAccessName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + privateEndpointConnection.ID = nil + privateEndpointConnection.Name = nil + privateEndpointConnection.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskAccesses/{diskAccessName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointConnection), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAPrivateEndpointConnectionSender sends the UpdateAPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionSender(req *http.Request) (future DiskAccessesUpdateAPrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateAPrivateEndpointConnectionResponder handles the response to the UpdateAPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client DiskAccessesClient) UpdateAPrivateEndpointConnectionResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/diskencryptionsets.go b/services/compute/mgmt/2021-08-01/compute/diskencryptionsets.go new file mode 100644 index 000000000000..19738c8545ec --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/diskencryptionsets.go @@ -0,0 +1,719 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DiskEncryptionSetsClient is the compute Client +type DiskEncryptionSetsClient struct { + BaseClient +} + +// NewDiskEncryptionSetsClient creates an instance of the DiskEncryptionSetsClient client. +func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { + return NewDiskEncryptionSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDiskEncryptionSetsClientWithBaseURI creates an instance of the DiskEncryptionSetsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { + return DiskEncryptionSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a disk encryption set +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +// diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set +// operation. +func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (result DiskEncryptionSetsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: diskEncryptionSet, + Constraints: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("compute.DiskEncryptionSetsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DiskEncryptionSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), + autorest.WithJSON(diskEncryptionSet), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) (future DiskEncryptionSetsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a disk encryption set. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSetsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, diskEncryptionSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DiskEncryptionSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future DiskEncryptionSetsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DiskEncryptionSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets information about a disk encryption set. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +func (client DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSet, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, diskEncryptionSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DiskEncryptionSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DiskEncryptionSetsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the disk encryption sets under a subscription. +func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEncryptionSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") + defer func() { + sc := -1 + if result.desl.Response.Response != nil { + sc = result.desl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.desl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure sending request") + return + } + + result.desl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") + return + } + if result.desl.hasNextLink() && result.desl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DiskEncryptionSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DiskEncryptionSetsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DiskEncryptionSetsClient) listNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { + req, err := lastResults.diskEncryptionSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskEncryptionSetsClient) ListComplete(ctx context.Context) (result DiskEncryptionSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListAssociatedResources lists all resources that are encrypted with this disk encryption set. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +func (client DiskEncryptionSetsClient) ListAssociatedResources(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result ResourceURIListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListAssociatedResources") + defer func() { + sc := -1 + if result.rul.Response.Response != nil { + sc = result.rul.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAssociatedResourcesNextResults + req, err := client.ListAssociatedResourcesPreparer(ctx, resourceGroupName, diskEncryptionSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", nil, "Failure preparing request") + return + } + + resp, err := client.ListAssociatedResourcesSender(req) + if err != nil { + result.rul.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", resp, "Failure sending request") + return + } + + result.rul, err = client.ListAssociatedResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListAssociatedResources", resp, "Failure responding to request") + return + } + if result.rul.hasNextLink() && result.rul.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAssociatedResourcesPreparer prepares the ListAssociatedResources request. +func (client DiskEncryptionSetsClient) ListAssociatedResourcesPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}/associatedResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAssociatedResourcesSender sends the ListAssociatedResources request. The method will close the +// http.Response Body if it receives an error. +func (client DiskEncryptionSetsClient) ListAssociatedResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAssociatedResourcesResponder handles the response to the ListAssociatedResources request. The method always +// closes the http.Response Body. +func (client DiskEncryptionSetsClient) ListAssociatedResourcesResponder(resp *http.Response) (result ResourceURIList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAssociatedResourcesNextResults retrieves the next set of results, if any. +func (client DiskEncryptionSetsClient) listAssociatedResourcesNextResults(ctx context.Context, lastResults ResourceURIList) (result ResourceURIList, err error) { + req, err := lastResults.resourceURIListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAssociatedResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAssociatedResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listAssociatedResourcesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAssociatedResourcesComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskEncryptionSetsClient) ListAssociatedResourcesComplete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result ResourceURIListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListAssociatedResources") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAssociatedResources(ctx, resourceGroupName, diskEncryptionSetName) + return +} + +// ListByResourceGroup lists all the disk encryption sets under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.desl.Response.Response != nil { + sc = result.desl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.desl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.desl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.desl.hasNextLink() && result.desl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DiskEncryptionSetsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DiskEncryptionSetsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client DiskEncryptionSetsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { + req, err := lastResults.diskEncryptionSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskEncryptionSetsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update updates (patches) a disk encryption set. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed +// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The +// maximum name length is 80 characters. +// diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set +// operation. +func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (result DiskEncryptionSetsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DiskEncryptionSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), + autorest.WithJSON(diskEncryptionSet), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future DiskEncryptionSetsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/diskrestorepoint.go b/services/compute/mgmt/2021-08-01/compute/diskrestorepoint.go new file mode 100644 index 000000000000..56735c4c1c3a --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/diskrestorepoint.go @@ -0,0 +1,407 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DiskRestorePointClient is the compute Client +type DiskRestorePointClient struct { + BaseClient +} + +// NewDiskRestorePointClient creates an instance of the DiskRestorePointClient client. +func NewDiskRestorePointClient(subscriptionID string) DiskRestorePointClient { + return NewDiskRestorePointClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDiskRestorePointClientWithBaseURI creates an instance of the DiskRestorePointClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDiskRestorePointClientWithBaseURI(baseURI string, subscriptionID string) DiskRestorePointClient { + return DiskRestorePointClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get disk restorePoint resource +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. +// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. +// diskRestorePointName - the name of the disk restore point created. +func (client DiskRestorePointClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result DiskRestorePoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DiskRestorePointClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskRestorePointName": autorest.Encode("path", diskRestorePointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmRestorePointName": autorest.Encode("path", VMRestorePointName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DiskRestorePointClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DiskRestorePointClient) GetResponder(resp *http.Response) (result DiskRestorePoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GrantAccess grants access to a diskRestorePoint. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. +// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. +// diskRestorePointName - the name of the disk restore point created. +// grantAccessData - access data object supplied in the body of the get disk access operation. +func (client DiskRestorePointClient) GrantAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData) (result DiskRestorePointGrantAccessFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.GrantAccess") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: grantAccessData, + Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.DiskRestorePointClient", "GrantAccess", err.Error()) + } + + req, err := client.GrantAccessPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName, grantAccessData) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "GrantAccess", nil, "Failure preparing request") + return + } + + result, err = client.GrantAccessSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "GrantAccess", result.Response(), "Failure sending request") + return + } + + return +} + +// GrantAccessPreparer prepares the GrantAccess request. +func (client DiskRestorePointClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string, grantAccessData GrantAccessData) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskRestorePointName": autorest.Encode("path", diskRestorePointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmRestorePointName": autorest.Encode("path", VMRestorePointName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/beginGetAccess", pathParameters), + autorest.WithJSON(grantAccessData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GrantAccessSender sends the GrantAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DiskRestorePointClient) GrantAccessSender(req *http.Request) (future DiskRestorePointGrantAccessFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GrantAccessResponder handles the response to the GrantAccess request. The method always +// closes the http.Response Body. +func (client DiskRestorePointClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByRestorePoint lists diskRestorePoints under a vmRestorePoint. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. +// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. +func (client DiskRestorePointClient) ListByRestorePoint(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result DiskRestorePointListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.ListByRestorePoint") + defer func() { + sc := -1 + if result.drpl.Response.Response != nil { + sc = result.drpl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByRestorePointNextResults + req, err := client.ListByRestorePointPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", nil, "Failure preparing request") + return + } + + resp, err := client.ListByRestorePointSender(req) + if err != nil { + result.drpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", resp, "Failure sending request") + return + } + + result.drpl, err = client.ListByRestorePointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "ListByRestorePoint", resp, "Failure responding to request") + return + } + if result.drpl.hasNextLink() && result.drpl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByRestorePointPreparer prepares the ListByRestorePoint request. +func (client DiskRestorePointClient) ListByRestorePointPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmRestorePointName": autorest.Encode("path", VMRestorePointName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByRestorePointSender sends the ListByRestorePoint request. The method will close the +// http.Response Body if it receives an error. +func (client DiskRestorePointClient) ListByRestorePointSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByRestorePointResponder handles the response to the ListByRestorePoint request. The method always +// closes the http.Response Body. +func (client DiskRestorePointClient) ListByRestorePointResponder(resp *http.Response) (result DiskRestorePointList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByRestorePointNextResults retrieves the next set of results, if any. +func (client DiskRestorePointClient) listByRestorePointNextResults(ctx context.Context, lastResults DiskRestorePointList) (result DiskRestorePointList, err error) { + req, err := lastResults.diskRestorePointListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByRestorePointSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByRestorePointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "listByRestorePointNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByRestorePointComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiskRestorePointClient) ListByRestorePointComplete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string) (result DiskRestorePointListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.ListByRestorePoint") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByRestorePoint(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName) + return +} + +// RevokeAccess revokes access to a diskRestorePoint. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection that the disk restore point belongs. +// VMRestorePointName - the name of the vm restore point that the disk disk restore point belongs. +// diskRestorePointName - the name of the disk restore point created. +func (client DiskRestorePointClient) RevokeAccess(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (result DiskRestorePointRevokeAccessFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointClient.RevokeAccess") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, restorePointCollectionName, VMRestorePointName, diskRestorePointName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "RevokeAccess", nil, "Failure preparing request") + return + } + + result, err = client.RevokeAccessSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointClient", "RevokeAccess", result.Response(), "Failure sending request") + return + } + + return +} + +// RevokeAccessPreparer prepares the RevokeAccess request. +func (client DiskRestorePointClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, VMRestorePointName string, diskRestorePointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskRestorePointName": autorest.Encode("path", diskRestorePointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmRestorePointName": autorest.Encode("path", VMRestorePointName), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{vmRestorePointName}/diskRestorePoints/{diskRestorePointName}/endGetAccess", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevokeAccessSender sends the RevokeAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DiskRestorePointClient) RevokeAccessSender(req *http.Request) (future DiskRestorePointRevokeAccessFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RevokeAccessResponder handles the response to the RevokeAccess request. The method always +// closes the http.Response Body. +func (client DiskRestorePointClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/disks.go b/services/compute/mgmt/2021-08-01/compute/disks.go new file mode 100644 index 000000000000..41b58a2ef3c9 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/disks.go @@ -0,0 +1,779 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DisksClient is the compute Client +type DisksClient struct { + BaseClient +} + +// NewDisksClient creates an instance of the DisksClient client. +func NewDisksClient(subscriptionID string) DisksClient { + return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDisksClientWithBaseURI creates an instance of the DisksClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { + return DisksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a disk. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is +// created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 +// characters. +// disk - disk object supplied in the body of the Put disk operation. +func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: disk, + Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.PurchasePlan", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.PurchasePlan.Publisher", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "disk.DiskProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "disk.DiskProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "disk.DiskProperties.CreationData.GalleryImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.GalleryImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "disk.DiskProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + disk.ManagedBy = nil + disk.ManagedByExtended = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithJSON(disk), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a disk. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is +// created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 +// characters. +func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, diskName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets information about a disk. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is +// created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 +// characters. +func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, diskName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GrantAccess grants access to a disk. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is +// created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 +// characters. +// grantAccessData - access data object supplied in the body of the get disk access operation. +func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: grantAccessData, + Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.DisksClient", "GrantAccess", err.Error()) + } + + req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request") + return + } + + result, err = client.GrantAccessSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request") + return + } + + return +} + +// GrantAccessPreparer prepares the GrantAccess request. +func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters), + autorest.WithJSON(grantAccessData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GrantAccessSender sends the GrantAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GrantAccessResponder handles the response to the GrantAccess request. The method always +// closes the http.Response Body. +func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the disks under a subscription. +func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request") + return + } + + result.dl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") + return + } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { + req, err := lastResults.diskListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the disks under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.dl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client DisksClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { + req, err := lastResults.diskListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// RevokeAccess revokes access to a disk. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is +// created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 +// characters. +func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request") + return + } + + result, err = client.RevokeAccessSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request") + return + } + + return +} + +// RevokeAccessPreparer prepares the RevokeAccess request. +func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevokeAccessSender sends the RevokeAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RevokeAccessResponder handles the response to the RevokeAccess request. The method always +// closes the http.Response Body. +func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates (patches) a disk. +// Parameters: +// resourceGroupName - the name of the resource group. +// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is +// created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 +// characters. +// disk - disk object supplied in the body of the Patch disk operation. +func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithJSON(disk), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/enums.go b/services/compute/mgmt/2021-08-01/compute/enums.go new file mode 100644 index 000000000000..1b467ec4d879 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/enums.go @@ -0,0 +1,2061 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccessLevel enumerates the values for access level. +type AccessLevel string + +const ( + // AccessLevelNone ... + AccessLevelNone AccessLevel = "None" + // AccessLevelRead ... + AccessLevelRead AccessLevel = "Read" + // AccessLevelWrite ... + AccessLevelWrite AccessLevel = "Write" +) + +// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. +func PossibleAccessLevelValues() []AccessLevel { + return []AccessLevel{AccessLevelNone, AccessLevelRead, AccessLevelWrite} +} + +// AggregatedReplicationState enumerates the values for aggregated replication state. +type AggregatedReplicationState string + +const ( + // AggregatedReplicationStateCompleted ... + AggregatedReplicationStateCompleted AggregatedReplicationState = "Completed" + // AggregatedReplicationStateFailed ... + AggregatedReplicationStateFailed AggregatedReplicationState = "Failed" + // AggregatedReplicationStateInProgress ... + AggregatedReplicationStateInProgress AggregatedReplicationState = "InProgress" + // AggregatedReplicationStateUnknown ... + AggregatedReplicationStateUnknown AggregatedReplicationState = "Unknown" +) + +// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. +func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { + return []AggregatedReplicationState{AggregatedReplicationStateCompleted, AggregatedReplicationStateFailed, AggregatedReplicationStateInProgress, AggregatedReplicationStateUnknown} +} + +// AvailabilitySetSkuTypes enumerates the values for availability set sku types. +type AvailabilitySetSkuTypes string + +const ( + // AvailabilitySetSkuTypesAligned ... + AvailabilitySetSkuTypesAligned AvailabilitySetSkuTypes = "Aligned" + // AvailabilitySetSkuTypesClassic ... + AvailabilitySetSkuTypesClassic AvailabilitySetSkuTypes = "Classic" +) + +// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. +func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { + return []AvailabilitySetSkuTypes{AvailabilitySetSkuTypesAligned, AvailabilitySetSkuTypesClassic} +} + +// CachingTypes enumerates the values for caching types. +type CachingTypes string + +const ( + // CachingTypesNone ... + CachingTypesNone CachingTypes = "None" + // CachingTypesReadOnly ... + CachingTypesReadOnly CachingTypes = "ReadOnly" + // CachingTypesReadWrite ... + CachingTypesReadWrite CachingTypes = "ReadWrite" +) + +// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. +func PossibleCachingTypesValues() []CachingTypes { + return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} +} + +// CapacityReservationGroupInstanceViewTypes enumerates the values for capacity reservation group instance view +// types. +type CapacityReservationGroupInstanceViewTypes string + +const ( + // CapacityReservationGroupInstanceViewTypesInstanceView ... + CapacityReservationGroupInstanceViewTypesInstanceView CapacityReservationGroupInstanceViewTypes = "instanceView" +) + +// PossibleCapacityReservationGroupInstanceViewTypesValues returns an array of possible values for the CapacityReservationGroupInstanceViewTypes const type. +func PossibleCapacityReservationGroupInstanceViewTypesValues() []CapacityReservationGroupInstanceViewTypes { + return []CapacityReservationGroupInstanceViewTypes{CapacityReservationGroupInstanceViewTypesInstanceView} +} + +// CapacityReservationInstanceViewTypes enumerates the values for capacity reservation instance view types. +type CapacityReservationInstanceViewTypes string + +const ( + // CapacityReservationInstanceViewTypesInstanceView ... + CapacityReservationInstanceViewTypesInstanceView CapacityReservationInstanceViewTypes = "instanceView" +) + +// PossibleCapacityReservationInstanceViewTypesValues returns an array of possible values for the CapacityReservationInstanceViewTypes const type. +func PossibleCapacityReservationInstanceViewTypesValues() []CapacityReservationInstanceViewTypes { + return []CapacityReservationInstanceViewTypes{CapacityReservationInstanceViewTypesInstanceView} +} + +// CloudServiceUpgradeMode enumerates the values for cloud service upgrade mode. +type CloudServiceUpgradeMode string + +const ( + // CloudServiceUpgradeModeAuto ... + CloudServiceUpgradeModeAuto CloudServiceUpgradeMode = "Auto" + // CloudServiceUpgradeModeManual ... + CloudServiceUpgradeModeManual CloudServiceUpgradeMode = "Manual" + // CloudServiceUpgradeModeSimultaneous ... + CloudServiceUpgradeModeSimultaneous CloudServiceUpgradeMode = "Simultaneous" +) + +// PossibleCloudServiceUpgradeModeValues returns an array of possible values for the CloudServiceUpgradeMode const type. +func PossibleCloudServiceUpgradeModeValues() []CloudServiceUpgradeMode { + return []CloudServiceUpgradeMode{CloudServiceUpgradeModeAuto, CloudServiceUpgradeModeManual, CloudServiceUpgradeModeSimultaneous} +} + +// ComponentNames enumerates the values for component names. +type ComponentNames string + +const ( + // ComponentNamesMicrosoftWindowsShellSetup ... + ComponentNamesMicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" +) + +// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. +func PossibleComponentNamesValues() []ComponentNames { + return []ComponentNames{ComponentNamesMicrosoftWindowsShellSetup} +} + +// ConsistencyModeTypes enumerates the values for consistency mode types. +type ConsistencyModeTypes string + +const ( + // ConsistencyModeTypesApplicationConsistent ... + ConsistencyModeTypesApplicationConsistent ConsistencyModeTypes = "ApplicationConsistent" + // ConsistencyModeTypesCrashConsistent ... + ConsistencyModeTypesCrashConsistent ConsistencyModeTypes = "CrashConsistent" + // ConsistencyModeTypesFileSystemConsistent ... + ConsistencyModeTypesFileSystemConsistent ConsistencyModeTypes = "FileSystemConsistent" +) + +// PossibleConsistencyModeTypesValues returns an array of possible values for the ConsistencyModeTypes const type. +func PossibleConsistencyModeTypesValues() []ConsistencyModeTypes { + return []ConsistencyModeTypes{ConsistencyModeTypesApplicationConsistent, ConsistencyModeTypesCrashConsistent, ConsistencyModeTypesFileSystemConsistent} +} + +// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. +type DedicatedHostLicenseTypes string + +const ( + // DedicatedHostLicenseTypesNone ... + DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" + // DedicatedHostLicenseTypesWindowsServerHybrid ... + DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" + // DedicatedHostLicenseTypesWindowsServerPerpetual ... + DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" +) + +// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. +func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { + return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} +} + +// DeleteOptions enumerates the values for delete options. +type DeleteOptions string + +const ( + // DeleteOptionsDelete ... + DeleteOptionsDelete DeleteOptions = "Delete" + // DeleteOptionsDetach ... + DeleteOptionsDetach DeleteOptions = "Detach" +) + +// PossibleDeleteOptionsValues returns an array of possible values for the DeleteOptions const type. +func PossibleDeleteOptionsValues() []DeleteOptions { + return []DeleteOptions{DeleteOptionsDelete, DeleteOptionsDetach} +} + +// DiffDiskOptions enumerates the values for diff disk options. +type DiffDiskOptions string + +const ( + // DiffDiskOptionsLocal ... + DiffDiskOptionsLocal DiffDiskOptions = "Local" +) + +// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. +func PossibleDiffDiskOptionsValues() []DiffDiskOptions { + return []DiffDiskOptions{DiffDiskOptionsLocal} +} + +// DiffDiskPlacement enumerates the values for diff disk placement. +type DiffDiskPlacement string + +const ( + // DiffDiskPlacementCacheDisk ... + DiffDiskPlacementCacheDisk DiffDiskPlacement = "CacheDisk" + // DiffDiskPlacementResourceDisk ... + DiffDiskPlacementResourceDisk DiffDiskPlacement = "ResourceDisk" +) + +// PossibleDiffDiskPlacementValues returns an array of possible values for the DiffDiskPlacement const type. +func PossibleDiffDiskPlacementValues() []DiffDiskPlacement { + return []DiffDiskPlacement{DiffDiskPlacementCacheDisk, DiffDiskPlacementResourceDisk} +} + +// DiskCreateOption enumerates the values for disk create option. +type DiskCreateOption string + +const ( + // DiskCreateOptionAttach Disk will be attached to a VM. + DiskCreateOptionAttach DiskCreateOption = "Attach" + // DiskCreateOptionCopy Create a new disk or snapshot by copying from a disk or snapshot specified by the + // given sourceResourceId. + DiskCreateOptionCopy DiskCreateOption = "Copy" + // DiskCreateOptionCopyStart Create a new disk by using a deep copy process, where the resource creation is + // considered complete only after all data has been copied from the source. + DiskCreateOptionCopyStart DiskCreateOption = "CopyStart" + // DiskCreateOptionEmpty Create an empty data disk of a size given by diskSizeGB. + DiskCreateOptionEmpty DiskCreateOption = "Empty" + // DiskCreateOptionFromImage Create a new disk from a platform image specified by the given imageReference + // or galleryImageReference. + DiskCreateOptionFromImage DiskCreateOption = "FromImage" + // DiskCreateOptionImport Create a disk by importing from a blob specified by a sourceUri in a storage + // account specified by storageAccountId. + DiskCreateOptionImport DiskCreateOption = "Import" + // DiskCreateOptionImportSecure Similar to Import create option. Create a new Trusted Launch VM or + // Confidential VM supported disk by importing additional blob for VM guest state specified by + // securityDataUri in storage account specified by storageAccountId + DiskCreateOptionImportSecure DiskCreateOption = "ImportSecure" + // DiskCreateOptionRestore Create a new disk by copying from a backup recovery point. + DiskCreateOptionRestore DiskCreateOption = "Restore" + // DiskCreateOptionUpload Create a new disk by obtaining a write token and using it to directly upload the + // contents of the disk. + DiskCreateOptionUpload DiskCreateOption = "Upload" + // DiskCreateOptionUploadPreparedSecure Similar to Upload create option. Create a new Trusted Launch VM or + // Confidential VM supported disk and upload using write token in both disk and VM guest state + DiskCreateOptionUploadPreparedSecure DiskCreateOption = "UploadPreparedSecure" +) + +// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. +func PossibleDiskCreateOptionValues() []DiskCreateOption { + return []DiskCreateOption{DiskCreateOptionAttach, DiskCreateOptionCopy, DiskCreateOptionCopyStart, DiskCreateOptionEmpty, DiskCreateOptionFromImage, DiskCreateOptionImport, DiskCreateOptionImportSecure, DiskCreateOptionRestore, DiskCreateOptionUpload, DiskCreateOptionUploadPreparedSecure} +} + +// DiskCreateOptionTypes enumerates the values for disk create option types. +type DiskCreateOptionTypes string + +const ( + // DiskCreateOptionTypesAttach ... + DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" + // DiskCreateOptionTypesEmpty ... + DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" + // DiskCreateOptionTypesFromImage ... + DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" +) + +// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. +func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { + return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} +} + +// DiskDeleteOptionTypes enumerates the values for disk delete option types. +type DiskDeleteOptionTypes string + +const ( + // DiskDeleteOptionTypesDelete ... + DiskDeleteOptionTypesDelete DiskDeleteOptionTypes = "Delete" + // DiskDeleteOptionTypesDetach ... + DiskDeleteOptionTypesDetach DiskDeleteOptionTypes = "Detach" +) + +// PossibleDiskDeleteOptionTypesValues returns an array of possible values for the DiskDeleteOptionTypes const type. +func PossibleDiskDeleteOptionTypesValues() []DiskDeleteOptionTypes { + return []DiskDeleteOptionTypes{DiskDeleteOptionTypesDelete, DiskDeleteOptionTypesDetach} +} + +// DiskDetachOptionTypes enumerates the values for disk detach option types. +type DiskDetachOptionTypes string + +const ( + // DiskDetachOptionTypesForceDetach ... + DiskDetachOptionTypesForceDetach DiskDetachOptionTypes = "ForceDetach" +) + +// PossibleDiskDetachOptionTypesValues returns an array of possible values for the DiskDetachOptionTypes const type. +func PossibleDiskDetachOptionTypesValues() []DiskDetachOptionTypes { + return []DiskDetachOptionTypes{DiskDetachOptionTypesForceDetach} +} + +// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. +type DiskEncryptionSetIdentityType string + +const ( + // DiskEncryptionSetIdentityTypeNone ... + DiskEncryptionSetIdentityTypeNone DiskEncryptionSetIdentityType = "None" + // DiskEncryptionSetIdentityTypeSystemAssigned ... + DiskEncryptionSetIdentityTypeSystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" +) + +// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. +func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { + return []DiskEncryptionSetIdentityType{DiskEncryptionSetIdentityTypeNone, DiskEncryptionSetIdentityTypeSystemAssigned} +} + +// DiskEncryptionSetType enumerates the values for disk encryption set type. +type DiskEncryptionSetType string + +const ( + // DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey Confidential VM supported disk and VM guest + // state would be encrypted with customer managed key. + DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey DiskEncryptionSetType = "ConfidentialVmEncryptedWithCustomerKey" + // DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey Resource using diskEncryptionSet would be encrypted + // at rest with Customer managed key that can be changed and revoked by a customer. + DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey DiskEncryptionSetType = "EncryptionAtRestWithCustomerKey" + // DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys Resource using diskEncryptionSet would + // be encrypted at rest with two layers of encryption. One of the keys is Customer managed and the other + // key is Platform managed. + DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys DiskEncryptionSetType = "EncryptionAtRestWithPlatformAndCustomerKeys" +) + +// PossibleDiskEncryptionSetTypeValues returns an array of possible values for the DiskEncryptionSetType const type. +func PossibleDiskEncryptionSetTypeValues() []DiskEncryptionSetType { + return []DiskEncryptionSetType{DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey, DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey, DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys} +} + +// DiskSecurityTypes enumerates the values for disk security types. +type DiskSecurityTypes string + +const ( + // DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey Indicates Confidential VM disk with both OS + // disk and VM guest state encrypted with a customer managed key + DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithCustomerKey" + // DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey Indicates Confidential VM disk with both OS + // disk and VM guest state encrypted with a platform managed key + DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_DiskEncryptedWithPlatformKey" + // DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey Indicates Confidential VM disk + // with only VM guest state encrypted + DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey DiskSecurityTypes = "ConfidentialVM_VMGuestStateOnlyEncryptedWithPlatformKey" + // DiskSecurityTypesTrustedLaunch Trusted Launch provides security features such as secure boot and virtual + // Trusted Platform Module (vTPM) + DiskSecurityTypesTrustedLaunch DiskSecurityTypes = "TrustedLaunch" +) + +// PossibleDiskSecurityTypesValues returns an array of possible values for the DiskSecurityTypes const type. +func PossibleDiskSecurityTypesValues() []DiskSecurityTypes { + return []DiskSecurityTypes{DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey, DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey, DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey, DiskSecurityTypesTrustedLaunch} +} + +// DiskState enumerates the values for disk state. +type DiskState string + +const ( + // DiskStateActiveSAS The disk currently has an Active SAS Uri associated with it. + DiskStateActiveSAS DiskState = "ActiveSAS" + // DiskStateActiveSASFrozen The disk is attached to a VM in hibernated state and has an active SAS URI + // associated with it. + DiskStateActiveSASFrozen DiskState = "ActiveSASFrozen" + // DiskStateActiveUpload A disk is created for upload and a write token has been issued for uploading to + // it. + DiskStateActiveUpload DiskState = "ActiveUpload" + // DiskStateAttached The disk is currently attached to a running VM. + DiskStateAttached DiskState = "Attached" + // DiskStateFrozen The disk is attached to a VM which is in hibernated state. + DiskStateFrozen DiskState = "Frozen" + // DiskStateReadyToUpload A disk is ready to be created by upload by requesting a write token. + DiskStateReadyToUpload DiskState = "ReadyToUpload" + // DiskStateReserved The disk is attached to a stopped-deallocated VM. + DiskStateReserved DiskState = "Reserved" + // DiskStateUnattached The disk is not being used and can be attached to a VM. + DiskStateUnattached DiskState = "Unattached" +) + +// PossibleDiskStateValues returns an array of possible values for the DiskState const type. +func PossibleDiskStateValues() []DiskState { + return []DiskState{DiskStateActiveSAS, DiskStateActiveSASFrozen, DiskStateActiveUpload, DiskStateAttached, DiskStateFrozen, DiskStateReadyToUpload, DiskStateReserved, DiskStateUnattached} +} + +// DiskStorageAccountTypes enumerates the values for disk storage account types. +type DiskStorageAccountTypes string + +const ( + // DiskStorageAccountTypesPremiumLRS Premium SSD locally redundant storage. Best for production and + // performance sensitive workloads. + DiskStorageAccountTypesPremiumLRS DiskStorageAccountTypes = "Premium_LRS" + // DiskStorageAccountTypesPremiumZRS Premium SSD zone redundant storage. Best for the production workloads + // that need storage resiliency against zone failures. + DiskStorageAccountTypesPremiumZRS DiskStorageAccountTypes = "Premium_ZRS" + // DiskStorageAccountTypesStandardLRS Standard HDD locally redundant storage. Best for backup, + // non-critical, and infrequent access. + DiskStorageAccountTypesStandardLRS DiskStorageAccountTypes = "Standard_LRS" + // DiskStorageAccountTypesStandardSSDLRS Standard SSD locally redundant storage. Best for web servers, + // lightly used enterprise applications and dev/test. + DiskStorageAccountTypesStandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" + // DiskStorageAccountTypesStandardSSDZRS Standard SSD zone redundant storage. Best for web servers, lightly + // used enterprise applications and dev/test that need storage resiliency against zone failures. + DiskStorageAccountTypesStandardSSDZRS DiskStorageAccountTypes = "StandardSSD_ZRS" + // DiskStorageAccountTypesUltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads + // such as SAP HANA, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. + DiskStorageAccountTypesUltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. +func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { + return []DiskStorageAccountTypes{DiskStorageAccountTypesPremiumLRS, DiskStorageAccountTypesPremiumZRS, DiskStorageAccountTypesStandardLRS, DiskStorageAccountTypesStandardSSDLRS, DiskStorageAccountTypesStandardSSDZRS, DiskStorageAccountTypesUltraSSDLRS} +} + +// EncryptionType enumerates the values for encryption type. +type EncryptionType string + +const ( + // EncryptionTypeEncryptionAtRestWithCustomerKey Disk is encrypted at rest with Customer managed key that + // can be changed and revoked by a customer. + EncryptionTypeEncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" + // EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys Disk is encrypted at rest with 2 layers of + // encryption. One of the keys is Customer managed and the other key is Platform managed. + EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys EncryptionType = "EncryptionAtRestWithPlatformAndCustomerKeys" + // EncryptionTypeEncryptionAtRestWithPlatformKey Disk is encrypted at rest with Platform managed key. It is + // the default encryption type. This is not a valid encryption type for disk encryption sets. + EncryptionTypeEncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" +) + +// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. +func PossibleEncryptionTypeValues() []EncryptionType { + return []EncryptionType{EncryptionTypeEncryptionAtRestWithCustomerKey, EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys, EncryptionTypeEncryptionAtRestWithPlatformKey} +} + +// ExecutionState enumerates the values for execution state. +type ExecutionState string + +const ( + // ExecutionStateCanceled ... + ExecutionStateCanceled ExecutionState = "Canceled" + // ExecutionStateFailed ... + ExecutionStateFailed ExecutionState = "Failed" + // ExecutionStatePending ... + ExecutionStatePending ExecutionState = "Pending" + // ExecutionStateRunning ... + ExecutionStateRunning ExecutionState = "Running" + // ExecutionStateSucceeded ... + ExecutionStateSucceeded ExecutionState = "Succeeded" + // ExecutionStateTimedOut ... + ExecutionStateTimedOut ExecutionState = "TimedOut" + // ExecutionStateUnknown ... + ExecutionStateUnknown ExecutionState = "Unknown" +) + +// PossibleExecutionStateValues returns an array of possible values for the ExecutionState const type. +func PossibleExecutionStateValues() []ExecutionState { + return []ExecutionState{ExecutionStateCanceled, ExecutionStateFailed, ExecutionStatePending, ExecutionStateRunning, ExecutionStateSucceeded, ExecutionStateTimedOut, ExecutionStateUnknown} +} + +// ExpandTypesForGetCapacityReservationGroups enumerates the values for expand types for get capacity +// reservation groups. +type ExpandTypesForGetCapacityReservationGroups string + +const ( + // ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsref ... + ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsref ExpandTypesForGetCapacityReservationGroups = "virtualMachineScaleSetVMs/$ref" + // ExpandTypesForGetCapacityReservationGroupsVirtualMachinesref ... + ExpandTypesForGetCapacityReservationGroupsVirtualMachinesref ExpandTypesForGetCapacityReservationGroups = "virtualMachines/$ref" +) + +// PossibleExpandTypesForGetCapacityReservationGroupsValues returns an array of possible values for the ExpandTypesForGetCapacityReservationGroups const type. +func PossibleExpandTypesForGetCapacityReservationGroupsValues() []ExpandTypesForGetCapacityReservationGroups { + return []ExpandTypesForGetCapacityReservationGroups{ExpandTypesForGetCapacityReservationGroupsVirtualMachineScaleSetVMsref, ExpandTypesForGetCapacityReservationGroupsVirtualMachinesref} +} + +// ExpandTypesForGetVMScaleSets enumerates the values for expand types for get vm scale sets. +type ExpandTypesForGetVMScaleSets string + +const ( + // ExpandTypesForGetVMScaleSetsUserData ... + ExpandTypesForGetVMScaleSetsUserData ExpandTypesForGetVMScaleSets = "userData" +) + +// PossibleExpandTypesForGetVMScaleSetsValues returns an array of possible values for the ExpandTypesForGetVMScaleSets const type. +func PossibleExpandTypesForGetVMScaleSetsValues() []ExpandTypesForGetVMScaleSets { + return []ExpandTypesForGetVMScaleSets{ExpandTypesForGetVMScaleSetsUserData} +} + +// ExtendedLocationType enumerates the values for extended location type. +type ExtendedLocationType string + +const ( + // ExtendedLocationTypeEdgeZone ... + ExtendedLocationTypeEdgeZone ExtendedLocationType = "EdgeZone" +) + +// PossibleExtendedLocationTypeValues returns an array of possible values for the ExtendedLocationType const type. +func PossibleExtendedLocationTypeValues() []ExtendedLocationType { + return []ExtendedLocationType{ExtendedLocationTypeEdgeZone} +} + +// ExtendedLocationTypes enumerates the values for extended location types. +type ExtendedLocationTypes string + +const ( + // ExtendedLocationTypesEdgeZone ... + ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" +) + +// PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type. +func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { + return []ExtendedLocationTypes{ExtendedLocationTypesEdgeZone} +} + +// GallerySharingPermissionTypes enumerates the values for gallery sharing permission types. +type GallerySharingPermissionTypes string + +const ( + // GallerySharingPermissionTypesGroups ... + GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups" + // GallerySharingPermissionTypesPrivate ... + GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private" +) + +// PossibleGallerySharingPermissionTypesValues returns an array of possible values for the GallerySharingPermissionTypes const type. +func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes { + return []GallerySharingPermissionTypes{GallerySharingPermissionTypesGroups, GallerySharingPermissionTypesPrivate} +} + +// HostCaching enumerates the values for host caching. +type HostCaching string + +const ( + // HostCachingNone ... + HostCachingNone HostCaching = "None" + // HostCachingReadOnly ... + HostCachingReadOnly HostCaching = "ReadOnly" + // HostCachingReadWrite ... + HostCachingReadWrite HostCaching = "ReadWrite" +) + +// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. +func PossibleHostCachingValues() []HostCaching { + return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} +} + +// HyperVGeneration enumerates the values for hyper v generation. +type HyperVGeneration string + +const ( + // HyperVGenerationV1 ... + HyperVGenerationV1 HyperVGeneration = "V1" + // HyperVGenerationV2 ... + HyperVGenerationV2 HyperVGeneration = "V2" +) + +// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. +func PossibleHyperVGenerationValues() []HyperVGeneration { + return []HyperVGeneration{HyperVGenerationV1, HyperVGenerationV2} +} + +// HyperVGenerationType enumerates the values for hyper v generation type. +type HyperVGenerationType string + +const ( + // HyperVGenerationTypeV1 ... + HyperVGenerationTypeV1 HyperVGenerationType = "V1" + // HyperVGenerationTypeV2 ... + HyperVGenerationTypeV2 HyperVGenerationType = "V2" +) + +// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. +func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { + return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} +} + +// HyperVGenerationTypes enumerates the values for hyper v generation types. +type HyperVGenerationTypes string + +const ( + // HyperVGenerationTypesV1 ... + HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" + // HyperVGenerationTypesV2 ... + HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" +) + +// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. +func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { + return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} +} + +// InstanceViewTypes enumerates the values for instance view types. +type InstanceViewTypes string + +const ( + // InstanceViewTypesInstanceView ... + InstanceViewTypesInstanceView InstanceViewTypes = "instanceView" + // InstanceViewTypesUserData ... + InstanceViewTypesUserData InstanceViewTypes = "userData" +) + +// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. +func PossibleInstanceViewTypesValues() []InstanceViewTypes { + return []InstanceViewTypes{InstanceViewTypesInstanceView, InstanceViewTypesUserData} +} + +// IntervalInMins enumerates the values for interval in mins. +type IntervalInMins string + +const ( + // IntervalInMinsFiveMins ... + IntervalInMinsFiveMins IntervalInMins = "FiveMins" + // IntervalInMinsSixtyMins ... + IntervalInMinsSixtyMins IntervalInMins = "SixtyMins" + // IntervalInMinsThirtyMins ... + IntervalInMinsThirtyMins IntervalInMins = "ThirtyMins" + // IntervalInMinsThreeMins ... + IntervalInMinsThreeMins IntervalInMins = "ThreeMins" +) + +// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. +func PossibleIntervalInMinsValues() []IntervalInMins { + return []IntervalInMins{IntervalInMinsFiveMins, IntervalInMinsSixtyMins, IntervalInMinsThirtyMins, IntervalInMinsThreeMins} +} + +// IPVersion enumerates the values for ip version. +type IPVersion string + +const ( + // IPVersionIPv4 ... + IPVersionIPv4 IPVersion = "IPv4" + // IPVersionIPv6 ... + IPVersionIPv6 IPVersion = "IPv6" +) + +// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. +func PossibleIPVersionValues() []IPVersion { + return []IPVersion{IPVersionIPv4, IPVersionIPv6} +} + +// IPVersions enumerates the values for ip versions. +type IPVersions string + +const ( + // IPVersionsIPv4 ... + IPVersionsIPv4 IPVersions = "IPv4" + // IPVersionsIPv6 ... + IPVersionsIPv6 IPVersions = "IPv6" +) + +// PossibleIPVersionsValues returns an array of possible values for the IPVersions const type. +func PossibleIPVersionsValues() []IPVersions { + return []IPVersions{IPVersionsIPv4, IPVersionsIPv6} +} + +// LinuxPatchAssessmentMode enumerates the values for linux patch assessment mode. +type LinuxPatchAssessmentMode string + +const ( + // LinuxPatchAssessmentModeAutomaticByPlatform ... + LinuxPatchAssessmentModeAutomaticByPlatform LinuxPatchAssessmentMode = "AutomaticByPlatform" + // LinuxPatchAssessmentModeImageDefault ... + LinuxPatchAssessmentModeImageDefault LinuxPatchAssessmentMode = "ImageDefault" +) + +// PossibleLinuxPatchAssessmentModeValues returns an array of possible values for the LinuxPatchAssessmentMode const type. +func PossibleLinuxPatchAssessmentModeValues() []LinuxPatchAssessmentMode { + return []LinuxPatchAssessmentMode{LinuxPatchAssessmentModeAutomaticByPlatform, LinuxPatchAssessmentModeImageDefault} +} + +// LinuxVMGuestPatchMode enumerates the values for linux vm guest patch mode. +type LinuxVMGuestPatchMode string + +const ( + // LinuxVMGuestPatchModeAutomaticByPlatform ... + LinuxVMGuestPatchModeAutomaticByPlatform LinuxVMGuestPatchMode = "AutomaticByPlatform" + // LinuxVMGuestPatchModeImageDefault ... + LinuxVMGuestPatchModeImageDefault LinuxVMGuestPatchMode = "ImageDefault" +) + +// PossibleLinuxVMGuestPatchModeValues returns an array of possible values for the LinuxVMGuestPatchMode const type. +func PossibleLinuxVMGuestPatchModeValues() []LinuxVMGuestPatchMode { + return []LinuxVMGuestPatchMode{LinuxVMGuestPatchModeAutomaticByPlatform, LinuxVMGuestPatchModeImageDefault} +} + +// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. +type MaintenanceOperationResultCodeTypes string + +const ( + // MaintenanceOperationResultCodeTypesMaintenanceAborted ... + MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" + // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... + MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" + // MaintenanceOperationResultCodeTypesNone ... + MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" + // MaintenanceOperationResultCodeTypesRetryLater ... + MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" +) + +// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. +func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { + return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} +} + +// NetworkAccessPolicy enumerates the values for network access policy. +type NetworkAccessPolicy string + +const ( + // NetworkAccessPolicyAllowAll The disk can be exported or uploaded to from any network. + NetworkAccessPolicyAllowAll NetworkAccessPolicy = "AllowAll" + // NetworkAccessPolicyAllowPrivate The disk can be exported or uploaded to using a DiskAccess resource's + // private endpoints. + NetworkAccessPolicyAllowPrivate NetworkAccessPolicy = "AllowPrivate" + // NetworkAccessPolicyDenyAll The disk cannot be exported. + NetworkAccessPolicyDenyAll NetworkAccessPolicy = "DenyAll" +) + +// PossibleNetworkAccessPolicyValues returns an array of possible values for the NetworkAccessPolicy const type. +func PossibleNetworkAccessPolicyValues() []NetworkAccessPolicy { + return []NetworkAccessPolicy{NetworkAccessPolicyAllowAll, NetworkAccessPolicyAllowPrivate, NetworkAccessPolicyDenyAll} +} + +// NetworkAPIVersion enumerates the values for network api version. +type NetworkAPIVersion string + +const ( + // NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne ... + NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne NetworkAPIVersion = "2020-11-01" +) + +// PossibleNetworkAPIVersionValues returns an array of possible values for the NetworkAPIVersion const type. +func PossibleNetworkAPIVersionValues() []NetworkAPIVersion { + return []NetworkAPIVersion{NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne} +} + +// OperatingSystemStateTypes enumerates the values for operating system state types. +type OperatingSystemStateTypes string + +const ( + // OperatingSystemStateTypesGeneralized Generalized image. Needs to be provisioned during deployment time. + OperatingSystemStateTypesGeneralized OperatingSystemStateTypes = "Generalized" + // OperatingSystemStateTypesSpecialized Specialized image. Contains already provisioned OS Disk. + OperatingSystemStateTypesSpecialized OperatingSystemStateTypes = "Specialized" +) + +// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. +func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { + return []OperatingSystemStateTypes{OperatingSystemStateTypesGeneralized, OperatingSystemStateTypesSpecialized} +} + +// OperatingSystemType enumerates the values for operating system type. +type OperatingSystemType string + +const ( + // OperatingSystemTypeLinux ... + OperatingSystemTypeLinux OperatingSystemType = "Linux" + // OperatingSystemTypeWindows ... + OperatingSystemTypeWindows OperatingSystemType = "Windows" +) + +// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. +func PossibleOperatingSystemTypeValues() []OperatingSystemType { + return []OperatingSystemType{OperatingSystemTypeLinux, OperatingSystemTypeWindows} +} + +// OperatingSystemTypes enumerates the values for operating system types. +type OperatingSystemTypes string + +const ( + // OperatingSystemTypesLinux ... + OperatingSystemTypesLinux OperatingSystemTypes = "Linux" + // OperatingSystemTypesWindows ... + OperatingSystemTypesWindows OperatingSystemTypes = "Windows" +) + +// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. +func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { + return []OperatingSystemTypes{OperatingSystemTypesLinux, OperatingSystemTypesWindows} +} + +// OrchestrationMode enumerates the values for orchestration mode. +type OrchestrationMode string + +const ( + // OrchestrationModeFlexible ... + OrchestrationModeFlexible OrchestrationMode = "Flexible" + // OrchestrationModeUniform ... + OrchestrationModeUniform OrchestrationMode = "Uniform" +) + +// PossibleOrchestrationModeValues returns an array of possible values for the OrchestrationMode const type. +func PossibleOrchestrationModeValues() []OrchestrationMode { + return []OrchestrationMode{OrchestrationModeFlexible, OrchestrationModeUniform} +} + +// OrchestrationServiceNames enumerates the values for orchestration service names. +type OrchestrationServiceNames string + +const ( + // OrchestrationServiceNamesAutomaticRepairs ... + OrchestrationServiceNamesAutomaticRepairs OrchestrationServiceNames = "AutomaticRepairs" +) + +// PossibleOrchestrationServiceNamesValues returns an array of possible values for the OrchestrationServiceNames const type. +func PossibleOrchestrationServiceNamesValues() []OrchestrationServiceNames { + return []OrchestrationServiceNames{OrchestrationServiceNamesAutomaticRepairs} +} + +// OrchestrationServiceState enumerates the values for orchestration service state. +type OrchestrationServiceState string + +const ( + // OrchestrationServiceStateNotRunning ... + OrchestrationServiceStateNotRunning OrchestrationServiceState = "NotRunning" + // OrchestrationServiceStateRunning ... + OrchestrationServiceStateRunning OrchestrationServiceState = "Running" + // OrchestrationServiceStateSuspended ... + OrchestrationServiceStateSuspended OrchestrationServiceState = "Suspended" +) + +// PossibleOrchestrationServiceStateValues returns an array of possible values for the OrchestrationServiceState const type. +func PossibleOrchestrationServiceStateValues() []OrchestrationServiceState { + return []OrchestrationServiceState{OrchestrationServiceStateNotRunning, OrchestrationServiceStateRunning, OrchestrationServiceStateSuspended} +} + +// OrchestrationServiceStateAction enumerates the values for orchestration service state action. +type OrchestrationServiceStateAction string + +const ( + // OrchestrationServiceStateActionResume ... + OrchestrationServiceStateActionResume OrchestrationServiceStateAction = "Resume" + // OrchestrationServiceStateActionSuspend ... + OrchestrationServiceStateActionSuspend OrchestrationServiceStateAction = "Suspend" +) + +// PossibleOrchestrationServiceStateActionValues returns an array of possible values for the OrchestrationServiceStateAction const type. +func PossibleOrchestrationServiceStateActionValues() []OrchestrationServiceStateAction { + return []OrchestrationServiceStateAction{OrchestrationServiceStateActionResume, OrchestrationServiceStateActionSuspend} +} + +// PassNames enumerates the values for pass names. +type PassNames string + +const ( + // PassNamesOobeSystem ... + PassNamesOobeSystem PassNames = "OobeSystem" +) + +// PossiblePassNamesValues returns an array of possible values for the PassNames const type. +func PossiblePassNamesValues() []PassNames { + return []PassNames{PassNamesOobeSystem} +} + +// PatchAssessmentState enumerates the values for patch assessment state. +type PatchAssessmentState string + +const ( + // PatchAssessmentStateAvailable ... + PatchAssessmentStateAvailable PatchAssessmentState = "Available" + // PatchAssessmentStateUnknown ... + PatchAssessmentStateUnknown PatchAssessmentState = "Unknown" +) + +// PossiblePatchAssessmentStateValues returns an array of possible values for the PatchAssessmentState const type. +func PossiblePatchAssessmentStateValues() []PatchAssessmentState { + return []PatchAssessmentState{PatchAssessmentStateAvailable, PatchAssessmentStateUnknown} +} + +// PatchInstallationState enumerates the values for patch installation state. +type PatchInstallationState string + +const ( + // PatchInstallationStateExcluded ... + PatchInstallationStateExcluded PatchInstallationState = "Excluded" + // PatchInstallationStateFailed ... + PatchInstallationStateFailed PatchInstallationState = "Failed" + // PatchInstallationStateInstalled ... + PatchInstallationStateInstalled PatchInstallationState = "Installed" + // PatchInstallationStateNotSelected ... + PatchInstallationStateNotSelected PatchInstallationState = "NotSelected" + // PatchInstallationStatePending ... + PatchInstallationStatePending PatchInstallationState = "Pending" + // PatchInstallationStateUnknown ... + PatchInstallationStateUnknown PatchInstallationState = "Unknown" +) + +// PossiblePatchInstallationStateValues returns an array of possible values for the PatchInstallationState const type. +func PossiblePatchInstallationStateValues() []PatchInstallationState { + return []PatchInstallationState{PatchInstallationStateExcluded, PatchInstallationStateFailed, PatchInstallationStateInstalled, PatchInstallationStateNotSelected, PatchInstallationStatePending, PatchInstallationStateUnknown} +} + +// PatchOperationStatus enumerates the values for patch operation status. +type PatchOperationStatus string + +const ( + // PatchOperationStatusCompletedWithWarnings ... + PatchOperationStatusCompletedWithWarnings PatchOperationStatus = "CompletedWithWarnings" + // PatchOperationStatusFailed ... + PatchOperationStatusFailed PatchOperationStatus = "Failed" + // PatchOperationStatusInProgress ... + PatchOperationStatusInProgress PatchOperationStatus = "InProgress" + // PatchOperationStatusSucceeded ... + PatchOperationStatusSucceeded PatchOperationStatus = "Succeeded" + // PatchOperationStatusUnknown ... + PatchOperationStatusUnknown PatchOperationStatus = "Unknown" +) + +// PossiblePatchOperationStatusValues returns an array of possible values for the PatchOperationStatus const type. +func PossiblePatchOperationStatusValues() []PatchOperationStatus { + return []PatchOperationStatus{PatchOperationStatusCompletedWithWarnings, PatchOperationStatusFailed, PatchOperationStatusInProgress, PatchOperationStatusSucceeded, PatchOperationStatusUnknown} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // PrivateEndpointConnectionProvisioningStateCreating ... + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + // PrivateEndpointConnectionProvisioningStateDeleting ... + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed ... + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateSucceeded ... + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{PrivateEndpointConnectionProvisioningStateCreating, PrivateEndpointConnectionProvisioningStateDeleting, PrivateEndpointConnectionProvisioningStateFailed, PrivateEndpointConnectionProvisioningStateSucceeded} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // PrivateEndpointServiceConnectionStatusApproved ... + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + // 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, PrivateEndpointServiceConnectionStatusPending, PrivateEndpointServiceConnectionStatusRejected} +} + +// ProtocolTypes enumerates the values for protocol types. +type ProtocolTypes string + +const ( + // ProtocolTypesHTTP ... + ProtocolTypesHTTP ProtocolTypes = "Http" + // ProtocolTypesHTTPS ... + ProtocolTypesHTTPS ProtocolTypes = "Https" +) + +// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. +func PossibleProtocolTypesValues() []ProtocolTypes { + return []ProtocolTypes{ProtocolTypesHTTP, ProtocolTypesHTTPS} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateMigrating ... + ProvisioningStateMigrating ProvisioningState = "Migrating" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// ProvisioningState1 enumerates the values for provisioning state 1. +type ProvisioningState1 string + +const ( + // ProvisioningState1Creating ... + ProvisioningState1Creating ProvisioningState1 = "Creating" + // ProvisioningState1Deleting ... + ProvisioningState1Deleting ProvisioningState1 = "Deleting" + // ProvisioningState1Failed ... + ProvisioningState1Failed ProvisioningState1 = "Failed" + // ProvisioningState1Migrating ... + ProvisioningState1Migrating ProvisioningState1 = "Migrating" + // ProvisioningState1Succeeded ... + ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" + // ProvisioningState1Updating ... + ProvisioningState1Updating ProvisioningState1 = "Updating" +) + +// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. +func PossibleProvisioningState1Values() []ProvisioningState1 { + return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} +} + +// ProvisioningState2 enumerates the values for provisioning state 2. +type ProvisioningState2 string + +const ( + // ProvisioningState2Creating ... + ProvisioningState2Creating ProvisioningState2 = "Creating" + // ProvisioningState2Deleting ... + ProvisioningState2Deleting ProvisioningState2 = "Deleting" + // ProvisioningState2Failed ... + ProvisioningState2Failed ProvisioningState2 = "Failed" + // ProvisioningState2Migrating ... + ProvisioningState2Migrating ProvisioningState2 = "Migrating" + // ProvisioningState2Succeeded ... + ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" + // ProvisioningState2Updating ... + ProvisioningState2Updating ProvisioningState2 = "Updating" +) + +// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. +func PossibleProvisioningState2Values() []ProvisioningState2 { + return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} +} + +// ProvisioningState3 enumerates the values for provisioning state 3. +type ProvisioningState3 string + +const ( + // ProvisioningState3Creating ... + ProvisioningState3Creating ProvisioningState3 = "Creating" + // ProvisioningState3Deleting ... + ProvisioningState3Deleting ProvisioningState3 = "Deleting" + // ProvisioningState3Failed ... + ProvisioningState3Failed ProvisioningState3 = "Failed" + // ProvisioningState3Migrating ... + ProvisioningState3Migrating ProvisioningState3 = "Migrating" + // ProvisioningState3Succeeded ... + ProvisioningState3Succeeded ProvisioningState3 = "Succeeded" + // ProvisioningState3Updating ... + ProvisioningState3Updating ProvisioningState3 = "Updating" +) + +// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type. +func PossibleProvisioningState3Values() []ProvisioningState3 { + return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating} +} + +// ProximityPlacementGroupType enumerates the values for proximity placement group type. +type ProximityPlacementGroupType string + +const ( + // ProximityPlacementGroupTypeStandard ... + ProximityPlacementGroupTypeStandard ProximityPlacementGroupType = "Standard" + // ProximityPlacementGroupTypeUltra ... + ProximityPlacementGroupTypeUltra ProximityPlacementGroupType = "Ultra" +) + +// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. +func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { + return []ProximityPlacementGroupType{ProximityPlacementGroupTypeStandard, ProximityPlacementGroupTypeUltra} +} + +// PublicIPAddressSkuName enumerates the values for public ip address sku name. +type PublicIPAddressSkuName string + +const ( + // PublicIPAddressSkuNameBasic ... + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + // PublicIPAddressSkuNameStandard ... + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +// PossiblePublicIPAddressSkuNameValues returns an array of possible values for the PublicIPAddressSkuName const type. +func PossiblePublicIPAddressSkuNameValues() []PublicIPAddressSkuName { + return []PublicIPAddressSkuName{PublicIPAddressSkuNameBasic, PublicIPAddressSkuNameStandard} +} + +// PublicIPAddressSkuTier enumerates the values for public ip address sku tier. +type PublicIPAddressSkuTier string + +const ( + // PublicIPAddressSkuTierGlobal ... + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + // PublicIPAddressSkuTierRegional ... + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +// PossiblePublicIPAddressSkuTierValues returns an array of possible values for the PublicIPAddressSkuTier const type. +func PossiblePublicIPAddressSkuTierValues() []PublicIPAddressSkuTier { + return []PublicIPAddressSkuTier{PublicIPAddressSkuTierGlobal, PublicIPAddressSkuTierRegional} +} + +// PublicIPAllocationMethod enumerates the values for public ip allocation method. +type PublicIPAllocationMethod string + +const ( + // PublicIPAllocationMethodDynamic ... + PublicIPAllocationMethodDynamic PublicIPAllocationMethod = "Dynamic" + // PublicIPAllocationMethodStatic ... + PublicIPAllocationMethodStatic PublicIPAllocationMethod = "Static" +) + +// PossiblePublicIPAllocationMethodValues returns an array of possible values for the PublicIPAllocationMethod const type. +func PossiblePublicIPAllocationMethodValues() []PublicIPAllocationMethod { + return []PublicIPAllocationMethod{PublicIPAllocationMethodDynamic, PublicIPAllocationMethodStatic} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // PublicNetworkAccessDisabled You cannot access the underlying data of the disk publicly on the internet + // even when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI only from your + // trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + // PublicNetworkAccessEnabled You can generate a SAS URI to access the underlying data of the disk publicly + // on the internet when NetworkAccessPolicy is set to AllowAll. You can access the data via the SAS URI + // only from your trusted Azure VNET when NetworkAccessPolicy is set to AllowPrivate. + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} +} + +// ReplicationMode enumerates the values for replication mode. +type ReplicationMode string + +const ( + // ReplicationModeFull ... + ReplicationModeFull ReplicationMode = "Full" + // ReplicationModeShallow ... + ReplicationModeShallow ReplicationMode = "Shallow" +) + +// PossibleReplicationModeValues returns an array of possible values for the ReplicationMode const type. +func PossibleReplicationModeValues() []ReplicationMode { + return []ReplicationMode{ReplicationModeFull, ReplicationModeShallow} +} + +// ReplicationState enumerates the values for replication state. +type ReplicationState string + +const ( + // ReplicationStateCompleted ... + ReplicationStateCompleted ReplicationState = "Completed" + // ReplicationStateFailed ... + ReplicationStateFailed ReplicationState = "Failed" + // ReplicationStateReplicating ... + ReplicationStateReplicating ReplicationState = "Replicating" + // ReplicationStateUnknown ... + ReplicationStateUnknown ReplicationState = "Unknown" +) + +// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. +func PossibleReplicationStateValues() []ReplicationState { + return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} +} + +// ReplicationStatusTypes enumerates the values for replication status types. +type ReplicationStatusTypes string + +const ( + // ReplicationStatusTypesReplicationStatus ... + ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" +) + +// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. +func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { + return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. +type ResourceSkuCapacityScaleType string + +const ( + // ResourceSkuCapacityScaleTypeAutomatic ... + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + // ResourceSkuCapacityScaleTypeManual ... + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + // ResourceSkuCapacityScaleTypeNone ... + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. +func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { + return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} +} + +// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. +type ResourceSkuRestrictionsReasonCode string + +const ( + // ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription ... + ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + // ResourceSkuRestrictionsReasonCodeQuotaID ... + ResourceSkuRestrictionsReasonCodeQuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return []ResourceSkuRestrictionsReasonCode{ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription, ResourceSkuRestrictionsReasonCodeQuotaID} +} + +// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. +type ResourceSkuRestrictionsType string + +const ( + // ResourceSkuRestrictionsTypeLocation ... + ResourceSkuRestrictionsTypeLocation ResourceSkuRestrictionsType = "Location" + // ResourceSkuRestrictionsTypeZone ... + ResourceSkuRestrictionsTypeZone ResourceSkuRestrictionsType = "Zone" +) + +// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return []ResourceSkuRestrictionsType{ResourceSkuRestrictionsTypeLocation, ResourceSkuRestrictionsTypeZone} +} + +// RestorePointCollectionExpandOptions enumerates the values for restore point collection expand options. +type RestorePointCollectionExpandOptions string + +const ( + // RestorePointCollectionExpandOptionsRestorePoints ... + RestorePointCollectionExpandOptionsRestorePoints RestorePointCollectionExpandOptions = "restorePoints" +) + +// PossibleRestorePointCollectionExpandOptionsValues returns an array of possible values for the RestorePointCollectionExpandOptions const type. +func PossibleRestorePointCollectionExpandOptionsValues() []RestorePointCollectionExpandOptions { + return []RestorePointCollectionExpandOptions{RestorePointCollectionExpandOptionsRestorePoints} +} + +// RollingUpgradeActionType enumerates the values for rolling upgrade action type. +type RollingUpgradeActionType string + +const ( + // RollingUpgradeActionTypeCancel ... + RollingUpgradeActionTypeCancel RollingUpgradeActionType = "Cancel" + // RollingUpgradeActionTypeStart ... + RollingUpgradeActionTypeStart RollingUpgradeActionType = "Start" +) + +// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. +func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { + return []RollingUpgradeActionType{RollingUpgradeActionTypeCancel, RollingUpgradeActionTypeStart} +} + +// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. +type RollingUpgradeStatusCode string + +const ( + // RollingUpgradeStatusCodeCancelled ... + RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" + // RollingUpgradeStatusCodeCompleted ... + RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" + // RollingUpgradeStatusCodeFaulted ... + RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" + // RollingUpgradeStatusCodeRollingForward ... + RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" +) + +// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. +func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { + return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} +} + +// SecurityTypes enumerates the values for security types. +type SecurityTypes string + +const ( + // SecurityTypesTrustedLaunch ... + SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" +) + +// PossibleSecurityTypesValues returns an array of possible values for the SecurityTypes const type. +func PossibleSecurityTypesValues() []SecurityTypes { + return []SecurityTypes{SecurityTypesTrustedLaunch} +} + +// SelectPermissions enumerates the values for select permissions. +type SelectPermissions string + +const ( + // SelectPermissionsPermissions ... + SelectPermissionsPermissions SelectPermissions = "Permissions" +) + +// PossibleSelectPermissionsValues returns an array of possible values for the SelectPermissions const type. +func PossibleSelectPermissionsValues() []SelectPermissions { + return []SelectPermissions{SelectPermissionsPermissions} +} + +// SettingNames enumerates the values for setting names. +type SettingNames string + +const ( + // SettingNamesAutoLogon ... + SettingNamesAutoLogon SettingNames = "AutoLogon" + // SettingNamesFirstLogonCommands ... + SettingNamesFirstLogonCommands SettingNames = "FirstLogonCommands" +) + +// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. +func PossibleSettingNamesValues() []SettingNames { + return []SettingNames{SettingNamesAutoLogon, SettingNamesFirstLogonCommands} +} + +// SharedToValues enumerates the values for shared to values. +type SharedToValues string + +const ( + // SharedToValuesTenant ... + SharedToValuesTenant SharedToValues = "tenant" +) + +// PossibleSharedToValuesValues returns an array of possible values for the SharedToValues const type. +func PossibleSharedToValuesValues() []SharedToValues { + return []SharedToValues{SharedToValuesTenant} +} + +// SharingProfileGroupTypes enumerates the values for sharing profile group types. +type SharingProfileGroupTypes string + +const ( + // SharingProfileGroupTypesAADTenants ... + SharingProfileGroupTypesAADTenants SharingProfileGroupTypes = "AADTenants" + // SharingProfileGroupTypesSubscriptions ... + SharingProfileGroupTypesSubscriptions SharingProfileGroupTypes = "Subscriptions" +) + +// PossibleSharingProfileGroupTypesValues returns an array of possible values for the SharingProfileGroupTypes const type. +func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes { + return []SharingProfileGroupTypes{SharingProfileGroupTypesAADTenants, SharingProfileGroupTypesSubscriptions} +} + +// SharingUpdateOperationTypes enumerates the values for sharing update operation types. +type SharingUpdateOperationTypes string + +const ( + // SharingUpdateOperationTypesAdd ... + SharingUpdateOperationTypesAdd SharingUpdateOperationTypes = "Add" + // SharingUpdateOperationTypesRemove ... + SharingUpdateOperationTypesRemove SharingUpdateOperationTypes = "Remove" + // SharingUpdateOperationTypesReset ... + SharingUpdateOperationTypesReset SharingUpdateOperationTypes = "Reset" +) + +// PossibleSharingUpdateOperationTypesValues returns an array of possible values for the SharingUpdateOperationTypes const type. +func PossibleSharingUpdateOperationTypesValues() []SharingUpdateOperationTypes { + return []SharingUpdateOperationTypes{SharingUpdateOperationTypesAdd, SharingUpdateOperationTypesRemove, SharingUpdateOperationTypesReset} +} + +// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. +type SnapshotStorageAccountTypes string + +const ( + // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage + SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" + // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage + SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" + // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage + SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" +) + +// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. +func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { + return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} +} + +// StatusLevelTypes enumerates the values for status level types. +type StatusLevelTypes string + +const ( + // StatusLevelTypesError ... + StatusLevelTypesError StatusLevelTypes = "Error" + // StatusLevelTypesInfo ... + StatusLevelTypesInfo StatusLevelTypes = "Info" + // StatusLevelTypesWarning ... + StatusLevelTypesWarning StatusLevelTypes = "Warning" +) + +// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. +func PossibleStatusLevelTypesValues() []StatusLevelTypes { + return []StatusLevelTypes{StatusLevelTypesError, StatusLevelTypesInfo, StatusLevelTypesWarning} +} + +// StorageAccountType enumerates the values for storage account type. +type StorageAccountType string + +const ( + // StorageAccountTypePremiumLRS ... + StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" + // StorageAccountTypeStandardLRS ... + StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" + // StorageAccountTypeStandardZRS ... + StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" +) + +// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. +func PossibleStorageAccountTypeValues() []StorageAccountType { + return []StorageAccountType{StorageAccountTypePremiumLRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} +} + +// StorageAccountTypes enumerates the values for storage account types. +type StorageAccountTypes string + +const ( + // StorageAccountTypesPremiumLRS ... + StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" + // StorageAccountTypesPremiumZRS ... + StorageAccountTypesPremiumZRS StorageAccountTypes = "Premium_ZRS" + // StorageAccountTypesStandardLRS ... + StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" + // StorageAccountTypesStandardSSDLRS ... + StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" + // StorageAccountTypesStandardSSDZRS ... + StorageAccountTypesStandardSSDZRS StorageAccountTypes = "StandardSSD_ZRS" + // StorageAccountTypesUltraSSDLRS ... + StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" +) + +// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. +func PossibleStorageAccountTypesValues() []StorageAccountTypes { + return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesPremiumZRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesStandardSSDZRS, StorageAccountTypesUltraSSDLRS} +} + +// UpgradeMode enumerates the values for upgrade mode. +type UpgradeMode string + +const ( + // UpgradeModeAutomatic ... + UpgradeModeAutomatic UpgradeMode = "Automatic" + // UpgradeModeManual ... + UpgradeModeManual UpgradeMode = "Manual" + // UpgradeModeRolling ... + UpgradeModeRolling UpgradeMode = "Rolling" +) + +// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. +func PossibleUpgradeModeValues() []UpgradeMode { + return []UpgradeMode{UpgradeModeAutomatic, UpgradeModeManual, UpgradeModeRolling} +} + +// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. +type UpgradeOperationInvoker string + +const ( + // UpgradeOperationInvokerPlatform ... + UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" + // UpgradeOperationInvokerUnknown ... + UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" + // UpgradeOperationInvokerUser ... + UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" +) + +// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. +func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { + return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} +} + +// UpgradeState enumerates the values for upgrade state. +type UpgradeState string + +const ( + // UpgradeStateCancelled ... + UpgradeStateCancelled UpgradeState = "Cancelled" + // UpgradeStateCompleted ... + UpgradeStateCompleted UpgradeState = "Completed" + // UpgradeStateFaulted ... + UpgradeStateFaulted UpgradeState = "Faulted" + // UpgradeStateRollingForward ... + UpgradeStateRollingForward UpgradeState = "RollingForward" +) + +// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. +func PossibleUpgradeStateValues() []UpgradeState { + return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} +} + +// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. +type VirtualMachineEvictionPolicyTypes string + +const ( + // VirtualMachineEvictionPolicyTypesDeallocate ... + VirtualMachineEvictionPolicyTypesDeallocate VirtualMachineEvictionPolicyTypes = "Deallocate" + // VirtualMachineEvictionPolicyTypesDelete ... + VirtualMachineEvictionPolicyTypesDelete VirtualMachineEvictionPolicyTypes = "Delete" +) + +// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. +func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { + return []VirtualMachineEvictionPolicyTypes{VirtualMachineEvictionPolicyTypesDeallocate, VirtualMachineEvictionPolicyTypesDelete} +} + +// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. +type VirtualMachinePriorityTypes string + +const ( + // VirtualMachinePriorityTypesLow ... + VirtualMachinePriorityTypesLow VirtualMachinePriorityTypes = "Low" + // VirtualMachinePriorityTypesRegular ... + VirtualMachinePriorityTypesRegular VirtualMachinePriorityTypes = "Regular" + // VirtualMachinePriorityTypesSpot ... + VirtualMachinePriorityTypesSpot VirtualMachinePriorityTypes = "Spot" +) + +// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. +func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { + return []VirtualMachinePriorityTypes{VirtualMachinePriorityTypesLow, VirtualMachinePriorityTypesRegular, VirtualMachinePriorityTypesSpot} +} + +// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. +type VirtualMachineScaleSetScaleInRules string + +const ( + // VirtualMachineScaleSetScaleInRulesDefault ... + VirtualMachineScaleSetScaleInRulesDefault VirtualMachineScaleSetScaleInRules = "Default" + // VirtualMachineScaleSetScaleInRulesNewestVM ... + VirtualMachineScaleSetScaleInRulesNewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" + // VirtualMachineScaleSetScaleInRulesOldestVM ... + VirtualMachineScaleSetScaleInRulesOldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" +) + +// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. +func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { + return []VirtualMachineScaleSetScaleInRules{VirtualMachineScaleSetScaleInRulesDefault, VirtualMachineScaleSetScaleInRulesNewestVM, VirtualMachineScaleSetScaleInRulesOldestVM} +} + +// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. +type VirtualMachineScaleSetSkuScaleType string + +const ( + // VirtualMachineScaleSetSkuScaleTypeAutomatic ... + VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" + // VirtualMachineScaleSetSkuScaleTypeNone ... + VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" +) + +// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. +func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { + return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} +} + +// VirtualMachineSizeTypes enumerates the values for virtual machine size types. +type VirtualMachineSizeTypes string + +const ( + // VirtualMachineSizeTypesBasicA0 ... + VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" + // VirtualMachineSizeTypesBasicA1 ... + VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" + // VirtualMachineSizeTypesBasicA2 ... + VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" + // VirtualMachineSizeTypesBasicA3 ... + VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" + // VirtualMachineSizeTypesBasicA4 ... + VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" + // VirtualMachineSizeTypesStandardA0 ... + VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" + // VirtualMachineSizeTypesStandardA1 ... + VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" + // VirtualMachineSizeTypesStandardA10 ... + VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" + // VirtualMachineSizeTypesStandardA11 ... + VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" + // VirtualMachineSizeTypesStandardA1V2 ... + VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" + // VirtualMachineSizeTypesStandardA2 ... + VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" + // VirtualMachineSizeTypesStandardA2mV2 ... + VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" + // VirtualMachineSizeTypesStandardA2V2 ... + VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" + // VirtualMachineSizeTypesStandardA3 ... + VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" + // VirtualMachineSizeTypesStandardA4 ... + VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" + // VirtualMachineSizeTypesStandardA4mV2 ... + VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" + // VirtualMachineSizeTypesStandardA4V2 ... + VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" + // VirtualMachineSizeTypesStandardA5 ... + VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" + // VirtualMachineSizeTypesStandardA6 ... + VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" + // VirtualMachineSizeTypesStandardA7 ... + VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" + // VirtualMachineSizeTypesStandardA8 ... + VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" + // VirtualMachineSizeTypesStandardA8mV2 ... + VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" + // VirtualMachineSizeTypesStandardA8V2 ... + VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" + // VirtualMachineSizeTypesStandardA9 ... + VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" + // VirtualMachineSizeTypesStandardB1ms ... + VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" + // VirtualMachineSizeTypesStandardB1s ... + VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" + // VirtualMachineSizeTypesStandardB2ms ... + VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" + // VirtualMachineSizeTypesStandardB2s ... + VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" + // VirtualMachineSizeTypesStandardB4ms ... + VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" + // VirtualMachineSizeTypesStandardB8ms ... + VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" + // VirtualMachineSizeTypesStandardD1 ... + VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" + // VirtualMachineSizeTypesStandardD11 ... + VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" + // VirtualMachineSizeTypesStandardD11V2 ... + VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" + // VirtualMachineSizeTypesStandardD12 ... + VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" + // VirtualMachineSizeTypesStandardD12V2 ... + VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" + // VirtualMachineSizeTypesStandardD13 ... + VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" + // VirtualMachineSizeTypesStandardD13V2 ... + VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" + // VirtualMachineSizeTypesStandardD14 ... + VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" + // VirtualMachineSizeTypesStandardD14V2 ... + VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" + // VirtualMachineSizeTypesStandardD15V2 ... + VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" + // VirtualMachineSizeTypesStandardD16sV3 ... + VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" + // VirtualMachineSizeTypesStandardD16V3 ... + VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" + // VirtualMachineSizeTypesStandardD1V2 ... + VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" + // VirtualMachineSizeTypesStandardD2 ... + VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" + // VirtualMachineSizeTypesStandardD2sV3 ... + VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" + // VirtualMachineSizeTypesStandardD2V2 ... + VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" + // VirtualMachineSizeTypesStandardD2V3 ... + VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" + // VirtualMachineSizeTypesStandardD3 ... + VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" + // VirtualMachineSizeTypesStandardD32sV3 ... + VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" + // VirtualMachineSizeTypesStandardD32V3 ... + VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" + // VirtualMachineSizeTypesStandardD3V2 ... + VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" + // VirtualMachineSizeTypesStandardD4 ... + VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" + // VirtualMachineSizeTypesStandardD4sV3 ... + VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" + // VirtualMachineSizeTypesStandardD4V2 ... + VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" + // VirtualMachineSizeTypesStandardD4V3 ... + VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" + // VirtualMachineSizeTypesStandardD5V2 ... + VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" + // VirtualMachineSizeTypesStandardD64sV3 ... + VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" + // VirtualMachineSizeTypesStandardD64V3 ... + VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" + // VirtualMachineSizeTypesStandardD8sV3 ... + VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" + // VirtualMachineSizeTypesStandardD8V3 ... + VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" + // VirtualMachineSizeTypesStandardDS1 ... + VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" + // VirtualMachineSizeTypesStandardDS11 ... + VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" + // VirtualMachineSizeTypesStandardDS11V2 ... + VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" + // VirtualMachineSizeTypesStandardDS12 ... + VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" + // VirtualMachineSizeTypesStandardDS12V2 ... + VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" + // VirtualMachineSizeTypesStandardDS13 ... + VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" + // VirtualMachineSizeTypesStandardDS132V2 ... + VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" + // VirtualMachineSizeTypesStandardDS134V2 ... + VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" + // VirtualMachineSizeTypesStandardDS13V2 ... + VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" + // VirtualMachineSizeTypesStandardDS14 ... + VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" + // VirtualMachineSizeTypesStandardDS144V2 ... + VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" + // VirtualMachineSizeTypesStandardDS148V2 ... + VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" + // VirtualMachineSizeTypesStandardDS14V2 ... + VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" + // VirtualMachineSizeTypesStandardDS15V2 ... + VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" + // VirtualMachineSizeTypesStandardDS1V2 ... + VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" + // VirtualMachineSizeTypesStandardDS2 ... + VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" + // VirtualMachineSizeTypesStandardDS2V2 ... + VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" + // VirtualMachineSizeTypesStandardDS3 ... + VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" + // VirtualMachineSizeTypesStandardDS3V2 ... + VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" + // VirtualMachineSizeTypesStandardDS4 ... + VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" + // VirtualMachineSizeTypesStandardDS4V2 ... + VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" + // VirtualMachineSizeTypesStandardDS5V2 ... + VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" + // VirtualMachineSizeTypesStandardE16sV3 ... + VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" + // VirtualMachineSizeTypesStandardE16V3 ... + VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" + // VirtualMachineSizeTypesStandardE2sV3 ... + VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" + // VirtualMachineSizeTypesStandardE2V3 ... + VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" + // VirtualMachineSizeTypesStandardE3216V3 ... + VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" + // VirtualMachineSizeTypesStandardE328sV3 ... + VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" + // VirtualMachineSizeTypesStandardE32sV3 ... + VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" + // VirtualMachineSizeTypesStandardE32V3 ... + VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" + // VirtualMachineSizeTypesStandardE4sV3 ... + VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" + // VirtualMachineSizeTypesStandardE4V3 ... + VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" + // VirtualMachineSizeTypesStandardE6416sV3 ... + VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" + // VirtualMachineSizeTypesStandardE6432sV3 ... + VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" + // VirtualMachineSizeTypesStandardE64sV3 ... + VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" + // VirtualMachineSizeTypesStandardE64V3 ... + VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" + // VirtualMachineSizeTypesStandardE8sV3 ... + VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" + // VirtualMachineSizeTypesStandardE8V3 ... + VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" + // VirtualMachineSizeTypesStandardF1 ... + VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" + // VirtualMachineSizeTypesStandardF16 ... + VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" + // VirtualMachineSizeTypesStandardF16s ... + VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" + // VirtualMachineSizeTypesStandardF16sV2 ... + VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" + // VirtualMachineSizeTypesStandardF1s ... + VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" + // VirtualMachineSizeTypesStandardF2 ... + VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" + // VirtualMachineSizeTypesStandardF2s ... + VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" + // VirtualMachineSizeTypesStandardF2sV2 ... + VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" + // VirtualMachineSizeTypesStandardF32sV2 ... + VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" + // VirtualMachineSizeTypesStandardF4 ... + VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" + // VirtualMachineSizeTypesStandardF4s ... + VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" + // VirtualMachineSizeTypesStandardF4sV2 ... + VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" + // VirtualMachineSizeTypesStandardF64sV2 ... + VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" + // VirtualMachineSizeTypesStandardF72sV2 ... + VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" + // VirtualMachineSizeTypesStandardF8 ... + VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" + // VirtualMachineSizeTypesStandardF8s ... + VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" + // VirtualMachineSizeTypesStandardF8sV2 ... + VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" + // VirtualMachineSizeTypesStandardG1 ... + VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" + // VirtualMachineSizeTypesStandardG2 ... + VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" + // VirtualMachineSizeTypesStandardG3 ... + VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" + // VirtualMachineSizeTypesStandardG4 ... + VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" + // VirtualMachineSizeTypesStandardG5 ... + VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" + // VirtualMachineSizeTypesStandardGS1 ... + VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" + // VirtualMachineSizeTypesStandardGS2 ... + VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" + // VirtualMachineSizeTypesStandardGS3 ... + VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" + // VirtualMachineSizeTypesStandardGS4 ... + VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" + // VirtualMachineSizeTypesStandardGS44 ... + VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" + // VirtualMachineSizeTypesStandardGS48 ... + VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" + // VirtualMachineSizeTypesStandardGS5 ... + VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" + // VirtualMachineSizeTypesStandardGS516 ... + VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" + // VirtualMachineSizeTypesStandardGS58 ... + VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" + // VirtualMachineSizeTypesStandardH16 ... + VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" + // VirtualMachineSizeTypesStandardH16m ... + VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" + // VirtualMachineSizeTypesStandardH16mr ... + VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" + // VirtualMachineSizeTypesStandardH16r ... + VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" + // VirtualMachineSizeTypesStandardH8 ... + VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" + // VirtualMachineSizeTypesStandardH8m ... + VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" + // VirtualMachineSizeTypesStandardL16s ... + VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" + // VirtualMachineSizeTypesStandardL32s ... + VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" + // VirtualMachineSizeTypesStandardL4s ... + VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" + // VirtualMachineSizeTypesStandardL8s ... + VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" + // VirtualMachineSizeTypesStandardM12832ms ... + VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" + // VirtualMachineSizeTypesStandardM12864ms ... + VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" + // VirtualMachineSizeTypesStandardM128ms ... + VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" + // VirtualMachineSizeTypesStandardM128s ... + VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" + // VirtualMachineSizeTypesStandardM6416ms ... + VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" + // VirtualMachineSizeTypesStandardM6432ms ... + VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" + // VirtualMachineSizeTypesStandardM64ms ... + VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" + // VirtualMachineSizeTypesStandardM64s ... + VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" + // VirtualMachineSizeTypesStandardNC12 ... + VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" + // VirtualMachineSizeTypesStandardNC12sV2 ... + VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" + // VirtualMachineSizeTypesStandardNC12sV3 ... + VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" + // VirtualMachineSizeTypesStandardNC24 ... + VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" + // VirtualMachineSizeTypesStandardNC24r ... + VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" + // VirtualMachineSizeTypesStandardNC24rsV2 ... + VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" + // VirtualMachineSizeTypesStandardNC24rsV3 ... + VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" + // VirtualMachineSizeTypesStandardNC24sV2 ... + VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" + // VirtualMachineSizeTypesStandardNC24sV3 ... + VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" + // VirtualMachineSizeTypesStandardNC6 ... + VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" + // VirtualMachineSizeTypesStandardNC6sV2 ... + VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" + // VirtualMachineSizeTypesStandardNC6sV3 ... + VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" + // VirtualMachineSizeTypesStandardND12s ... + VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" + // VirtualMachineSizeTypesStandardND24rs ... + VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" + // VirtualMachineSizeTypesStandardND24s ... + VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" + // VirtualMachineSizeTypesStandardND6s ... + VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" + // VirtualMachineSizeTypesStandardNV12 ... + VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" + // VirtualMachineSizeTypesStandardNV24 ... + VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" + // VirtualMachineSizeTypesStandardNV6 ... + VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" +) + +// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. +func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { + return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} +} + +// VMDiskTypes enumerates the values for vm disk types. +type VMDiskTypes string + +const ( + // VMDiskTypesNone ... + VMDiskTypesNone VMDiskTypes = "None" + // VMDiskTypesUnmanaged ... + VMDiskTypesUnmanaged VMDiskTypes = "Unmanaged" +) + +// PossibleVMDiskTypesValues returns an array of possible values for the VMDiskTypes const type. +func PossibleVMDiskTypesValues() []VMDiskTypes { + return []VMDiskTypes{VMDiskTypesNone, VMDiskTypesUnmanaged} +} + +// VMGuestPatchClassificationLinux enumerates the values for vm guest patch classification linux. +type VMGuestPatchClassificationLinux string + +const ( + // VMGuestPatchClassificationLinuxCritical ... + VMGuestPatchClassificationLinuxCritical VMGuestPatchClassificationLinux = "Critical" + // VMGuestPatchClassificationLinuxOther ... + VMGuestPatchClassificationLinuxOther VMGuestPatchClassificationLinux = "Other" + // VMGuestPatchClassificationLinuxSecurity ... + VMGuestPatchClassificationLinuxSecurity VMGuestPatchClassificationLinux = "Security" +) + +// PossibleVMGuestPatchClassificationLinuxValues returns an array of possible values for the VMGuestPatchClassificationLinux const type. +func PossibleVMGuestPatchClassificationLinuxValues() []VMGuestPatchClassificationLinux { + return []VMGuestPatchClassificationLinux{VMGuestPatchClassificationLinuxCritical, VMGuestPatchClassificationLinuxOther, VMGuestPatchClassificationLinuxSecurity} +} + +// VMGuestPatchClassificationWindows enumerates the values for vm guest patch classification windows. +type VMGuestPatchClassificationWindows string + +const ( + // VMGuestPatchClassificationWindowsCritical ... + VMGuestPatchClassificationWindowsCritical VMGuestPatchClassificationWindows = "Critical" + // VMGuestPatchClassificationWindowsDefinition ... + VMGuestPatchClassificationWindowsDefinition VMGuestPatchClassificationWindows = "Definition" + // VMGuestPatchClassificationWindowsFeaturePack ... + VMGuestPatchClassificationWindowsFeaturePack VMGuestPatchClassificationWindows = "FeaturePack" + // VMGuestPatchClassificationWindowsSecurity ... + VMGuestPatchClassificationWindowsSecurity VMGuestPatchClassificationWindows = "Security" + // VMGuestPatchClassificationWindowsServicePack ... + VMGuestPatchClassificationWindowsServicePack VMGuestPatchClassificationWindows = "ServicePack" + // VMGuestPatchClassificationWindowsTools ... + VMGuestPatchClassificationWindowsTools VMGuestPatchClassificationWindows = "Tools" + // VMGuestPatchClassificationWindowsUpdateRollUp ... + VMGuestPatchClassificationWindowsUpdateRollUp VMGuestPatchClassificationWindows = "UpdateRollUp" + // VMGuestPatchClassificationWindowsUpdates ... + VMGuestPatchClassificationWindowsUpdates VMGuestPatchClassificationWindows = "Updates" +) + +// PossibleVMGuestPatchClassificationWindowsValues returns an array of possible values for the VMGuestPatchClassificationWindows const type. +func PossibleVMGuestPatchClassificationWindowsValues() []VMGuestPatchClassificationWindows { + return []VMGuestPatchClassificationWindows{VMGuestPatchClassificationWindowsCritical, VMGuestPatchClassificationWindowsDefinition, VMGuestPatchClassificationWindowsFeaturePack, VMGuestPatchClassificationWindowsSecurity, VMGuestPatchClassificationWindowsServicePack, VMGuestPatchClassificationWindowsTools, VMGuestPatchClassificationWindowsUpdateRollUp, VMGuestPatchClassificationWindowsUpdates} +} + +// VMGuestPatchRebootBehavior enumerates the values for vm guest patch reboot behavior. +type VMGuestPatchRebootBehavior string + +const ( + // VMGuestPatchRebootBehaviorAlwaysRequiresReboot ... + VMGuestPatchRebootBehaviorAlwaysRequiresReboot VMGuestPatchRebootBehavior = "AlwaysRequiresReboot" + // VMGuestPatchRebootBehaviorCanRequestReboot ... + VMGuestPatchRebootBehaviorCanRequestReboot VMGuestPatchRebootBehavior = "CanRequestReboot" + // VMGuestPatchRebootBehaviorNeverReboots ... + VMGuestPatchRebootBehaviorNeverReboots VMGuestPatchRebootBehavior = "NeverReboots" + // VMGuestPatchRebootBehaviorUnknown ... + VMGuestPatchRebootBehaviorUnknown VMGuestPatchRebootBehavior = "Unknown" +) + +// PossibleVMGuestPatchRebootBehaviorValues returns an array of possible values for the VMGuestPatchRebootBehavior const type. +func PossibleVMGuestPatchRebootBehaviorValues() []VMGuestPatchRebootBehavior { + return []VMGuestPatchRebootBehavior{VMGuestPatchRebootBehaviorAlwaysRequiresReboot, VMGuestPatchRebootBehaviorCanRequestReboot, VMGuestPatchRebootBehaviorNeverReboots, VMGuestPatchRebootBehaviorUnknown} +} + +// VMGuestPatchRebootSetting enumerates the values for vm guest patch reboot setting. +type VMGuestPatchRebootSetting string + +const ( + // VMGuestPatchRebootSettingAlways ... + VMGuestPatchRebootSettingAlways VMGuestPatchRebootSetting = "Always" + // VMGuestPatchRebootSettingIfRequired ... + VMGuestPatchRebootSettingIfRequired VMGuestPatchRebootSetting = "IfRequired" + // VMGuestPatchRebootSettingNever ... + VMGuestPatchRebootSettingNever VMGuestPatchRebootSetting = "Never" +) + +// PossibleVMGuestPatchRebootSettingValues returns an array of possible values for the VMGuestPatchRebootSetting const type. +func PossibleVMGuestPatchRebootSettingValues() []VMGuestPatchRebootSetting { + return []VMGuestPatchRebootSetting{VMGuestPatchRebootSettingAlways, VMGuestPatchRebootSettingIfRequired, VMGuestPatchRebootSettingNever} +} + +// VMGuestPatchRebootStatus enumerates the values for vm guest patch reboot status. +type VMGuestPatchRebootStatus string + +const ( + // VMGuestPatchRebootStatusCompleted ... + VMGuestPatchRebootStatusCompleted VMGuestPatchRebootStatus = "Completed" + // VMGuestPatchRebootStatusFailed ... + VMGuestPatchRebootStatusFailed VMGuestPatchRebootStatus = "Failed" + // VMGuestPatchRebootStatusNotNeeded ... + VMGuestPatchRebootStatusNotNeeded VMGuestPatchRebootStatus = "NotNeeded" + // VMGuestPatchRebootStatusRequired ... + VMGuestPatchRebootStatusRequired VMGuestPatchRebootStatus = "Required" + // VMGuestPatchRebootStatusStarted ... + VMGuestPatchRebootStatusStarted VMGuestPatchRebootStatus = "Started" + // VMGuestPatchRebootStatusUnknown ... + VMGuestPatchRebootStatusUnknown VMGuestPatchRebootStatus = "Unknown" +) + +// PossibleVMGuestPatchRebootStatusValues returns an array of possible values for the VMGuestPatchRebootStatus const type. +func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus { + return []VMGuestPatchRebootStatus{VMGuestPatchRebootStatusCompleted, VMGuestPatchRebootStatusFailed, VMGuestPatchRebootStatusNotNeeded, VMGuestPatchRebootStatusRequired, VMGuestPatchRebootStatusStarted, VMGuestPatchRebootStatusUnknown} +} + +// WindowsPatchAssessmentMode enumerates the values for windows patch assessment mode. +type WindowsPatchAssessmentMode string + +const ( + // WindowsPatchAssessmentModeAutomaticByPlatform ... + WindowsPatchAssessmentModeAutomaticByPlatform WindowsPatchAssessmentMode = "AutomaticByPlatform" + // WindowsPatchAssessmentModeImageDefault ... + WindowsPatchAssessmentModeImageDefault WindowsPatchAssessmentMode = "ImageDefault" +) + +// PossibleWindowsPatchAssessmentModeValues returns an array of possible values for the WindowsPatchAssessmentMode const type. +func PossibleWindowsPatchAssessmentModeValues() []WindowsPatchAssessmentMode { + return []WindowsPatchAssessmentMode{WindowsPatchAssessmentModeAutomaticByPlatform, WindowsPatchAssessmentModeImageDefault} +} + +// WindowsVMGuestPatchMode enumerates the values for windows vm guest patch mode. +type WindowsVMGuestPatchMode string + +const ( + // WindowsVMGuestPatchModeAutomaticByOS ... + WindowsVMGuestPatchModeAutomaticByOS WindowsVMGuestPatchMode = "AutomaticByOS" + // WindowsVMGuestPatchModeAutomaticByPlatform ... + WindowsVMGuestPatchModeAutomaticByPlatform WindowsVMGuestPatchMode = "AutomaticByPlatform" + // WindowsVMGuestPatchModeManual ... + WindowsVMGuestPatchModeManual WindowsVMGuestPatchMode = "Manual" +) + +// PossibleWindowsVMGuestPatchModeValues returns an array of possible values for the WindowsVMGuestPatchMode const type. +func PossibleWindowsVMGuestPatchModeValues() []WindowsVMGuestPatchMode { + return []WindowsVMGuestPatchMode{WindowsVMGuestPatchModeAutomaticByOS, WindowsVMGuestPatchModeAutomaticByPlatform, WindowsVMGuestPatchModeManual} +} diff --git a/services/compute/mgmt/2021-08-01/compute/galleries.go b/services/compute/mgmt/2021-08-01/compute/galleries.go new file mode 100644 index 000000000000..9730526f7605 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/galleries.go @@ -0,0 +1,584 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GalleriesClient is the compute Client +type GalleriesClient struct { + BaseClient +} + +// NewGalleriesClient creates an instance of the GalleriesClient client. +func NewGalleriesClient(subscriptionID string) GalleriesClient { + return NewGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGalleriesClientWithBaseURI creates an instance of the GalleriesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGalleriesClientWithBaseURI(baseURI string, subscriptionID string) GalleriesClient { + return GalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a Shared Image Gallery. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with +// dots and periods allowed in the middle. The maximum length is 80 characters. +// gallery - parameters supplied to the create or update Shared Image Gallery operation. +func (client GalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (result GalleriesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, gallery) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GalleriesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), + autorest.WithJSON(gallery), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future GalleriesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a Shared Image Gallery. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery to be deleted. +func (client GalleriesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleriesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GalleriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a Shared Image Gallery. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery. +// selectParameter - the select expression to apply on the operation. +func (client GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, selectParameter SelectPermissions) (result Gallery, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, selectParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client GalleriesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, selectParameter SelectPermissions) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(selectParameter)) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GalleriesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list galleries under a subscription. +func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") + defer func() { + sc := -1 + if result.gl.Response.Response != nil { + sc = result.gl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.gl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure sending request") + return + } + + result.gl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") + return + } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client GalleriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client GalleriesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client GalleriesClient) listNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { + req, err := lastResults.galleryListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client GalleriesClient) ListComplete(ctx context.Context) (result GalleryListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup list galleries under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result GalleryListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.gl.Response.Response != nil { + sc = result.gl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.gl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.gl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.gl.hasNextLink() && result.gl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client GalleriesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client GalleriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client GalleriesClient) listByResourceGroupNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { + req, err := lastResults.galleryListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client GalleriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result GalleryListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update update a Shared Image Gallery. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with +// dots and periods allowed in the middle. The maximum length is 80 characters. +// gallery - parameters supplied to the update Shared Image Gallery operation. +func (client GalleriesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (result GalleriesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, gallery) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GalleriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), + autorest.WithJSON(gallery), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GalleriesClient) UpdateSender(req *http.Request) (future GalleriesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GalleriesClient) UpdateResponder(resp *http.Response) (result Gallery, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/galleryapplications.go b/services/compute/mgmt/2021-08-01/compute/galleryapplications.go new file mode 100644 index 000000000000..f496086291f8 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/galleryapplications.go @@ -0,0 +1,485 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GalleryApplicationsClient is the compute Client +type GalleryApplicationsClient struct { + BaseClient +} + +// NewGalleryApplicationsClient creates an instance of the GalleryApplicationsClient client. +func NewGalleryApplicationsClient(subscriptionID string) GalleryApplicationsClient { + return NewGalleryApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGalleryApplicationsClientWithBaseURI creates an instance of the GalleryApplicationsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewGalleryApplicationsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationsClient { + return GalleryApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a gallery Application Definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be +// created. +// galleryApplicationName - the name of the gallery Application Definition to be created or updated. The +// allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The +// maximum length is 80 characters. +// galleryApplication - parameters supplied to the create or update gallery Application operation. +func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (result GalleryApplicationsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GalleryApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), + autorest.WithJSON(galleryApplication), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a gallery Application. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be +// deleted. +// galleryApplicationName - the name of the gallery Application Definition to be deleted. +func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GalleryApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationsClient) DeleteSender(req *http.Request) (future GalleryApplicationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a gallery Application Definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery from which the Application Definitions are to be +// retrieved. +// galleryApplicationName - the name of the gallery Application Definition to be retrieved. +func (client GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplication, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client GalleryApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByGallery list gallery Application Definitions in a gallery. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery from which Application Definitions are to be +// listed. +func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") + defer func() { + sc := -1 + if result.gal.Response.Response != nil { + sc = result.gal.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByGalleryNextResults + req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", nil, "Failure preparing request") + return + } + + resp, err := client.ListByGallerySender(req) + if err != nil { + result.gal.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure sending request") + return + } + + result.gal, err = client.ListByGalleryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request") + return + } + if result.gal.hasNextLink() && result.gal.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByGalleryPreparer prepares the ListByGallery request. +func (client GalleryApplicationsClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByGallerySender sends the ListByGallery request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByGalleryResponder handles the response to the ListByGallery request. The method always +// closes the http.Response Body. +func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByGalleryNextResults retrieves the next set of results, if any. +func (client GalleryApplicationsClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryApplicationList) (result GalleryApplicationList, err error) { + req, err := lastResults.galleryApplicationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByGallerySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByGalleryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. +func (client GalleryApplicationsClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) + return +} + +// Update update a gallery Application Definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be +// updated. +// galleryApplicationName - the name of the gallery Application Definition to be updated. The allowed +// characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum +// length is 80 characters. +// galleryApplication - parameters supplied to the update gallery Application operation. +func (client GalleryApplicationsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (result GalleryApplicationsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GalleryApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), + autorest.WithJSON(galleryApplication), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationsClient) UpdateSender(req *http.Request) (future GalleryApplicationsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GalleryApplicationsClient) UpdateResponder(resp *http.Response) (result GalleryApplication, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/galleryapplicationversions.go b/services/compute/mgmt/2021-08-01/compute/galleryapplicationversions.go new file mode 100644 index 000000000000..947fae104d74 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/galleryapplicationversions.go @@ -0,0 +1,516 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GalleryApplicationVersionsClient is the compute Client +type GalleryApplicationVersionsClient struct { + BaseClient +} + +// NewGalleryApplicationVersionsClient creates an instance of the GalleryApplicationVersionsClient client. +func NewGalleryApplicationVersionsClient(subscriptionID string) GalleryApplicationVersionsClient { + return NewGalleryApplicationVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGalleryApplicationVersionsClientWithBaseURI creates an instance of the GalleryApplicationVersionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewGalleryApplicationVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationVersionsClient { + return GalleryApplicationVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a gallery Application Version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. +// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is +// to be created. +// galleryApplicationVersionName - the name of the gallery Application Version to be created. Needs to follow +// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range +// of a 32-bit integer. Format: .. +// galleryApplicationVersion - parameters supplied to the create or update gallery Application Version +// operation. +func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (result GalleryApplicationVersionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: galleryApplicationVersion, + Constraints: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.MediaLink", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions.Install", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.ManageActions.Remove", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("compute.GalleryApplicationVersionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), + autorest.WithJSON(galleryApplicationVersion), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationVersionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a gallery Application Version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. +// galleryApplicationName - the name of the gallery Application Definition in which the Application Version +// resides. +// galleryApplicationVersionName - the name of the gallery Application Version to be deleted. +func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result GalleryApplicationVersionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) (future GalleryApplicationVersionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a gallery Application Version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. +// galleryApplicationName - the name of the gallery Application Definition in which the Application Version +// resides. +// galleryApplicationVersionName - the name of the gallery Application Version to be retrieved. +// expand - the expand expression to apply on the operation. +func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (result GalleryApplicationVersion, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationVersionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByGalleryApplication list gallery Application Versions in a gallery Application Definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. +// galleryApplicationName - the name of the Shared Application Gallery Application Definition from which the +// Application Versions are to be listed. +func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") + defer func() { + sc := -1 + if result.gavl.Response.Response != nil { + sc = result.gavl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByGalleryApplicationNextResults + req, err := client.ListByGalleryApplicationPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", nil, "Failure preparing request") + return + } + + resp, err := client.ListByGalleryApplicationSender(req) + if err != nil { + result.gavl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure sending request") + return + } + + result.gavl, err = client.ListByGalleryApplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") + return + } + if result.gavl.hasNextLink() && result.gavl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByGalleryApplicationPreparer prepares the ListByGalleryApplication request. +func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByGalleryApplicationSender sends the ListByGalleryApplication request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByGalleryApplicationResponder handles the response to the ListByGalleryApplication request. The method always +// closes the http.Response Body. +func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByGalleryApplicationNextResults retrieves the next set of results, if any. +func (client GalleryApplicationVersionsClient) listByGalleryApplicationNextResults(ctx context.Context, lastResults GalleryApplicationVersionList) (result GalleryApplicationVersionList, err error) { + req, err := lastResults.galleryApplicationVersionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByGalleryApplicationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByGalleryApplicationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByGalleryApplicationComplete enumerates all values, automatically crossing page boundaries as required. +func (client GalleryApplicationVersionsClient) ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByGalleryApplication(ctx, resourceGroupName, galleryName, galleryApplicationName) + return +} + +// Update update a gallery Application Version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. +// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is +// to be updated. +// galleryApplicationVersionName - the name of the gallery Application Version to be updated. Needs to follow +// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range +// of a 32-bit integer. Format: .. +// galleryApplicationVersion - parameters supplied to the update gallery Application Version operation. +func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (result GalleryApplicationVersionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GalleryApplicationVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryApplicationName": autorest.Encode("path", galleryApplicationName), + "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), + autorest.WithJSON(galleryApplicationVersion), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryApplicationVersionsClient) UpdateSender(req *http.Request) (future GalleryApplicationVersionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/galleryimages.go b/services/compute/mgmt/2021-08-01/compute/galleryimages.go new file mode 100644 index 000000000000..bf16351b3ec6 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/galleryimages.go @@ -0,0 +1,492 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GalleryImagesClient is the compute Client +type GalleryImagesClient struct { + BaseClient +} + +// NewGalleryImagesClient creates an instance of the GalleryImagesClient client. +func NewGalleryImagesClient(subscriptionID string) GalleryImagesClient { + return NewGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGalleryImagesClientWithBaseURI creates an instance of the GalleryImagesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) GalleryImagesClient { + return GalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a gallery image definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be created. +// galleryImageName - the name of the gallery image definition to be created or updated. The allowed characters +// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 +// characters. +// galleryImage - parameters supplied to the create or update gallery image operation. +func (client GalleryImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (result GalleryImagesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: galleryImage, + Constraints: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier.Publisher", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "galleryImage.GalleryImageProperties.Identifier.Offer", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "galleryImage.GalleryImageProperties.Identifier.Sku", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("compute.GalleryImagesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GalleryImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), + autorest.WithJSON(galleryImage), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (future GalleryImagesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a gallery image. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be deleted. +// galleryImageName - the name of the gallery image definition to be deleted. +func (client GalleryImagesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImagesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GalleryImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImagesClient) DeleteSender(req *http.Request) (future GalleryImagesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a gallery image definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery from which the Image Definitions are to be retrieved. +// galleryImageName - the name of the gallery image definition to be retrieved. +func (client GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client GalleryImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByGallery list gallery image definitions in a gallery. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery from which Image Definitions are to be listed. +func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") + defer func() { + sc := -1 + if result.gil.Response.Response != nil { + sc = result.gil.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByGalleryNextResults + req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", nil, "Failure preparing request") + return + } + + resp, err := client.ListByGallerySender(req) + if err != nil { + result.gil.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure sending request") + return + } + + result.gil, err = client.ListByGalleryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") + return + } + if result.gil.hasNextLink() && result.gil.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByGalleryPreparer prepares the ListByGallery request. +func (client GalleryImagesClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByGallerySender sends the ListByGallery request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByGalleryResponder handles the response to the ListByGallery request. The method always +// closes the http.Response Body. +func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByGalleryNextResults retrieves the next set of results, if any. +func (client GalleryImagesClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryImageList) (result GalleryImageList, err error) { + req, err := lastResults.galleryImageListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByGallerySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByGalleryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. +func (client GalleryImagesClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) + return +} + +// Update update a gallery image definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be updated. +// galleryImageName - the name of the gallery image definition to be updated. The allowed characters are +// alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 +// characters. +// galleryImage - parameters supplied to the update gallery image operation. +func (client GalleryImagesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (result GalleryImagesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GalleryImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), + autorest.WithJSON(galleryImage), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImagesClient) UpdateSender(req *http.Request) (future GalleryImagesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GalleryImagesClient) UpdateResponder(resp *http.Response) (result GalleryImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/galleryimageversions.go b/services/compute/mgmt/2021-08-01/compute/galleryimageversions.go new file mode 100644 index 000000000000..0ee7a395b9ea --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/galleryimageversions.go @@ -0,0 +1,503 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GalleryImageVersionsClient is the compute Client +type GalleryImageVersionsClient struct { + BaseClient +} + +// NewGalleryImageVersionsClient creates an instance of the GalleryImageVersionsClient client. +func NewGalleryImageVersionsClient(subscriptionID string) GalleryImageVersionsClient { + return NewGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGalleryImageVersionsClientWithBaseURI creates an instance of the GalleryImageVersionsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryImageVersionsClient { + return GalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a gallery image version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. +// galleryImageName - the name of the gallery image definition in which the Image Version is to be created. +// galleryImageVersionName - the name of the gallery image version to be created. Needs to follow semantic +// version name pattern: The allowed characters are digit and period. Digits must be within the range of a +// 32-bit integer. Format: .. +// galleryImageVersion - parameters supplied to the create or update gallery image version operation. +func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (result GalleryImageVersionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: galleryImageVersion, + Constraints: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("compute.GalleryImageVersionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GalleryImageVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), + autorest.WithJSON(galleryImageVersion), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryImageVersionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a gallery image version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. +// galleryImageName - the name of the gallery image definition in which the Image Version resides. +// galleryImageVersionName - the name of the gallery image version to be deleted. +func (client GalleryImageVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (result GalleryImageVersionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GalleryImageVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future GalleryImageVersionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a gallery image version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. +// galleryImageName - the name of the gallery image definition in which the Image Version resides. +// galleryImageVersionName - the name of the gallery image version to be retrieved. +// expand - the expand expression to apply on the operation. +func (client GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (result GalleryImageVersion, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client GalleryImageVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByGalleryImage list gallery image versions in a gallery image definition. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. +// galleryImageName - the name of the Shared Image Gallery Image Definition from which the Image Versions are +// to be listed. +func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") + defer func() { + sc := -1 + if result.givl.Response.Response != nil { + sc = result.givl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByGalleryImageNextResults + req, err := client.ListByGalleryImagePreparer(ctx, resourceGroupName, galleryName, galleryImageName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", nil, "Failure preparing request") + return + } + + resp, err := client.ListByGalleryImageSender(req) + if err != nil { + result.givl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure sending request") + return + } + + result.givl, err = client.ListByGalleryImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") + return + } + if result.givl.hasNextLink() && result.givl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByGalleryImagePreparer prepares the ListByGalleryImage request. +func (client GalleryImageVersionsClient) ListByGalleryImagePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByGalleryImageSender sends the ListByGalleryImage request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByGalleryImageResponder handles the response to the ListByGalleryImage request. The method always +// closes the http.Response Body. +func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByGalleryImageNextResults retrieves the next set of results, if any. +func (client GalleryImageVersionsClient) listByGalleryImageNextResults(ctx context.Context, lastResults GalleryImageVersionList) (result GalleryImageVersionList, err error) { + req, err := lastResults.galleryImageVersionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByGalleryImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByGalleryImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByGalleryImageComplete enumerates all values, automatically crossing page boundaries as required. +func (client GalleryImageVersionsClient) ListByGalleryImageComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByGalleryImage(ctx, resourceGroupName, galleryName, galleryImageName) + return +} + +// Update update a gallery image version. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. +// galleryImageName - the name of the gallery image definition in which the Image Version is to be updated. +// galleryImageVersionName - the name of the gallery image version to be updated. Needs to follow semantic +// version name pattern: The allowed characters are digit and period. Digits must be within the range of a +// 32-bit integer. Format: .. +// galleryImageVersion - parameters supplied to the update gallery image version operation. +func (client GalleryImageVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (result GalleryImageVersionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GalleryImageVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), + autorest.WithJSON(galleryImageVersion), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GalleryImageVersionsClient) UpdateSender(req *http.Request) (future GalleryImageVersionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GalleryImageVersionsClient) UpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/gallerysharingprofile.go b/services/compute/mgmt/2021-08-01/compute/gallerysharingprofile.go new file mode 100644 index 000000000000..eab53278bb40 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/gallerysharingprofile.go @@ -0,0 +1,114 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GallerySharingProfileClient is the compute Client +type GallerySharingProfileClient struct { + BaseClient +} + +// NewGallerySharingProfileClient creates an instance of the GallerySharingProfileClient client. +func NewGallerySharingProfileClient(subscriptionID string) GallerySharingProfileClient { + return NewGallerySharingProfileClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGallerySharingProfileClientWithBaseURI creates an instance of the GallerySharingProfileClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewGallerySharingProfileClientWithBaseURI(baseURI string, subscriptionID string) GallerySharingProfileClient { + return GallerySharingProfileClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Update update sharing profile of a gallery. +// Parameters: +// resourceGroupName - the name of the resource group. +// galleryName - the name of the Shared Image Gallery. +// sharingUpdate - parameters supplied to the update gallery sharing profile. +func (client GallerySharingProfileClient) Update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate) (result GallerySharingProfileUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GallerySharingProfileClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, sharingUpdate) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GallerySharingProfileClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryName": autorest.Encode("path", galleryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/share", pathParameters), + autorest.WithJSON(sharingUpdate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GallerySharingProfileClient) UpdateSender(req *http.Request) (future GallerySharingProfileUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GallerySharingProfileClient) UpdateResponder(resp *http.Response) (result SharingUpdate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/images.go b/services/compute/mgmt/2021-08-01/compute/images.go new file mode 100644 index 000000000000..66a9bcbd0c44 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/images.go @@ -0,0 +1,583 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ImagesClient is the compute Client +type ImagesClient struct { + BaseClient +} + +// NewImagesClient creates an instance of the ImagesClient client. +func NewImagesClient(subscriptionID string) ImagesClient { + return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { + return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update an image. +// Parameters: +// resourceGroupName - the name of the resource group. +// imageName - the name of the image. +// parameters - parameters supplied to the Create Image operation. +func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an Image. +// Parameters: +// resourceGroupName - the name of the resource group. +// imageName - the name of the image. +func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, imageName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an image. +// Parameters: +// resourceGroupName - the name of the resource group. +// imageName - the name of the image. +// expand - the expand expression to apply on the operation. +func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of +// Images. Do this till nextLink is null to fetch all the Images. +func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") + defer func() { + sc := -1 + if result.ilr.Response.Response != nil { + sc = result.ilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request") + return + } + + result.ilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ImagesClient) listNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { + req, err := lastResults.imageListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup gets the list of images under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ilr.Response.Response != nil { + sc = result.ilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ilr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ilr.hasNextLink() && result.ilr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ImagesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { + req, err := lastResults.imageListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update update an image. +// Parameters: +// resourceGroupName - the name of the resource group. +// imageName - the name of the image. +// parameters - parameters supplied to the Update Image operation. +func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, imageName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/loganalytics.go b/services/compute/mgmt/2021-08-01/compute/loganalytics.go new file mode 100644 index 000000000000..ec30f9cc8c61 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/loganalytics.go @@ -0,0 +1,206 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LogAnalyticsClient is the compute Client +type LogAnalyticsClient struct { + BaseClient +} + +// NewLogAnalyticsClient creates an instance of the LogAnalyticsClient client. +func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient { + return NewLogAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLogAnalyticsClientWithBaseURI creates an instance of the LogAnalyticsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient { + return LogAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to +// show throttling activities. +// Parameters: +// parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api. +// location - the location upon which virtual-machine-sizes is queried. +func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportRequestRateByInterval") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error()) + } + + req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure preparing request") + return + } + + result, err = client.ExportRequestRateByIntervalSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportRequestRateByIntervalPreparer prepares the ExportRequestRateByInterval request. +func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context.Context, parameters RequestRateByIntervalInput, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the +// http.Response Body if it receives an error. +func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportRequestRateByIntervalResponder handles the response to the ExportRequestRateByInterval request. The method always +// closes the http.Response Body. +func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time +// window. +// Parameters: +// parameters - parameters supplied to the LogAnalytics getThrottledRequests Api. +// location - the location upon which virtual-machine-sizes is queried. +func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportThrottledRequests") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error()) + } + + req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure preparing request") + return + } + + result, err = client.ExportThrottledRequestsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request") + return + } + + return +} + +// ExportThrottledRequestsPreparer prepares the ExportThrottledRequests request. +func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Context, parameters ThrottledRequestsInput, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the +// http.Response Body if it receives an error. +func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExportThrottledRequestsResponder handles the response to the ExportThrottledRequests request. The method always +// closes the http.Response Body. +func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/models.go b/services/compute/mgmt/2021-08-01/compute/models.go new file mode 100644 index 000000000000..6092674e5e10 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/models.go @@ -0,0 +1,23435 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "io" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-08-01/compute" + +// AccessURI a disk access SAS uri. +type AccessURI struct { + autorest.Response `json:"-"` + // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. + AccessSAS *string `json:"accessSAS,omitempty"` + // SecurityDataAccessSAS - READ-ONLY; A SAS uri for accessing a VM guest state. + SecurityDataAccessSAS *string `json:"securityDataAccessSAS,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccessURI. +func (au AccessURI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale +// set. +type AdditionalCapabilities struct { + // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. + UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` + // HibernationEnabled - The flag that enables or disables hibernation capability on the VM. + HibernationEnabled *bool `json:"hibernationEnabled,omitempty"` +} + +// AdditionalUnattendContent specifies additional XML formatted information that can be included in the +// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, +// and the pass in which the content is applied. +type AdditionalUnattendContent struct { + // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'PassNamesOobeSystem' + PassName PassNames `json:"passName,omitempty"` + // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'ComponentNamesMicrosoftWindowsShellSetup' + ComponentName ComponentNames `json:"componentName,omitempty"` + // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'SettingNamesAutoLogon', 'SettingNamesFirstLogonCommands' + SettingName SettingNames `json:"settingName,omitempty"` + // Content - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. + Content *string `json:"content,omitempty"` +} + +// APIEntityReference the API entity reference. +type APIEntityReference struct { + // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + ID *string `json:"id,omitempty"` +} + +// APIError api error. +type APIError struct { + // Details - The Api error details + Details *[]APIErrorBase `json:"details,omitempty"` + // Innererror - The Api inner error + Innererror *InnerError `json:"innererror,omitempty"` + // Code - The error code. + Code *string `json:"code,omitempty"` + // Target - The target of the particular error. + Target *string `json:"target,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` +} + +// APIErrorBase api error base. +type APIErrorBase struct { + // Code - The error code. + Code *string `json:"code,omitempty"` + // Target - The target of the particular error. + Target *string `json:"target,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` +} + +// ApplicationProfile contains the list of gallery applications that should be made available to the +// VM/VMSS +type ApplicationProfile struct { + // GalleryApplications - Specifies the gallery applications that should be made available to the VM/VMSS + GalleryApplications *[]VMGalleryApplication `json:"galleryApplications,omitempty"` +} + +// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. +type AutomaticOSUpgradePolicy struct { + // EnableAutomaticOSUpgrade - Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false.

If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. + EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` + // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. + DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` +} + +// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. +type AutomaticOSUpgradeProperties struct { + // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. + AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` +} + +// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual +// machine scale set. +type AutomaticRepairsPolicy struct { + // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. + Enabled *bool `json:"enabled,omitempty"` + // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). + GracePeriod *string `json:"gracePeriod,omitempty"` +} + +// AvailabilitySet specifies information about the availability set that the virtual machine should be +// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to +// maximize availability. For more information about availability sets, see [Availability sets +// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).

For +// more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in +// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)

Currently, a +// VM can only be added to availability set at creation time. An existing VM cannot be added to an +// availability set. +type AvailabilitySet struct { + autorest.Response `json:"-"` + *AvailabilitySetProperties `json:"properties,omitempty"` + // Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. + Sku *Sku `json:"sku,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AvailabilitySet. +func (as AvailabilitySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if as.AvailabilitySetProperties != nil { + objectMap["properties"] = as.AvailabilitySetProperties + } + if as.Sku != nil { + objectMap["sku"] = as.Sku + } + if as.Location != nil { + objectMap["location"] = as.Location + } + if as.Tags != nil { + objectMap["tags"] = as.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. +func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var availabilitySetProperties AvailabilitySetProperties + err = json.Unmarshal(*v, &availabilitySetProperties) + if err != nil { + return err + } + as.AvailabilitySetProperties = &availabilitySetProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + as.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + as.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + as.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + as.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + as.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + as.Tags = tags + } + } + } + + return nil +} + +// AvailabilitySetListResult the List Availability Set operation response. +type AvailabilitySetListResult struct { + autorest.Response `json:"-"` + // Value - The list of availability sets + Value *[]AvailabilitySet `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. + NextLink *string `json:"nextLink,omitempty"` +} + +// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. +type AvailabilitySetListResultIterator struct { + i int + page AvailabilitySetListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AvailabilitySetListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AvailabilitySetListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { + if !iter.page.NotDone() { + return AvailabilitySet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AvailabilitySetListResultIterator type. +func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { + return AvailabilitySetListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aslr AvailabilitySetListResult) IsEmpty() bool { + return aslr.Value == nil || len(*aslr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (aslr AvailabilitySetListResult) hasNextLink() bool { + return aslr.NextLink != nil && len(*aslr.NextLink) != 0 +} + +// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { + if !aslr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aslr.NextLink))) +} + +// AvailabilitySetListResultPage contains a page of AvailabilitySet values. +type AvailabilitySetListResultPage struct { + fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) + aslr AvailabilitySetListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.aslr) + if err != nil { + return err + } + page.aslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AvailabilitySetListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AvailabilitySetListResultPage) NotDone() bool { + return !page.aslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { + return page.aslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { + if page.aslr.IsEmpty() { + return nil + } + return *page.aslr.Value +} + +// Creates a new instance of the AvailabilitySetListResultPage type. +func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { + return AvailabilitySetListResultPage{ + fn: getNextPage, + aslr: cur, + } +} + +// AvailabilitySetProperties the instance view of a resource. +type AvailabilitySetProperties struct { + // PlatformUpdateDomainCount - Update Domain count. + PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` + // PlatformFaultDomainCount - Fault Domain count. + PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` + // VirtualMachines - A list of references to all virtual machines in the availability set. + VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` + // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to.

Minimum api-version: 2018-04-01. + ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` + // Statuses - READ-ONLY; The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// MarshalJSON is the custom marshaler for AvailabilitySetProperties. +func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.PlatformUpdateDomainCount != nil { + objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount + } + if asp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount + } + if asp.VirtualMachines != nil { + objectMap["virtualMachines"] = asp.VirtualMachines + } + if asp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup + } + return json.Marshal(objectMap) +} + +// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should +// be assigned to. Only tags may be updated. +type AvailabilitySetUpdate struct { + *AvailabilitySetProperties `json:"properties,omitempty"` + // Sku - Sku of the availability set + Sku *Sku `json:"sku,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. +func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asu.AvailabilitySetProperties != nil { + objectMap["properties"] = asu.AvailabilitySetProperties + } + if asu.Sku != nil { + objectMap["sku"] = asu.Sku + } + if asu.Tags != nil { + objectMap["tags"] = asu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. +func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var availabilitySetProperties AvailabilitySetProperties + err = json.Unmarshal(*v, &availabilitySetProperties) + if err != nil { + return err + } + asu.AvailabilitySetProperties = &availabilitySetProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + asu.Sku = &sku + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asu.Tags = tags + } + } + } + + return nil +} + +// AvailablePatchSummary describes the properties of an virtual machine instance view for available patch +// summary. +type AvailablePatchSummary struct { + // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' + Status PatchOperationStatus `json:"status,omitempty"` + // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. + AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` + // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. + RebootPending *bool `json:"rebootPending,omitempty"` + // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. + CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` + // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. + OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` + // StartTime - READ-ONLY; The UTC timestamp when the operation began. + StartTime *date.Time `json:"startTime,omitempty"` + // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. + Error *APIError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for AvailablePatchSummary. +func (aps AvailablePatchSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS.

Minimum +// api-version: 2019-03-01. +type BillingProfile struct { + // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price.

The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS.

Possible values are:

- Any decimal value greater than zero. Example: 0.01538

-1 – indicates default price to be up-to on-demand.

You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

Minimum api-version: 2019-03-01. + MaxPrice *float64 `json:"maxPrice,omitempty"` +} + +// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and +// Screenshot to diagnose VM status.

You can easily view the output of your console log.

+// Azure also enables you to see a screenshot of the VM from the hypervisor. +type BootDiagnostics struct { + // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. + Enabled *bool `json:"enabled,omitempty"` + // StorageURI - Uri of the storage account to use for placing the console output and screenshot.

If storageUri is not specified while enabling boot diagnostics, managed storage will be used. + StorageURI *string `json:"storageUri,omitempty"` +} + +// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. +type BootDiagnosticsInstanceView struct { + // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI.

NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. + ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` + // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob Uri.

NOTE: This will **not** be set if boot diagnostics is currently enabled with managed storage. + SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` + // Status - READ-ONLY; The boot diagnostics status information for the VM.

NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. + Status *InstanceViewStatus `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. +func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CapacityReservation specifies information about the capacity reservation. +type CapacityReservation struct { + autorest.Response `json:"-"` + *CapacityReservationProperties `json:"properties,omitempty"` + // Sku - SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + Sku *Sku `json:"sku,omitempty"` + // Zones - Availability Zone to use for this capacity reservation. The zone has to be single value and also should be part for the list of zones specified during the capacity reservation group creation. The zone can be assigned only during creation. If not provided, the reservation supports only non-zonal deployments. If provided, enforces VM/VMSS using this capacity reservation to be in same zone. + Zones *[]string `json:"zones,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CapacityReservation. +func (cr CapacityReservation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cr.CapacityReservationProperties != nil { + objectMap["properties"] = cr.CapacityReservationProperties + } + if cr.Sku != nil { + objectMap["sku"] = cr.Sku + } + if cr.Zones != nil { + objectMap["zones"] = cr.Zones + } + if cr.Location != nil { + objectMap["location"] = cr.Location + } + if cr.Tags != nil { + objectMap["tags"] = cr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityReservation struct. +func (cr *CapacityReservation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var capacityReservationProperties CapacityReservationProperties + err = json.Unmarshal(*v, &capacityReservationProperties) + if err != nil { + return err + } + cr.CapacityReservationProperties = &capacityReservationProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cr.Sku = &sku + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + cr.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cr.Tags = tags + } + } + } + + return nil +} + +// CapacityReservationGroup specifies information about the capacity reservation group that the capacity +// reservations should be assigned to.

Currently, a capacity reservation can only be added to a +// capacity reservation group at creation time. An existing capacity reservation cannot be added or moved +// to another capacity reservation group. +type CapacityReservationGroup struct { + autorest.Response `json:"-"` + *CapacityReservationGroupProperties `json:"properties,omitempty"` + // Zones - Availability Zones to use for this capacity reservation group. The zones can be assigned only during creation. If not provided, the group supports only regional resources in the region. If provided, enforces each capacity reservation in the group to be in one of the zones. + Zones *[]string `json:"zones,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationGroup. +func (crg CapacityReservationGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crg.CapacityReservationGroupProperties != nil { + objectMap["properties"] = crg.CapacityReservationGroupProperties + } + if crg.Zones != nil { + objectMap["zones"] = crg.Zones + } + if crg.Location != nil { + objectMap["location"] = crg.Location + } + if crg.Tags != nil { + objectMap["tags"] = crg.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroup struct. +func (crg *CapacityReservationGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var capacityReservationGroupProperties CapacityReservationGroupProperties + err = json.Unmarshal(*v, &capacityReservationGroupProperties) + if err != nil { + return err + } + crg.CapacityReservationGroupProperties = &capacityReservationGroupProperties + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + crg.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + crg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + crg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + crg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + crg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + crg.Tags = tags + } + } + } + + return nil +} + +// CapacityReservationGroupInstanceView ... +type CapacityReservationGroupInstanceView struct { + // CapacityReservations - READ-ONLY; List of instance view of the capacity reservations under the capacity reservation group. + CapacityReservations *[]CapacityReservationInstanceViewWithName `json:"capacityReservations,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationGroupInstanceView. +func (crgiv CapacityReservationGroupInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CapacityReservationGroupListResult the List capacity reservation group with resource group response. +type CapacityReservationGroupListResult struct { + autorest.Response `json:"-"` + // Value - The list of capacity reservation groups + Value *[]CapacityReservationGroup `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of capacity reservation groups. Call ListNext() with this URI to fetch the next page of capacity reservation groups. + NextLink *string `json:"nextLink,omitempty"` +} + +// CapacityReservationGroupListResultIterator provides access to a complete listing of +// CapacityReservationGroup values. +type CapacityReservationGroupListResultIterator struct { + i int + page CapacityReservationGroupListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CapacityReservationGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CapacityReservationGroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CapacityReservationGroupListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CapacityReservationGroupListResultIterator) Response() CapacityReservationGroupListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CapacityReservationGroupListResultIterator) Value() CapacityReservationGroup { + if !iter.page.NotDone() { + return CapacityReservationGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CapacityReservationGroupListResultIterator type. +func NewCapacityReservationGroupListResultIterator(page CapacityReservationGroupListResultPage) CapacityReservationGroupListResultIterator { + return CapacityReservationGroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (crglr CapacityReservationGroupListResult) IsEmpty() bool { + return crglr.Value == nil || len(*crglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (crglr CapacityReservationGroupListResult) hasNextLink() bool { + return crglr.NextLink != nil && len(*crglr.NextLink) != 0 +} + +// capacityReservationGroupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (crglr CapacityReservationGroupListResult) capacityReservationGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !crglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(crglr.NextLink))) +} + +// CapacityReservationGroupListResultPage contains a page of CapacityReservationGroup values. +type CapacityReservationGroupListResultPage struct { + fn func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error) + crglr CapacityReservationGroupListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CapacityReservationGroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationGroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.crglr) + if err != nil { + return err + } + page.crglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CapacityReservationGroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CapacityReservationGroupListResultPage) NotDone() bool { + return !page.crglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CapacityReservationGroupListResultPage) Response() CapacityReservationGroupListResult { + return page.crglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CapacityReservationGroupListResultPage) Values() []CapacityReservationGroup { + if page.crglr.IsEmpty() { + return nil + } + return *page.crglr.Value +} + +// Creates a new instance of the CapacityReservationGroupListResultPage type. +func NewCapacityReservationGroupListResultPage(cur CapacityReservationGroupListResult, getNextPage func(context.Context, CapacityReservationGroupListResult) (CapacityReservationGroupListResult, error)) CapacityReservationGroupListResultPage { + return CapacityReservationGroupListResultPage{ + fn: getNextPage, + crglr: cur, + } +} + +// CapacityReservationGroupProperties capacity reservation group Properties. +type CapacityReservationGroupProperties struct { + // CapacityReservations - READ-ONLY; A list of all capacity reservation resource ids that belong to capacity reservation group. + CapacityReservations *[]SubResourceReadOnly `json:"capacityReservations,omitempty"` + // VirtualMachinesAssociated - READ-ONLY; A list of references to all virtual machines associated to the capacity reservation group. + VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` + // InstanceView - READ-ONLY; The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. + InstanceView *CapacityReservationGroupInstanceView `json:"instanceView,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationGroupProperties. +func (crgp CapacityReservationGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CapacityReservationGroupUpdate specifies information about the capacity reservation group. Only tags can +// be updated. +type CapacityReservationGroupUpdate struct { + *CapacityReservationGroupProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationGroupUpdate. +func (crgu CapacityReservationGroupUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crgu.CapacityReservationGroupProperties != nil { + objectMap["properties"] = crgu.CapacityReservationGroupProperties + } + if crgu.Tags != nil { + objectMap["tags"] = crgu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityReservationGroupUpdate struct. +func (crgu *CapacityReservationGroupUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var capacityReservationGroupProperties CapacityReservationGroupProperties + err = json.Unmarshal(*v, &capacityReservationGroupProperties) + if err != nil { + return err + } + crgu.CapacityReservationGroupProperties = &capacityReservationGroupProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + crgu.Tags = tags + } + } + } + + return nil +} + +// CapacityReservationInstanceView the instance view of a capacity reservation that provides as snapshot of +// the runtime properties of the capacity reservation that is managed by the platform and can change +// outside of control plane operations. +type CapacityReservationInstanceView struct { + // UtilizationInfo - Unutilized capacity of the capacity reservation. + UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// CapacityReservationInstanceViewWithName the instance view of a capacity reservation that includes the +// name of the capacity reservation. It is used for the response to the instance view of a capacity +// reservation group. +type CapacityReservationInstanceViewWithName struct { + // Name - READ-ONLY; The name of the capacity reservation. + Name *string `json:"name,omitempty"` + // UtilizationInfo - Unutilized capacity of the capacity reservation. + UtilizationInfo *CapacityReservationUtilization `json:"utilizationInfo,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationInstanceViewWithName. +func (crivwn CapacityReservationInstanceViewWithName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if crivwn.UtilizationInfo != nil { + objectMap["utilizationInfo"] = crivwn.UtilizationInfo + } + if crivwn.Statuses != nil { + objectMap["statuses"] = crivwn.Statuses + } + return json.Marshal(objectMap) +} + +// CapacityReservationListResult the list capacity reservation operation response. +type CapacityReservationListResult struct { + autorest.Response `json:"-"` + // Value - The list of capacity reservations + Value *[]CapacityReservation `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of capacity reservations. Call ListNext() with this URI to fetch the next page of capacity reservations. + NextLink *string `json:"nextLink,omitempty"` +} + +// CapacityReservationListResultIterator provides access to a complete listing of CapacityReservation +// values. +type CapacityReservationListResultIterator struct { + i int + page CapacityReservationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CapacityReservationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CapacityReservationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CapacityReservationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CapacityReservationListResultIterator) Response() CapacityReservationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CapacityReservationListResultIterator) Value() CapacityReservation { + if !iter.page.NotDone() { + return CapacityReservation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CapacityReservationListResultIterator type. +func NewCapacityReservationListResultIterator(page CapacityReservationListResultPage) CapacityReservationListResultIterator { + return CapacityReservationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (crlr CapacityReservationListResult) IsEmpty() bool { + return crlr.Value == nil || len(*crlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (crlr CapacityReservationListResult) hasNextLink() bool { + return crlr.NextLink != nil && len(*crlr.NextLink) != 0 +} + +// capacityReservationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (crlr CapacityReservationListResult) capacityReservationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !crlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(crlr.NextLink))) +} + +// CapacityReservationListResultPage contains a page of CapacityReservation values. +type CapacityReservationListResultPage struct { + fn func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error) + crlr CapacityReservationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CapacityReservationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CapacityReservationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.crlr) + if err != nil { + return err + } + page.crlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CapacityReservationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CapacityReservationListResultPage) NotDone() bool { + return !page.crlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CapacityReservationListResultPage) Response() CapacityReservationListResult { + return page.crlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CapacityReservationListResultPage) Values() []CapacityReservation { + if page.crlr.IsEmpty() { + return nil + } + return *page.crlr.Value +} + +// Creates a new instance of the CapacityReservationListResultPage type. +func NewCapacityReservationListResultPage(cur CapacityReservationListResult, getNextPage func(context.Context, CapacityReservationListResult) (CapacityReservationListResult, error)) CapacityReservationListResultPage { + return CapacityReservationListResultPage{ + fn: getNextPage, + crlr: cur, + } +} + +// CapacityReservationProfile the parameters of a capacity reservation Profile. +type CapacityReservationProfile struct { + // CapacityReservationGroup - Specifies the capacity reservation group resource id that should be used for allocating the virtual machine or scaleset vm instances provided enough capacity has been reserved. Please refer to https://aka.ms/CapacityReservation for more details. + CapacityReservationGroup *SubResource `json:"capacityReservationGroup,omitempty"` +} + +// CapacityReservationProperties properties of the Capacity reservation. +type CapacityReservationProperties struct { + // ReservationID - READ-ONLY; A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource. + ReservationID *string `json:"reservationId,omitempty"` + // VirtualMachinesAssociated - READ-ONLY; A list of all virtual machine resource ids that are associated with the capacity reservation. + VirtualMachinesAssociated *[]SubResourceReadOnly `json:"virtualMachinesAssociated,omitempty"` + // ProvisioningTime - READ-ONLY; The date time when the capacity reservation was last updated. + ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // InstanceView - READ-ONLY; The Capacity reservation instance view. + InstanceView *CapacityReservationInstanceView `json:"instanceView,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationProperties. +func (crp CapacityReservationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CapacityReservationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CapacityReservationsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CapacityReservationsClient) (CapacityReservation, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CapacityReservationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CapacityReservationsCreateOrUpdateFuture.Result. +func (future *CapacityReservationsCreateOrUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.CreateOrUpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// CapacityReservationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CapacityReservationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CapacityReservationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CapacityReservationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CapacityReservationsDeleteFuture.Result. +func (future *CapacityReservationsDeleteFuture) result(client CapacityReservationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// CapacityReservationsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CapacityReservationsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CapacityReservationsClient) (CapacityReservation, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CapacityReservationsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CapacityReservationsUpdateFuture.Result. +func (future *CapacityReservationsUpdateFuture) result(client CapacityReservationsClient) (cr CapacityReservation, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CapacityReservationsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.UpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CapacityReservationsUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// CapacityReservationUpdate specifies information about the capacity reservation. Only tags and +// sku.capacity can be updated. +type CapacityReservationUpdate struct { + *CapacityReservationProperties `json:"properties,omitempty"` + // Sku - SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. Refer to List Microsoft.Compute SKUs in a region (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values. + Sku *Sku `json:"sku,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationUpdate. +func (cru CapacityReservationUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cru.CapacityReservationProperties != nil { + objectMap["properties"] = cru.CapacityReservationProperties + } + if cru.Sku != nil { + objectMap["sku"] = cru.Sku + } + if cru.Tags != nil { + objectMap["tags"] = cru.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CapacityReservationUpdate struct. +func (cru *CapacityReservationUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var capacityReservationProperties CapacityReservationProperties + err = json.Unmarshal(*v, &capacityReservationProperties) + if err != nil { + return err + } + cru.CapacityReservationProperties = &capacityReservationProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cru.Sku = &sku + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cru.Tags = tags + } + } + } + + return nil +} + +// CapacityReservationUtilization represents the capacity reservation utilization in terms of resources +// allocated. +type CapacityReservationUtilization struct { + // VirtualMachinesAllocated - READ-ONLY; A list of all virtual machines resource ids allocated against the capacity reservation. + VirtualMachinesAllocated *[]SubResourceReadOnly `json:"virtualMachinesAllocated,omitempty"` +} + +// MarshalJSON is the custom marshaler for CapacityReservationUtilization. +func (cru CapacityReservationUtilization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudError an error response from the Compute service. +type CloudError struct { + Error *APIError `json:"error,omitempty"` +} + +// CloudService describes the cloud service. +type CloudService struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + Properties *CloudServiceProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudService. +func (cs CloudService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.Location != nil { + objectMap["location"] = cs.Location + } + if cs.Tags != nil { + objectMap["tags"] = cs.Tags + } + if cs.Properties != nil { + objectMap["properties"] = cs.Properties + } + return json.Marshal(objectMap) +} + +// CloudServiceExtensionProfile describes a cloud service extension profile. +type CloudServiceExtensionProfile struct { + // Extensions - List of extensions for the cloud service. + Extensions *[]Extension `json:"extensions,omitempty"` +} + +// CloudServiceExtensionProperties extension Properties. +type CloudServiceExtensionProperties struct { + // Publisher - The name of the extension handler publisher. + Publisher *string `json:"publisher,omitempty"` + // Type - Specifies the type of the extension. + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the extension. Specifies the version of the extension. If this element is not specified or an asterisk (*) is used as the value, the latest version of the extension is used. If the value is specified with a major version number and an asterisk as the minor version number (X.), the latest minor version of the specified major version is selected. If a major version number and a minor version number are specified (X.Y), the specific extension version is selected. If a version is specified, an auto-upgrade is performed on the role instance. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // AutoUpgradeMinorVersion - Explicitly specify whether platform can automatically upgrade typeHandlerVersion to higher minor versions when they become available. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // Settings - Public settings for the extension. For JSON extensions, this is the JSON settings for the extension. For XML Extension (like RDP), this is the XML setting for the extension. + Settings *string `json:"settings,omitempty"` + // ProtectedSettings - Protected settings for the extension which are encrypted before sent to the role instance. + ProtectedSettings *string `json:"protectedSettings,omitempty"` + ProtectedSettingsFromKeyVault *CloudServiceVaultAndSecretReference `json:"protectedSettingsFromKeyVault,omitempty"` + // ForceUpdateTag - Tag to force apply the provided public and protected settings. + // Changing the tag value allows for re-running the extension without changing any of the public or protected settings. + // If forceUpdateTag is not changed, updates to public or protected settings would still be applied by the handler. + // If neither forceUpdateTag nor any of public or protected settings change, extension would flow to the role instance with the same sequence-number, and + // it is up to handler implementation whether to re-run it or not + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RolesAppliedTo - Optional list of roles to apply this extension. If property is not specified or '*' is specified, extension is applied to all roles in the cloud service. + RolesAppliedTo *[]string `json:"rolesAppliedTo,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudServiceExtensionProperties. +func (csep CloudServiceExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csep.Publisher != nil { + objectMap["publisher"] = csep.Publisher + } + if csep.Type != nil { + objectMap["type"] = csep.Type + } + if csep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = csep.TypeHandlerVersion + } + if csep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = csep.AutoUpgradeMinorVersion + } + if csep.Settings != nil { + objectMap["settings"] = csep.Settings + } + if csep.ProtectedSettings != nil { + objectMap["protectedSettings"] = csep.ProtectedSettings + } + if csep.ProtectedSettingsFromKeyVault != nil { + objectMap["protectedSettingsFromKeyVault"] = csep.ProtectedSettingsFromKeyVault + } + if csep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = csep.ForceUpdateTag + } + if csep.RolesAppliedTo != nil { + objectMap["rolesAppliedTo"] = csep.RolesAppliedTo + } + return json.Marshal(objectMap) +} + +// CloudServiceInstanceView instanceView of CloudService as a whole +type CloudServiceInstanceView struct { + autorest.Response `json:"-"` + RoleInstance *InstanceViewStatusesSummary `json:"roleInstance,omitempty"` + // SdkVersion - READ-ONLY; The version of the SDK that was used to generate the package for the cloud service. + SdkVersion *string `json:"sdkVersion,omitempty"` + // PrivateIds - READ-ONLY; Specifies a list of unique identifiers generated internally for the cloud service.

NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. + PrivateIds *[]string `json:"privateIds,omitempty"` + // Statuses - READ-ONLY + Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudServiceInstanceView. +func (csiv CloudServiceInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csiv.RoleInstance != nil { + objectMap["roleInstance"] = csiv.RoleInstance + } + return json.Marshal(objectMap) +} + +// CloudServiceListResult ... +type CloudServiceListResult struct { + autorest.Response `json:"-"` + Value *[]CloudService `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// CloudServiceListResultIterator provides access to a complete listing of CloudService values. +type CloudServiceListResultIterator struct { + i int + page CloudServiceListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CloudServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CloudServiceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CloudServiceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CloudServiceListResultIterator) Response() CloudServiceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CloudServiceListResultIterator) Value() CloudService { + if !iter.page.NotDone() { + return CloudService{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CloudServiceListResultIterator type. +func NewCloudServiceListResultIterator(page CloudServiceListResultPage) CloudServiceListResultIterator { + return CloudServiceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cslr CloudServiceListResult) IsEmpty() bool { + return cslr.Value == nil || len(*cslr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cslr CloudServiceListResult) hasNextLink() bool { + return cslr.NextLink != nil && len(*cslr.NextLink) != 0 +} + +// cloudServiceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cslr CloudServiceListResult) cloudServiceListResultPreparer(ctx context.Context) (*http.Request, error) { + if !cslr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cslr.NextLink))) +} + +// CloudServiceListResultPage contains a page of CloudService values. +type CloudServiceListResultPage struct { + fn func(context.Context, CloudServiceListResult) (CloudServiceListResult, error) + cslr CloudServiceListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CloudServiceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cslr) + if err != nil { + return err + } + page.cslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CloudServiceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CloudServiceListResultPage) NotDone() bool { + return !page.cslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CloudServiceListResultPage) Response() CloudServiceListResult { + return page.cslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CloudServiceListResultPage) Values() []CloudService { + if page.cslr.IsEmpty() { + return nil + } + return *page.cslr.Value +} + +// Creates a new instance of the CloudServiceListResultPage type. +func NewCloudServiceListResultPage(cur CloudServiceListResult, getNextPage func(context.Context, CloudServiceListResult) (CloudServiceListResult, error)) CloudServiceListResultPage { + return CloudServiceListResultPage{ + fn: getNextPage, + cslr: cur, + } +} + +// CloudServiceNetworkProfile network Profile for the cloud service. +type CloudServiceNetworkProfile struct { + // LoadBalancerConfigurations - List of Load balancer configurations. Cloud service can have up to two load balancer configurations, corresponding to a Public Load Balancer and an Internal Load Balancer. + LoadBalancerConfigurations *[]LoadBalancerConfiguration `json:"loadBalancerConfigurations,omitempty"` + // SwappableCloudService - The id reference of the cloud service containing the target IP with which the subject cloud service can perform a swap. This property cannot be updated once it is set. The swappable cloud service referred by this id must be present otherwise an error will be thrown. + SwappableCloudService *SubResource `json:"swappableCloudService,omitempty"` +} + +// CloudServiceOsProfile describes the OS profile for the cloud service. +type CloudServiceOsProfile struct { + // Secrets - Specifies set of certificates that should be installed onto the role instances. + Secrets *[]CloudServiceVaultSecretGroup `json:"secrets,omitempty"` +} + +// CloudServiceProperties cloud service properties +type CloudServiceProperties struct { + // PackageURL - Specifies a URL that refers to the location of the service package in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. + // This is a write-only property and is not returned in GET calls. + PackageURL *string `json:"packageUrl,omitempty"` + // Configuration - Specifies the XML service configuration (.cscfg) for the cloud service. + Configuration *string `json:"configuration,omitempty"` + // ConfigurationURL - Specifies a URL that refers to the location of the service configuration in the Blob service. The service package URL can be Shared Access Signature (SAS) URI from any storage account. + // This is a write-only property and is not returned in GET calls. + ConfigurationURL *string `json:"configurationUrl,omitempty"` + // StartCloudService - (Optional) Indicates whether to start the cloud service immediately after it is created. The default value is `true`. + // If false, the service model is still deployed, but the code is not run immediately. Instead, the service is PoweredOff until you call Start, at which time the service will be started. A deployed service still incurs charges, even if it is poweredoff. + StartCloudService *bool `json:"startCloudService,omitempty"` + // AllowModelOverride - (Optional) Indicates whether the role sku properties (roleProfile.roles.sku) specified in the model/template should override the role instance count and vm size specified in the .cscfg and .csdef respectively. + // The default value is `false`. + AllowModelOverride *bool `json:"allowModelOverride,omitempty"` + // UpgradeMode - Possible values include: 'CloudServiceUpgradeModeAuto', 'CloudServiceUpgradeModeManual', 'CloudServiceUpgradeModeSimultaneous' + UpgradeMode CloudServiceUpgradeMode `json:"upgradeMode,omitempty"` + RoleProfile *CloudServiceRoleProfile `json:"roleProfile,omitempty"` + OsProfile *CloudServiceOsProfile `json:"osProfile,omitempty"` + NetworkProfile *CloudServiceNetworkProfile `json:"networkProfile,omitempty"` + ExtensionProfile *CloudServiceExtensionProfile `json:"extensionProfile,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueID - READ-ONLY; The unique identifier for the cloud service. + UniqueID *string `json:"uniqueId,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudServiceProperties. +func (csp CloudServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csp.PackageURL != nil { + objectMap["packageUrl"] = csp.PackageURL + } + if csp.Configuration != nil { + objectMap["configuration"] = csp.Configuration + } + if csp.ConfigurationURL != nil { + objectMap["configurationUrl"] = csp.ConfigurationURL + } + if csp.StartCloudService != nil { + objectMap["startCloudService"] = csp.StartCloudService + } + if csp.AllowModelOverride != nil { + objectMap["allowModelOverride"] = csp.AllowModelOverride + } + if csp.UpgradeMode != "" { + objectMap["upgradeMode"] = csp.UpgradeMode + } + if csp.RoleProfile != nil { + objectMap["roleProfile"] = csp.RoleProfile + } + if csp.OsProfile != nil { + objectMap["osProfile"] = csp.OsProfile + } + if csp.NetworkProfile != nil { + objectMap["networkProfile"] = csp.NetworkProfile + } + if csp.ExtensionProfile != nil { + objectMap["extensionProfile"] = csp.ExtensionProfile + } + return json.Marshal(objectMap) +} + +// CloudServiceRole describes a role of the cloud service. +type CloudServiceRole struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` + Sku *CloudServiceRoleSku `json:"sku,omitempty"` + Properties *CloudServiceRoleProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudServiceRole. +func (csr CloudServiceRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csr.Sku != nil { + objectMap["sku"] = csr.Sku + } + if csr.Properties != nil { + objectMap["properties"] = csr.Properties + } + return json.Marshal(objectMap) +} + +// CloudServiceRoleInstancesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudServiceRoleInstancesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServiceRoleInstancesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServiceRoleInstancesDeleteFuture.Result. +func (future *CloudServiceRoleInstancesDeleteFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServiceRoleInstancesRebuildFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudServiceRoleInstancesRebuildFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServiceRoleInstancesRebuildFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServiceRoleInstancesRebuildFuture.Result. +func (future *CloudServiceRoleInstancesRebuildFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRebuildFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRebuildFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServiceRoleInstancesReimageFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudServiceRoleInstancesReimageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServiceRoleInstancesReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServiceRoleInstancesReimageFuture.Result. +func (future *CloudServiceRoleInstancesReimageFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesReimageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesReimageFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServiceRoleInstancesRestartFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudServiceRoleInstancesRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServiceRoleInstancesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServiceRoleInstancesRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServiceRoleInstancesRestartFuture.Result. +func (future *CloudServiceRoleInstancesRestartFuture) result(client CloudServiceRoleInstancesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServiceRoleInstancesRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServiceRoleInstancesRestartFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServiceRoleListResult ... +type CloudServiceRoleListResult struct { + autorest.Response `json:"-"` + Value *[]CloudServiceRole `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// CloudServiceRoleListResultIterator provides access to a complete listing of CloudServiceRole values. +type CloudServiceRoleListResultIterator struct { + i int + page CloudServiceRoleListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CloudServiceRoleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CloudServiceRoleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CloudServiceRoleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CloudServiceRoleListResultIterator) Response() CloudServiceRoleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CloudServiceRoleListResultIterator) Value() CloudServiceRole { + if !iter.page.NotDone() { + return CloudServiceRole{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CloudServiceRoleListResultIterator type. +func NewCloudServiceRoleListResultIterator(page CloudServiceRoleListResultPage) CloudServiceRoleListResultIterator { + return CloudServiceRoleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (csrlr CloudServiceRoleListResult) IsEmpty() bool { + return csrlr.Value == nil || len(*csrlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (csrlr CloudServiceRoleListResult) hasNextLink() bool { + return csrlr.NextLink != nil && len(*csrlr.NextLink) != 0 +} + +// cloudServiceRoleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (csrlr CloudServiceRoleListResult) cloudServiceRoleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !csrlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(csrlr.NextLink))) +} + +// CloudServiceRoleListResultPage contains a page of CloudServiceRole values. +type CloudServiceRoleListResultPage struct { + fn func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error) + csrlr CloudServiceRoleListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CloudServiceRoleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CloudServiceRoleListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.csrlr) + if err != nil { + return err + } + page.csrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CloudServiceRoleListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CloudServiceRoleListResultPage) NotDone() bool { + return !page.csrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CloudServiceRoleListResultPage) Response() CloudServiceRoleListResult { + return page.csrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CloudServiceRoleListResultPage) Values() []CloudServiceRole { + if page.csrlr.IsEmpty() { + return nil + } + return *page.csrlr.Value +} + +// Creates a new instance of the CloudServiceRoleListResultPage type. +func NewCloudServiceRoleListResultPage(cur CloudServiceRoleListResult, getNextPage func(context.Context, CloudServiceRoleListResult) (CloudServiceRoleListResult, error)) CloudServiceRoleListResultPage { + return CloudServiceRoleListResultPage{ + fn: getNextPage, + csrlr: cur, + } +} + +// CloudServiceRoleProfile describes the role profile for the cloud service. +type CloudServiceRoleProfile struct { + // Roles - List of roles for the cloud service. + Roles *[]CloudServiceRoleProfileProperties `json:"roles,omitempty"` +} + +// CloudServiceRoleProfileProperties describes the role properties. +type CloudServiceRoleProfileProperties struct { + // Name - Resource name. + Name *string `json:"name,omitempty"` + Sku *CloudServiceRoleSku `json:"sku,omitempty"` +} + +// CloudServiceRoleProperties ... +type CloudServiceRoleProperties struct { + // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a cloud service role. + UniqueID *string `json:"uniqueId,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudServiceRoleProperties. +func (csrp CloudServiceRoleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CloudServiceRoleSku describes the cloud service role sku. +type CloudServiceRoleSku struct { + // Name - The sku name. NOTE: If the new SKU is not supported on the hardware the cloud service is currently on, you need to delete and recreate the cloud service or move back to the old sku. + Name *string `json:"name,omitempty"` + // Tier - Specifies the tier of the cloud service. Possible Values are

**Standard**

**Basic** + Tier *string `json:"tier,omitempty"` + // Capacity - Specifies the number of role instances in the cloud service. + Capacity *int64 `json:"capacity,omitempty"` +} + +// CloudServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudServicesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (CloudService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesCreateOrUpdateFuture.Result. +func (future *CloudServicesCreateOrUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.CreateOrUpdateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// CloudServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudServicesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesDeleteFuture.Result. +func (future *CloudServicesDeleteFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesDeleteInstancesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CloudServicesDeleteInstancesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesDeleteInstancesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesDeleteInstancesFuture.Result. +func (future *CloudServicesDeleteInstancesFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesDeleteInstancesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesDeleteInstancesFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudServicesPowerOffFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesPowerOffFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesPowerOffFuture.Result. +func (future *CloudServicesPowerOffFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesPowerOffFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesPowerOffFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesRebuildFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudServicesRebuildFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesRebuildFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesRebuildFuture.Result. +func (future *CloudServicesRebuildFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesRebuildFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRebuildFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesReimageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudServicesReimageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesReimageFuture.Result. +func (future *CloudServicesReimageFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesReimageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesReimageFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudServicesRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesRestartFuture.Result. +func (future *CloudServicesRestartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesRestartFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudServicesStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesStartFuture.Result. +func (future *CloudServicesStartFuture) result(client CloudServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesStartFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesUpdateDomainWalkUpdateDomainFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type CloudServicesUpdateDomainWalkUpdateDomainFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesUpdateDomainClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesUpdateDomainWalkUpdateDomainFuture.Result. +func (future *CloudServicesUpdateDomainWalkUpdateDomainFuture) result(client CloudServicesUpdateDomainClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateDomainWalkUpdateDomainFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateDomainWalkUpdateDomainFuture") + return + } + ar.Response = future.Response() + return +} + +// CloudServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CloudServicesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CloudServicesClient) (CloudService, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CloudServicesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CloudServicesUpdateFuture.Result. +func (future *CloudServicesUpdateFuture) result(client CloudServicesClient) (cs CloudService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + cs.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.CloudServicesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.UpdateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.CloudServicesUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// CloudServiceUpdate ... +type CloudServiceUpdate struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for CloudServiceUpdate. +func (csu CloudServiceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csu.Tags != nil { + objectMap["tags"] = csu.Tags + } + return json.Marshal(objectMap) +} + +// CloudServiceVaultAndSecretReference ... +type CloudServiceVaultAndSecretReference struct { + SourceVault *SubResource `json:"sourceVault,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` +} + +// CloudServiceVaultCertificate describes a single certificate reference in a Key Vault, and where the +// certificate should reside on the role instance. +type CloudServiceVaultCertificate struct { + // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. + CertificateURL *string `json:"certificateUrl,omitempty"` +} + +// CloudServiceVaultSecretGroup describes a set of certificates which are all in the same Key Vault. +type CloudServiceVaultSecretGroup struct { + // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. + SourceVault *SubResource `json:"sourceVault,omitempty"` + // VaultCertificates - The list of key vault references in SourceVault which contain certificates. + VaultCertificates *[]CloudServiceVaultCertificate `json:"vaultCertificates,omitempty"` +} + +// CommunityGallery specifies information about the Community Gallery that you want to create or update. +type CommunityGallery struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *CommunityGalleryIdentifier `json:"identifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for CommunityGallery. +func (cg CommunityGallery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cg.CommunityGalleryIdentifier != nil { + objectMap["identifier"] = cg.CommunityGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CommunityGallery struct. +func (cg *CommunityGallery) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cg.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cg.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cg.Type = &typeVar + } + case "identifier": + if v != nil { + var communityGalleryIdentifier CommunityGalleryIdentifier + err = json.Unmarshal(*v, &communityGalleryIdentifier) + if err != nil { + return err + } + cg.CommunityGalleryIdentifier = &communityGalleryIdentifier + } + } + } + + return nil +} + +// CommunityGalleryIdentifier the identifier information of community gallery. +type CommunityGalleryIdentifier struct { + // UniqueID - The unique id of this community gallery. + UniqueID *string `json:"uniqueId,omitempty"` +} + +// CommunityGalleryImage specifies information about the gallery image definition that you want to create +// or update. +type CommunityGalleryImage struct { + autorest.Response `json:"-"` + *CommunityGalleryImageProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *CommunityGalleryIdentifier `json:"identifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for CommunityGalleryImage. +func (cgiVar CommunityGalleryImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cgiVar.CommunityGalleryImageProperties != nil { + objectMap["properties"] = cgiVar.CommunityGalleryImageProperties + } + if cgiVar.CommunityGalleryIdentifier != nil { + objectMap["identifier"] = cgiVar.CommunityGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CommunityGalleryImage struct. +func (cgiVar *CommunityGalleryImage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var communityGalleryImageProperties CommunityGalleryImageProperties + err = json.Unmarshal(*v, &communityGalleryImageProperties) + if err != nil { + return err + } + cgiVar.CommunityGalleryImageProperties = &communityGalleryImageProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cgiVar.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cgiVar.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cgiVar.Type = &typeVar + } + case "identifier": + if v != nil { + var communityGalleryIdentifier CommunityGalleryIdentifier + err = json.Unmarshal(*v, &communityGalleryIdentifier) + if err != nil { + return err + } + cgiVar.CommunityGalleryIdentifier = &communityGalleryIdentifier + } + } + } + + return nil +} + +// CommunityGalleryImageProperties describes the properties of a gallery image definition. +type CommunityGalleryImageProperties struct { + // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' + OsState OperatingSystemStateTypes `json:"osState,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` + Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` + Disallowed *Disallowed `json:"disallowed,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` + // Features - A list of gallery image features. + Features *[]GalleryImageFeature `json:"features,omitempty"` + PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` +} + +// CommunityGalleryImageVersion specifies information about the gallery image version that you want to +// create or update. +type CommunityGalleryImageVersion struct { + autorest.Response `json:"-"` + *CommunityGalleryImageVersionProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *CommunityGalleryIdentifier `json:"identifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for CommunityGalleryImageVersion. +func (cgiv CommunityGalleryImageVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cgiv.CommunityGalleryImageVersionProperties != nil { + objectMap["properties"] = cgiv.CommunityGalleryImageVersionProperties + } + if cgiv.CommunityGalleryIdentifier != nil { + objectMap["identifier"] = cgiv.CommunityGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CommunityGalleryImageVersion struct. +func (cgiv *CommunityGalleryImageVersion) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var communityGalleryImageVersionProperties CommunityGalleryImageVersionProperties + err = json.Unmarshal(*v, &communityGalleryImageVersionProperties) + if err != nil { + return err + } + cgiv.CommunityGalleryImageVersionProperties = &communityGalleryImageVersionProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cgiv.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cgiv.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cgiv.Type = &typeVar + } + case "identifier": + if v != nil { + var communityGalleryIdentifier CommunityGalleryIdentifier + err = json.Unmarshal(*v, &communityGalleryIdentifier) + if err != nil { + return err + } + cgiv.CommunityGalleryIdentifier = &communityGalleryIdentifier + } + } + } + + return nil +} + +// CommunityGalleryImageVersionProperties describes the properties of a gallery image version. +type CommunityGalleryImageVersionProperties struct { + // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. + PublishedDate *date.Time `json:"publishedDate,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` +} + +// CreationData data used when creating a disk. +type CreationData struct { + // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'DiskCreateOptionEmpty', 'DiskCreateOptionAttach', 'DiskCreateOptionFromImage', 'DiskCreateOptionImport', 'DiskCreateOptionCopy', 'DiskCreateOptionRestore', 'DiskCreateOptionUpload', 'DiskCreateOptionCopyStart', 'DiskCreateOptionImportSecure', 'DiskCreateOptionUploadPreparedSecure' + CreateOption DiskCreateOption `json:"createOption,omitempty"` + // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. + StorageAccountID *string `json:"storageAccountId,omitempty"` + // ImageReference - Disk source information. + ImageReference *ImageDiskReference `json:"imageReference,omitempty"` + // GalleryImageReference - Required if creating from a Gallery Image. The id of the ImageDiskReference will be the ARM id of the shared galley image version from which to create a disk. + GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"` + // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. + SourceURI *string `json:"sourceUri,omitempty"` + // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. + SourceUniqueID *string `json:"sourceUniqueId,omitempty"` + // UploadSizeBytes - If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). + UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` + // LogicalSectorSize - Logical sector size in bytes for Ultra disks. Supported values are 512 ad 4096. 4096 is the default. + LogicalSectorSize *int32 `json:"logicalSectorSize,omitempty"` + // SecurityDataURI - If createOption is ImportSecure, this is the URI of a blob to be imported into VM guest state. + SecurityDataURI *string `json:"securityDataUri,omitempty"` +} + +// MarshalJSON is the custom marshaler for CreationData. +func (cd CreationData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cd.CreateOption != "" { + objectMap["createOption"] = cd.CreateOption + } + if cd.StorageAccountID != nil { + objectMap["storageAccountId"] = cd.StorageAccountID + } + if cd.ImageReference != nil { + objectMap["imageReference"] = cd.ImageReference + } + if cd.GalleryImageReference != nil { + objectMap["galleryImageReference"] = cd.GalleryImageReference + } + if cd.SourceURI != nil { + objectMap["sourceUri"] = cd.SourceURI + } + if cd.SourceResourceID != nil { + objectMap["sourceResourceId"] = cd.SourceResourceID + } + if cd.UploadSizeBytes != nil { + objectMap["uploadSizeBytes"] = cd.UploadSizeBytes + } + if cd.LogicalSectorSize != nil { + objectMap["logicalSectorSize"] = cd.LogicalSectorSize + } + if cd.SecurityDataURI != nil { + objectMap["securityDataUri"] = cd.SecurityDataURI + } + return json.Marshal(objectMap) +} + +// DataDisk describes a data disk. +type DataDisk struct { + // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + Lun *int32 `json:"lun,omitempty"` + // Name - The disk name. + Name *string `json:"name,omitempty"` + // Vhd - The virtual hard disk. + Vhd *VirtualHardDisk `json:"vhd,omitempty"` + // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. + Image *VirtualHardDisk `json:"image,omitempty"` + // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` + // CreateOption - Specifies how the virtual machine should be created.

Possible values are:

**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' + CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` + // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // ManagedDisk - The managed disk parameters. + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset + ToBeDetached *bool `json:"toBeDetached,omitempty"` + // DiskIOPSReadWrite - READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + // DiskMBpsReadWrite - READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` + // DetachOption - Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach**.

detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior.

This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. Possible values include: 'DiskDetachOptionTypesForceDetach' + DetachOption DiskDetachOptionTypes `json:"detachOption,omitempty"` + // DeleteOption - Specifies whether data disk should be deleted or detached upon VM deletion.

Possible values:

**Delete** If this value is used, the data disk is deleted when VM is deleted.

**Detach** If this value is used, the data disk is retained after VM is deleted.

The default value is set to **detach**. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' + DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataDisk. +func (dd DataDisk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dd.Lun != nil { + objectMap["lun"] = dd.Lun + } + if dd.Name != nil { + objectMap["name"] = dd.Name + } + if dd.Vhd != nil { + objectMap["vhd"] = dd.Vhd + } + if dd.Image != nil { + objectMap["image"] = dd.Image + } + if dd.Caching != "" { + objectMap["caching"] = dd.Caching + } + if dd.WriteAcceleratorEnabled != nil { + objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled + } + if dd.CreateOption != "" { + objectMap["createOption"] = dd.CreateOption + } + if dd.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dd.DiskSizeGB + } + if dd.ManagedDisk != nil { + objectMap["managedDisk"] = dd.ManagedDisk + } + if dd.ToBeDetached != nil { + objectMap["toBeDetached"] = dd.ToBeDetached + } + if dd.DetachOption != "" { + objectMap["detachOption"] = dd.DetachOption + } + if dd.DeleteOption != "" { + objectMap["deleteOption"] = dd.DeleteOption + } + return json.Marshal(objectMap) +} + +// DataDiskImage contains the data disk images information. +type DataDiskImage struct { + // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + Lun *int32 `json:"lun,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataDiskImage. +func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DataDiskImageEncryption contains encryption settings for a data disk image. +type DataDiskImageEncryption struct { + // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. + Lun *int32 `json:"lun,omitempty"` + // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// DedicatedHost specifies information about the Dedicated host. +type DedicatedHost struct { + autorest.Response `json:"-"` + *DedicatedHostProperties `json:"properties,omitempty"` + // Sku - SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. + Sku *Sku `json:"sku,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DedicatedHost. +func (dh DedicatedHost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dh.DedicatedHostProperties != nil { + objectMap["properties"] = dh.DedicatedHostProperties + } + if dh.Sku != nil { + objectMap["sku"] = dh.Sku + } + if dh.Location != nil { + objectMap["location"] = dh.Location + } + if dh.Tags != nil { + objectMap["tags"] = dh.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. +func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dedicatedHostProperties DedicatedHostProperties + err = json.Unmarshal(*v, &dedicatedHostProperties) + if err != nil { + return err + } + dh.DedicatedHostProperties = &dedicatedHostProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + dh.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dh.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dh.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dh.Tags = tags + } + } + } + + return nil +} + +// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM +// size. +type DedicatedHostAllocatableVM struct { + // VMSize - VM size in terms of which the unutilized capacity is represented. + VMSize *string `json:"vmSize,omitempty"` + // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. + Count *float64 `json:"count,omitempty"` +} + +// DedicatedHostAvailableCapacity dedicated host unutilized capacity. +type DedicatedHostAvailableCapacity struct { + // AllocatableVMs - The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. + AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` +} + +// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should +// be assigned to.

Currently, a dedicated host can only be added to a dedicated host group at +// creation time. An existing dedicated host cannot be added to another dedicated host group. +type DedicatedHostGroup struct { + autorest.Response `json:"-"` + *DedicatedHostGroupProperties `json:"properties,omitempty"` + // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. + Zones *[]string `json:"zones,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DedicatedHostGroup. +func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhg.DedicatedHostGroupProperties != nil { + objectMap["properties"] = dhg.DedicatedHostGroupProperties + } + if dhg.Zones != nil { + objectMap["zones"] = dhg.Zones + } + if dhg.Location != nil { + objectMap["location"] = dhg.Location + } + if dhg.Tags != nil { + objectMap["tags"] = dhg.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. +func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dedicatedHostGroupProperties DedicatedHostGroupProperties + err = json.Unmarshal(*v, &dedicatedHostGroupProperties) + if err != nil { + return err + } + dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + dhg.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dhg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dhg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dhg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dhg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dhg.Tags = tags + } + } + } + + return nil +} + +// DedicatedHostGroupInstanceView ... +type DedicatedHostGroupInstanceView struct { + // Hosts - List of instance view of the dedicated hosts under the dedicated host group. + Hosts *[]DedicatedHostInstanceViewWithName `json:"hosts,omitempty"` +} + +// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. +type DedicatedHostGroupListResult struct { + autorest.Response `json:"-"` + // Value - The list of dedicated host groups + Value *[]DedicatedHostGroup `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. + NextLink *string `json:"nextLink,omitempty"` +} + +// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. +type DedicatedHostGroupListResultIterator struct { + i int + page DedicatedHostGroupListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DedicatedHostGroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DedicatedHostGroupListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { + if !iter.page.NotDone() { + return DedicatedHostGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DedicatedHostGroupListResultIterator type. +func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { + return DedicatedHostGroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { + return dhglr.Value == nil || len(*dhglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { + return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 +} + +// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dhglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dhglr.NextLink))) +} + +// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. +type DedicatedHostGroupListResultPage struct { + fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) + dhglr DedicatedHostGroupListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dhglr) + if err != nil { + return err + } + page.dhglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DedicatedHostGroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DedicatedHostGroupListResultPage) NotDone() bool { + return !page.dhglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { + return page.dhglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { + if page.dhglr.IsEmpty() { + return nil + } + return *page.dhglr.Value +} + +// Creates a new instance of the DedicatedHostGroupListResultPage type. +func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { + return DedicatedHostGroupListResultPage{ + fn: getNextPage, + dhglr: cur, + } +} + +// DedicatedHostGroupProperties dedicated Host Group Properties. +type DedicatedHostGroupProperties struct { + // PlatformFaultDomainCount - Number of fault domains that the host group can span. + PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` + // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. + Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` + // InstanceView - READ-ONLY; The dedicated host group instance view, which has the list of instance view of the dedicated hosts under the dedicated host group. + InstanceView *DedicatedHostGroupInstanceView `json:"instanceView,omitempty"` + // SupportAutomaticPlacement - Specifies whether virtual machines or virtual machine scale sets can be placed automatically on the dedicated host group. Automatic placement means resources are allocated on dedicated hosts, that are chosen by Azure, under the dedicated host group. The value is defaulted to 'false' when not provided.

Minimum api-version: 2020-06-01. + SupportAutomaticPlacement *bool `json:"supportAutomaticPlacement,omitempty"` +} + +// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. +func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhgp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount + } + if dhgp.SupportAutomaticPlacement != nil { + objectMap["supportAutomaticPlacement"] = dhgp.SupportAutomaticPlacement + } + return json.Marshal(objectMap) +} + +// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host +// should be assigned to. Only tags may be updated. +type DedicatedHostGroupUpdate struct { + *DedicatedHostGroupProperties `json:"properties,omitempty"` + // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. + Zones *[]string `json:"zones,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. +func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhgu.DedicatedHostGroupProperties != nil { + objectMap["properties"] = dhgu.DedicatedHostGroupProperties + } + if dhgu.Zones != nil { + objectMap["zones"] = dhgu.Zones + } + if dhgu.Tags != nil { + objectMap["tags"] = dhgu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. +func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dedicatedHostGroupProperties DedicatedHostGroupProperties + err = json.Unmarshal(*v, &dedicatedHostGroupProperties) + if err != nil { + return err + } + dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + dhgu.Zones = &zones + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dhgu.Tags = tags + } + } + } + + return nil +} + +// DedicatedHostInstanceView the instance view of a dedicated host. +type DedicatedHostInstanceView struct { + // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. + AssetID *string `json:"assetId,omitempty"` + // AvailableCapacity - Unutilized capacity of the dedicated host. + AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. +func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhiv.AvailableCapacity != nil { + objectMap["availableCapacity"] = dhiv.AvailableCapacity + } + if dhiv.Statuses != nil { + objectMap["statuses"] = dhiv.Statuses + } + return json.Marshal(objectMap) +} + +// DedicatedHostInstanceViewWithName the instance view of a dedicated host that includes the name of the +// dedicated host. It is used for the response to the instance view of a dedicated host group. +type DedicatedHostInstanceViewWithName struct { + // Name - READ-ONLY; The name of the dedicated host. + Name *string `json:"name,omitempty"` + // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. + AssetID *string `json:"assetId,omitempty"` + // AvailableCapacity - Unutilized capacity of the dedicated host. + AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// MarshalJSON is the custom marshaler for DedicatedHostInstanceViewWithName. +func (dhivwn DedicatedHostInstanceViewWithName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhivwn.AvailableCapacity != nil { + objectMap["availableCapacity"] = dhivwn.AvailableCapacity + } + if dhivwn.Statuses != nil { + objectMap["statuses"] = dhivwn.Statuses + } + return json.Marshal(objectMap) +} + +// DedicatedHostListResult the list dedicated host operation response. +type DedicatedHostListResult struct { + autorest.Response `json:"-"` + // Value - The list of dedicated hosts + Value *[]DedicatedHost `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. + NextLink *string `json:"nextLink,omitempty"` +} + +// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. +type DedicatedHostListResultIterator struct { + i int + page DedicatedHostListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DedicatedHostListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DedicatedHostListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DedicatedHostListResultIterator) Value() DedicatedHost { + if !iter.page.NotDone() { + return DedicatedHost{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DedicatedHostListResultIterator type. +func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { + return DedicatedHostListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dhlr DedicatedHostListResult) IsEmpty() bool { + return dhlr.Value == nil || len(*dhlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dhlr DedicatedHostListResult) hasNextLink() bool { + return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 +} + +// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dhlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dhlr.NextLink))) +} + +// DedicatedHostListResultPage contains a page of DedicatedHost values. +type DedicatedHostListResultPage struct { + fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) + dhlr DedicatedHostListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dhlr) + if err != nil { + return err + } + page.dhlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DedicatedHostListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DedicatedHostListResultPage) NotDone() bool { + return !page.dhlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { + return page.dhlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DedicatedHostListResultPage) Values() []DedicatedHost { + if page.dhlr.IsEmpty() { + return nil + } + return *page.dhlr.Value +} + +// Creates a new instance of the DedicatedHostListResultPage type. +func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { + return DedicatedHostListResultPage{ + fn: getNextPage, + dhlr: cur, + } +} + +// DedicatedHostProperties properties of the dedicated host. +type DedicatedHostProperties struct { + // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. + PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` + // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. + AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` + // HostID - READ-ONLY; A unique id generated and assigned to the dedicated host by the platform.

Does not change throughout the lifetime of the host. + HostID *string `json:"hostId,omitempty"` + // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. + VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` + // LicenseType - Specifies the software license type that will be applied to the VMs deployed on the dedicated host.

Possible values are:

**None**

**Windows_Server_Hybrid**

**Windows_Server_Perpetual**

Default: **None**. Possible values include: 'DedicatedHostLicenseTypesNone', 'DedicatedHostLicenseTypesWindowsServerHybrid', 'DedicatedHostLicenseTypesWindowsServerPerpetual' + LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` + // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. + ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // InstanceView - READ-ONLY; The dedicated host instance view. + InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` +} + +// MarshalJSON is the custom marshaler for DedicatedHostProperties. +func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhp.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain + } + if dhp.AutoReplaceOnFailure != nil { + objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure + } + if dhp.LicenseType != "" { + objectMap["licenseType"] = dhp.LicenseType + } + return json.Marshal(objectMap) +} + +// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DedicatedHostsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHostsClient) (DedicatedHost, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. +func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dh.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { + dh, err = client.CreateOrUpdateResponder(dh.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") + } + } + return +} + +// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DedicatedHostsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHostsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHostsDeleteFuture.Result. +func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DedicatedHostsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DedicatedHostsClient) (DedicatedHost, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DedicatedHostsUpdateFuture.Result. +func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dh.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { + dh, err = client.UpdateResponder(dh.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") + } + } + return +} + +// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and +// licenseType may be updated. +type DedicatedHostUpdate struct { + *DedicatedHostProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DedicatedHostUpdate. +func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dhu.DedicatedHostProperties != nil { + objectMap["properties"] = dhu.DedicatedHostProperties + } + if dhu.Tags != nil { + objectMap["tags"] = dhu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. +func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dedicatedHostProperties DedicatedHostProperties + err = json.Unmarshal(*v, &dedicatedHostProperties) + if err != nil { + return err + } + dhu.DedicatedHostProperties = &dedicatedHostProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dhu.Tags = tags + } + } + } + + return nil +} + +// DiagnosticsProfile specifies the boot diagnostic settings state.

Minimum api-version: +// 2015-06-15. +type DiagnosticsProfile struct { + // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.
**NOTE**: If storageUri is being specified then ensure that the storage account is in the same region and subscription as the VM.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor. + BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` +} + +// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating +// system disk.

NOTE: The ephemeral disk settings can only be specified for managed disk. +type DiffDiskSettings struct { + // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'DiffDiskOptionsLocal' + Option DiffDiskOptions `json:"option,omitempty"` + // Placement - Specifies the ephemeral disk placement for operating system disk.

Possible values are:

**CacheDisk**

**ResourceDisk**

Default: **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** is used.

Refer to VM size documentation for Windows VM at https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk. Possible values include: 'DiffDiskPlacementCacheDisk', 'DiffDiskPlacementResourceDisk' + Placement DiffDiskPlacement `json:"placement,omitempty"` +} + +// Disallowed describes the disallowed disk types. +type Disallowed struct { + // DiskTypes - A list of disk types. + DiskTypes *[]string `json:"diskTypes,omitempty"` +} + +// DisallowedConfiguration specifies the disallowed configuration for a virtual machine image. +type DisallowedConfiguration struct { + // VMDiskType - VM disk types which are disallowed. Possible values include: 'VMDiskTypesNone', 'VMDiskTypesUnmanaged' + VMDiskType VMDiskTypes `json:"vmDiskType,omitempty"` +} + +// Disk disk resource. +type Disk struct { + autorest.Response `json:"-"` + // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. + ManagedBy *string `json:"managedBy,omitempty"` + // ManagedByExtended - READ-ONLY; List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + ManagedByExtended *[]string `json:"managedByExtended,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + // Zones - The Logical zone list for Disk. + Zones *[]string `json:"zones,omitempty"` + // ExtendedLocation - The extended location where the disk will be created. Extended location cannot be changed. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + *DiskProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Disk. +func (d Disk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.Sku != nil { + objectMap["sku"] = d.Sku + } + if d.Zones != nil { + objectMap["zones"] = d.Zones + } + if d.ExtendedLocation != nil { + objectMap["extendedLocation"] = d.ExtendedLocation + } + if d.DiskProperties != nil { + objectMap["properties"] = d.DiskProperties + } + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Tags != nil { + objectMap["tags"] = d.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Disk struct. +func (d *Disk) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + d.ManagedBy = &managedBy + } + case "managedByExtended": + if v != nil { + var managedByExtended []string + err = json.Unmarshal(*v, &managedByExtended) + if err != nil { + return err + } + d.ManagedByExtended = &managedByExtended + } + case "sku": + if v != nil { + var sku DiskSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + d.Sku = &sku + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + d.Zones = &zones + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + d.ExtendedLocation = &extendedLocation + } + case "properties": + if v != nil { + var diskProperties DiskProperties + err = json.Unmarshal(*v, &diskProperties) + if err != nil { + return err + } + d.DiskProperties = &diskProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + d.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + } + } + + return nil +} + +// DiskAccess disk access resource. +type DiskAccess struct { + autorest.Response `json:"-"` + *DiskAccessProperties `json:"properties,omitempty"` + // ExtendedLocation - The extended location where the disk access will be created. Extended location cannot be changed. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DiskAccess. +func (da DiskAccess) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if da.DiskAccessProperties != nil { + objectMap["properties"] = da.DiskAccessProperties + } + if da.ExtendedLocation != nil { + objectMap["extendedLocation"] = da.ExtendedLocation + } + if da.Location != nil { + objectMap["location"] = da.Location + } + if da.Tags != nil { + objectMap["tags"] = da.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskAccess struct. +func (da *DiskAccess) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diskAccessProperties DiskAccessProperties + err = json.Unmarshal(*v, &diskAccessProperties) + if err != nil { + return err + } + da.DiskAccessProperties = &diskAccessProperties + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + da.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + da.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + da.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + da.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + da.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + da.Tags = tags + } + } + } + + return nil +} + +// DiskAccessesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskAccessesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskAccessesClient) (DiskAccess, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskAccessesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskAccessesCreateOrUpdateFuture.Result. +func (future *DiskAccessesCreateOrUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + da.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { + da, err = client.CreateOrUpdateResponder(da.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesCreateOrUpdateFuture", "Result", da.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskAccessesDeleteAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type DiskAccessesDeleteAPrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskAccessesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskAccessesDeleteAPrivateEndpointConnectionFuture.Result. +func (future *DiskAccessesDeleteAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteAPrivateEndpointConnectionFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskAccessesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskAccessesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskAccessesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskAccessesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskAccessesDeleteFuture.Result. +func (future *DiskAccessesDeleteFuture) result(client DiskAccessesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskAccessesUpdateAPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type DiskAccessesUpdateAPrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskAccessesClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskAccessesUpdateAPrivateEndpointConnectionFuture.Result. +func (future *DiskAccessesUpdateAPrivateEndpointConnectionFuture) result(client DiskAccessesClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.UpdateAPrivateEndpointConnectionResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateAPrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskAccessesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DiskAccessesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskAccessesClient) (DiskAccess, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskAccessesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskAccessesUpdateFuture.Result. +func (future *DiskAccessesUpdateFuture) result(client DiskAccessesClient) (da DiskAccess, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + da.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskAccessesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if da.Response.Response, err = future.GetResult(sender); err == nil && da.Response.Response.StatusCode != http.StatusNoContent { + da, err = client.UpdateResponder(da.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskAccessesUpdateFuture", "Result", da.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskAccessList the List disk access operation response. +type DiskAccessList struct { + autorest.Response `json:"-"` + // Value - A list of disk access resources. + Value *[]DiskAccess `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of disk access resources. Call ListNext() with this to fetch the next page of disk access resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiskAccessListIterator provides access to a complete listing of DiskAccess values. +type DiskAccessListIterator struct { + i int + page DiskAccessListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiskAccessListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiskAccessListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskAccessListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiskAccessListIterator) Response() DiskAccessList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiskAccessListIterator) Value() DiskAccess { + if !iter.page.NotDone() { + return DiskAccess{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskAccessListIterator type. +func NewDiskAccessListIterator(page DiskAccessListPage) DiskAccessListIterator { + return DiskAccessListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dal DiskAccessList) IsEmpty() bool { + return dal.Value == nil || len(*dal.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dal DiskAccessList) hasNextLink() bool { + return dal.NextLink != nil && len(*dal.NextLink) != 0 +} + +// diskAccessListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dal DiskAccessList) diskAccessListPreparer(ctx context.Context) (*http.Request, error) { + if !dal.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dal.NextLink))) +} + +// DiskAccessListPage contains a page of DiskAccess values. +type DiskAccessListPage struct { + fn func(context.Context, DiskAccessList) (DiskAccessList, error) + dal DiskAccessList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiskAccessListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskAccessListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dal) + if err != nil { + return err + } + page.dal = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiskAccessListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskAccessListPage) NotDone() bool { + return !page.dal.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskAccessListPage) Response() DiskAccessList { + return page.dal +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskAccessListPage) Values() []DiskAccess { + if page.dal.IsEmpty() { + return nil + } + return *page.dal.Value +} + +// Creates a new instance of the DiskAccessListPage type. +func NewDiskAccessListPage(cur DiskAccessList, getNextPage func(context.Context, DiskAccessList) (DiskAccessList, error)) DiskAccessListPage { + return DiskAccessListPage{ + fn: getNextPage, + dal: cur, + } +} + +// DiskAccessProperties ... +type DiskAccessProperties struct { + // PrivateEndpointConnections - READ-ONLY; A readonly collection of private endpoint connections created on the disk. Currently only one endpoint connection is supported. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // ProvisioningState - READ-ONLY; The disk access resource provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // TimeCreated - READ-ONLY; The time when the disk access was created. + TimeCreated *date.Time `json:"timeCreated,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskAccessProperties. +func (dap DiskAccessProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DiskAccessUpdate used for updating a disk access resource. +type DiskAccessUpdate struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DiskAccessUpdate. +func (dau DiskAccessUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dau.Tags != nil { + objectMap["tags"] = dau.Tags + } + return json.Marshal(objectMap) +} + +// DiskEncryptionSet disk encryption set resource. +type DiskEncryptionSet struct { + autorest.Response `json:"-"` + Identity *EncryptionSetIdentity `json:"identity,omitempty"` + *EncryptionSetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DiskEncryptionSet. +func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if desVar.Identity != nil { + objectMap["identity"] = desVar.Identity + } + if desVar.EncryptionSetProperties != nil { + objectMap["properties"] = desVar.EncryptionSetProperties + } + if desVar.Location != nil { + objectMap["location"] = desVar.Location + } + if desVar.Tags != nil { + objectMap["tags"] = desVar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. +func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity EncryptionSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + desVar.Identity = &identity + } + case "properties": + if v != nil { + var encryptionSetProperties EncryptionSetProperties + err = json.Unmarshal(*v, &encryptionSetProperties) + if err != nil { + return err + } + desVar.EncryptionSetProperties = &encryptionSetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + desVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + desVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + desVar.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + desVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + desVar.Tags = tags + } + } + } + + return nil +} + +// DiskEncryptionSetList the List disk encryption set operation response. +type DiskEncryptionSetList struct { + autorest.Response `json:"-"` + // Value - A list of disk encryption sets. + Value *[]DiskEncryptionSet `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. +type DiskEncryptionSetListIterator struct { + i int + page DiskEncryptionSetListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiskEncryptionSetListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskEncryptionSetListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { + if !iter.page.NotDone() { + return DiskEncryptionSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskEncryptionSetListIterator type. +func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { + return DiskEncryptionSetListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (desl DiskEncryptionSetList) IsEmpty() bool { + return desl.Value == nil || len(*desl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (desl DiskEncryptionSetList) hasNextLink() bool { + return desl.NextLink != nil && len(*desl.NextLink) != 0 +} + +// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { + if !desl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(desl.NextLink))) +} + +// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. +type DiskEncryptionSetListPage struct { + fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) + desl DiskEncryptionSetList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.desl) + if err != nil { + return err + } + page.desl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiskEncryptionSetListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskEncryptionSetListPage) NotDone() bool { + return !page.desl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { + return page.desl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { + if page.desl.IsEmpty() { + return nil + } + return *page.desl.Value +} + +// Creates a new instance of the DiskEncryptionSetListPage type. +func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { + return DiskEncryptionSetListPage{ + fn: getNextPage, + desl: cur, + } +} + +// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id +// that can be specified for disk.

NOTE: The disk encryption set resource id can only be specified +// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. +type DiskEncryptionSetParameters struct { + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskEncryptionSetsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. +func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + desVar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { + desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskEncryptionSetsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskEncryptionSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. +func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskEncryptionSetsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. +func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + desVar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { + desVar, err = client.UpdateResponder(desVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskEncryptionSettings describes a Encryption Settings for a Disk +type DiskEncryptionSettings struct { + // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. + DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` + // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. + KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` + // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. + Enabled *bool `json:"enabled,omitempty"` +} + +// DiskEncryptionSetUpdate disk encryption set update resource. +type DiskEncryptionSetUpdate struct { + *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + Identity *EncryptionSetIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. +func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if desu.DiskEncryptionSetUpdateProperties != nil { + objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties + } + if desu.Tags != nil { + objectMap["tags"] = desu.Tags + } + if desu.Identity != nil { + objectMap["identity"] = desu.Identity + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. +func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties + err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) + if err != nil { + return err + } + desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + desu.Tags = tags + } + case "identity": + if v != nil { + var identity EncryptionSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + desu.Identity = &identity + } + } + } + + return nil +} + +// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. +type DiskEncryptionSetUpdateProperties struct { + // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys', 'DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey' + EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` + ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` + // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. + RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` +} + +// DiskImageEncryption this is the disk image encryption base class. +type DiskImageEncryption struct { + // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// DiskInstanceView the instance view of the disk. +type DiskInstanceView struct { + // Name - The disk name. + Name *string `json:"name,omitempty"` + // EncryptionSettings - Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15 + EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// DiskList the List Disks operation response. +type DiskList struct { + autorest.Response `json:"-"` + // Value - A list of disks. + Value *[]Disk `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiskListIterator provides access to a complete listing of Disk values. +type DiskListIterator struct { + i int + page DiskListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiskListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiskListIterator) Response() DiskList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiskListIterator) Value() Disk { + if !iter.page.NotDone() { + return Disk{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskListIterator type. +func NewDiskListIterator(page DiskListPage) DiskListIterator { + return DiskListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dl DiskList) IsEmpty() bool { + return dl.Value == nil || len(*dl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dl DiskList) hasNextLink() bool { + return dl.NextLink != nil && len(*dl.NextLink) != 0 +} + +// diskListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { + if !dl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dl.NextLink))) +} + +// DiskListPage contains a page of Disk values. +type DiskListPage struct { + fn func(context.Context, DiskList) (DiskList, error) + dl DiskList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dl) + if err != nil { + return err + } + page.dl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiskListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskListPage) NotDone() bool { + return !page.dl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskListPage) Response() DiskList { + return page.dl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskListPage) Values() []Disk { + if page.dl.IsEmpty() { + return nil + } + return *page.dl.Value +} + +// Creates a new instance of the DiskListPage type. +func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { + return DiskListPage{ + fn: getNextPage, + dl: cur, + } +} + +// DiskProperties disk resource properties. +type DiskProperties struct { + // TimeCreated - READ-ONLY; The time when the disk was created. + TimeCreated *date.Time `json:"timeCreated,omitempty"` + // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` + // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. E.g. - {name: 2019-Datacenter, publisher: MicrosoftWindowsServer, product: WindowsServer} + PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` + // SupportedCapabilities - List of supported capabilities for the image from which the OS disk was created. + SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` + // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. + CreationData *CreationData `json:"creationData,omitempty"` + // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. + DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` + // UniqueID - READ-ONLY; Unique Guid identifying the resource. + UniqueID *string `json:"uniqueId,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` + // ProvisioningState - READ-ONLY; The disk provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` + // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` + // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` + // DiskState - The state of the disk. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateFrozen', 'DiskStateActiveSAS', 'DiskStateActiveSASFrozen', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' + DiskState DiskState `json:"diskState,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` + // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. + MaxShares *int32 `json:"maxShares,omitempty"` + // ShareInfo - READ-ONLY; Details of the list of all VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs. + ShareInfo *[]ShareInfoElement `json:"shareInfo,omitempty"` + // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' + NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` + // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. + DiskAccessID *string `json:"diskAccessId,omitempty"` + // Tier - Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + Tier *string `json:"tier,omitempty"` + // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. + BurstingEnabled *bool `json:"burstingEnabled,omitempty"` + // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. + PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` + // SupportsHibernation - Indicates the OS on a disk supports hibernation. + SupportsHibernation *bool `json:"supportsHibernation,omitempty"` + // SecurityProfile - Contains the security related information for the resource. + SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` + // CompletionPercent - Percentage complete for the background copy when a resource is created via the CopyStart operation. + CompletionPercent *float64 `json:"completionPercent,omitempty"` + // PublicNetworkAccess - Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskProperties. +func (dp DiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.OsType != "" { + objectMap["osType"] = dp.OsType + } + if dp.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = dp.HyperVGeneration + } + if dp.PurchasePlan != nil { + objectMap["purchasePlan"] = dp.PurchasePlan + } + if dp.SupportedCapabilities != nil { + objectMap["supportedCapabilities"] = dp.SupportedCapabilities + } + if dp.CreationData != nil { + objectMap["creationData"] = dp.CreationData + } + if dp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dp.DiskSizeGB + } + if dp.EncryptionSettingsCollection != nil { + objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection + } + if dp.DiskIOPSReadWrite != nil { + objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite + } + if dp.DiskMBpsReadWrite != nil { + objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite + } + if dp.DiskIOPSReadOnly != nil { + objectMap["diskIOPSReadOnly"] = dp.DiskIOPSReadOnly + } + if dp.DiskMBpsReadOnly != nil { + objectMap["diskMBpsReadOnly"] = dp.DiskMBpsReadOnly + } + if dp.DiskState != "" { + objectMap["diskState"] = dp.DiskState + } + if dp.Encryption != nil { + objectMap["encryption"] = dp.Encryption + } + if dp.MaxShares != nil { + objectMap["maxShares"] = dp.MaxShares + } + if dp.NetworkAccessPolicy != "" { + objectMap["networkAccessPolicy"] = dp.NetworkAccessPolicy + } + if dp.DiskAccessID != nil { + objectMap["diskAccessId"] = dp.DiskAccessID + } + if dp.Tier != nil { + objectMap["tier"] = dp.Tier + } + if dp.BurstingEnabled != nil { + objectMap["burstingEnabled"] = dp.BurstingEnabled + } + if dp.SupportsHibernation != nil { + objectMap["supportsHibernation"] = dp.SupportsHibernation + } + if dp.SecurityProfile != nil { + objectMap["securityProfile"] = dp.SecurityProfile + } + if dp.CompletionPercent != nil { + objectMap["completionPercent"] = dp.CompletionPercent + } + if dp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = dp.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// DiskRestorePoint properties of disk restore point +type DiskRestorePoint struct { + autorest.Response `json:"-"` + *DiskRestorePointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskRestorePoint. +func (drp DiskRestorePoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if drp.DiskRestorePointProperties != nil { + objectMap["properties"] = drp.DiskRestorePointProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskRestorePoint struct. +func (drp *DiskRestorePoint) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diskRestorePointProperties DiskRestorePointProperties + err = json.Unmarshal(*v, &diskRestorePointProperties) + if err != nil { + return err + } + drp.DiskRestorePointProperties = &diskRestorePointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + drp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + drp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + drp.Type = &typeVar + } + } + } + + return nil +} + +// DiskRestorePointGrantAccessFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskRestorePointGrantAccessFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskRestorePointClient) (AccessURI, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskRestorePointGrantAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskRestorePointGrantAccessFuture.Result. +func (future *DiskRestorePointGrantAccessFuture) result(client DiskRestorePointClient) (au AccessURI, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + au.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointGrantAccessFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { + au, err = client.GrantAccessResponder(au.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskRestorePointList the List Disk Restore Points operation response. +type DiskRestorePointList struct { + autorest.Response `json:"-"` + // Value - A list of disk restore points. + Value *[]DiskRestorePoint `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of disk restore points. Call ListNext() with this to fetch the next page of disk restore points. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiskRestorePointListIterator provides access to a complete listing of DiskRestorePoint values. +type DiskRestorePointListIterator struct { + i int + page DiskRestorePointListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiskRestorePointListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiskRestorePointListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskRestorePointListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiskRestorePointListIterator) Response() DiskRestorePointList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiskRestorePointListIterator) Value() DiskRestorePoint { + if !iter.page.NotDone() { + return DiskRestorePoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskRestorePointListIterator type. +func NewDiskRestorePointListIterator(page DiskRestorePointListPage) DiskRestorePointListIterator { + return DiskRestorePointListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (drpl DiskRestorePointList) IsEmpty() bool { + return drpl.Value == nil || len(*drpl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (drpl DiskRestorePointList) hasNextLink() bool { + return drpl.NextLink != nil && len(*drpl.NextLink) != 0 +} + +// diskRestorePointListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (drpl DiskRestorePointList) diskRestorePointListPreparer(ctx context.Context) (*http.Request, error) { + if !drpl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(drpl.NextLink))) +} + +// DiskRestorePointListPage contains a page of DiskRestorePoint values. +type DiskRestorePointListPage struct { + fn func(context.Context, DiskRestorePointList) (DiskRestorePointList, error) + drpl DiskRestorePointList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiskRestorePointListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskRestorePointListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.drpl) + if err != nil { + return err + } + page.drpl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiskRestorePointListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskRestorePointListPage) NotDone() bool { + return !page.drpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskRestorePointListPage) Response() DiskRestorePointList { + return page.drpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskRestorePointListPage) Values() []DiskRestorePoint { + if page.drpl.IsEmpty() { + return nil + } + return *page.drpl.Value +} + +// Creates a new instance of the DiskRestorePointListPage type. +func NewDiskRestorePointListPage(cur DiskRestorePointList, getNextPage func(context.Context, DiskRestorePointList) (DiskRestorePointList, error)) DiskRestorePointListPage { + return DiskRestorePointListPage{ + fn: getNextPage, + drpl: cur, + } +} + +// DiskRestorePointProperties properties of an incremental disk restore point +type DiskRestorePointProperties struct { + // TimeCreated - READ-ONLY; The timestamp of restorePoint creation + TimeCreated *date.Time `json:"timeCreated,omitempty"` + // SourceResourceID - READ-ONLY; arm id of source disk or source disk restore point. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + // OsType - READ-ONLY; The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` + // PurchasePlan - Purchase plan information for the the image from which the OS disk was created. + PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` + // SupportedCapabilities - List of supported capabilities (like accelerated networking) for the image from which the OS disk was created. + SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` + // FamilyID - READ-ONLY; id of the backing snapshot's MIS family + FamilyID *string `json:"familyId,omitempty"` + // SourceUniqueID - READ-ONLY; unique incarnation id of the source disk + SourceUniqueID *string `json:"sourceUniqueId,omitempty"` + // Encryption - READ-ONLY; Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` + // SupportsHibernation - Indicates the OS on a disk supports hibernation. + SupportsHibernation *bool `json:"supportsHibernation,omitempty"` + // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' + NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` + // PublicNetworkAccess - Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. + DiskAccessID *string `json:"diskAccessId,omitempty"` + // CompletionPercent - Percentage complete for the background copy of disk restore point when source resource is from a different region. + CompletionPercent *float64 `json:"completionPercent,omitempty"` + // ReplicationState - READ-ONLY; Replication state of disk restore point when source resource is from a different region. + ReplicationState *string `json:"replicationState,omitempty"` + // SourceResourceLocation - READ-ONLY; Location of source disk or source disk restore point when source resource is from a different region. + SourceResourceLocation *string `json:"sourceResourceLocation,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskRestorePointProperties. +func (drpp DiskRestorePointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if drpp.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = drpp.HyperVGeneration + } + if drpp.PurchasePlan != nil { + objectMap["purchasePlan"] = drpp.PurchasePlan + } + if drpp.SupportedCapabilities != nil { + objectMap["supportedCapabilities"] = drpp.SupportedCapabilities + } + if drpp.SupportsHibernation != nil { + objectMap["supportsHibernation"] = drpp.SupportsHibernation + } + if drpp.NetworkAccessPolicy != "" { + objectMap["networkAccessPolicy"] = drpp.NetworkAccessPolicy + } + if drpp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = drpp.PublicNetworkAccess + } + if drpp.DiskAccessID != nil { + objectMap["diskAccessId"] = drpp.DiskAccessID + } + if drpp.CompletionPercent != nil { + objectMap["completionPercent"] = drpp.CompletionPercent + } + return json.Marshal(objectMap) +} + +// DiskRestorePointRevokeAccessFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DiskRestorePointRevokeAccessFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DiskRestorePointClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DiskRestorePointRevokeAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DiskRestorePointRevokeAccessFuture.Result. +func (future *DiskRestorePointRevokeAccessFuture) result(client DiskRestorePointClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DiskRestorePointRevokeAccessFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DiskRestorePointRevokeAccessFuture") + return + } + ar.Response = future.Response() + return +} + +// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DisksCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (Disk, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DisksCreateOrUpdateFuture.Result. +func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + d.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.CreateOrUpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} + +// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type DisksDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DisksDeleteFuture.Result. +func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DiskSecurityProfile contains the security related information for the resource. +type DiskSecurityProfile struct { + // SecurityType - Possible values include: 'DiskSecurityTypesTrustedLaunch', 'DiskSecurityTypesConfidentialVMVMGuestStateOnlyEncryptedWithPlatformKey', 'DiskSecurityTypesConfidentialVMDiskEncryptedWithPlatformKey', 'DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey' + SecurityType DiskSecurityTypes `json:"securityType,omitempty"` + // SecureVMDiskEncryptionSetID - ResourceId of the disk encryption set associated to Confidential VM supported disk encrypted with customer managed key + SecureVMDiskEncryptionSetID *string `json:"secureVMDiskEncryptionSetId,omitempty"` +} + +// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DisksGrantAccessFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (AccessURI, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DisksGrantAccessFuture.Result. +func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + au.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { + au, err = client.GrantAccessResponder(au.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, +// Premium_ZRS, or StandardSSD_ZRS. +type DiskSku struct { + // Name - The sku name. Possible values include: 'DiskStorageAccountTypesStandardLRS', 'DiskStorageAccountTypesPremiumLRS', 'DiskStorageAccountTypesStandardSSDLRS', 'DiskStorageAccountTypesUltraSSDLRS', 'DiskStorageAccountTypesPremiumZRS', 'DiskStorageAccountTypesStandardSSDZRS' + Name DiskStorageAccountTypes `json:"name,omitempty"` + // Tier - READ-ONLY; The sku tier. + Tier *string `json:"tier,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskSku. +func (ds DiskSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ds.Name != "" { + objectMap["name"] = ds.Name + } + return json.Marshal(objectMap) +} + +// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DisksRevokeAccessFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DisksRevokeAccessFuture.Result. +func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") + return + } + ar.Response = future.Response() + return +} + +// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type DisksUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DisksClient) (Disk, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DisksUpdateFuture.Result. +func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + d.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.UpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} + +// DiskUpdate disk update resource. +type DiskUpdate struct { + *DiskUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + Sku *DiskSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskUpdate. +func (du DiskUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if du.DiskUpdateProperties != nil { + objectMap["properties"] = du.DiskUpdateProperties + } + if du.Tags != nil { + objectMap["tags"] = du.Tags + } + if du.Sku != nil { + objectMap["sku"] = du.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. +func (du *DiskUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diskUpdateProperties DiskUpdateProperties + err = json.Unmarshal(*v, &diskUpdateProperties) + if err != nil { + return err + } + du.DiskUpdateProperties = &diskUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + du.Tags = tags + } + case "sku": + if v != nil { + var sku DiskSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + du.Sku = &sku + } + } + } + + return nil +} + +// DiskUpdateProperties disk resource update properties. +type DiskUpdateProperties struct { + // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` + // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` + // DiskIOPSReadOnly - The total number of IOPS that will be allowed across all VMs mounting the shared disk as ReadOnly. One operation can transfer between 4k and 256k bytes. + DiskIOPSReadOnly *int64 `json:"diskIOPSReadOnly,omitempty"` + // DiskMBpsReadOnly - The total throughput (MBps) that will be allowed across all VMs mounting the shared disk as ReadOnly. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. + DiskMBpsReadOnly *int64 `json:"diskMBpsReadOnly,omitempty"` + // MaxShares - The maximum number of VMs that can attach to the disk at the same time. Value greater than one indicates a disk that can be mounted on multiple VMs at the same time. + MaxShares *int32 `json:"maxShares,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` + // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' + NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` + // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. + DiskAccessID *string `json:"diskAccessId,omitempty"` + // Tier - Performance tier of the disk (e.g, P4, S10) as described here: https://azure.microsoft.com/en-us/pricing/details/managed-disks/. Does not apply to Ultra disks. + Tier *string `json:"tier,omitempty"` + // BurstingEnabled - Set to true to enable bursting beyond the provisioned performance target of the disk. Bursting is disabled by default. Does not apply to Ultra disks. + BurstingEnabled *bool `json:"burstingEnabled,omitempty"` + // PurchasePlan - Purchase plan information to be added on the OS disk + PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` + // SupportedCapabilities - List of supported capabilities (like accelerated networking) to be added on the OS disk. + SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` + // PropertyUpdatesInProgress - READ-ONLY; Properties of the disk for which update is pending. + PropertyUpdatesInProgress *PropertyUpdatesInProgress `json:"propertyUpdatesInProgress,omitempty"` + // SupportsHibernation - Indicates the OS on a disk supports hibernation. + SupportsHibernation *bool `json:"supportsHibernation,omitempty"` + // PublicNetworkAccess - Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiskUpdateProperties. +func (dup DiskUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dup.OsType != "" { + objectMap["osType"] = dup.OsType + } + if dup.DiskSizeGB != nil { + objectMap["diskSizeGB"] = dup.DiskSizeGB + } + if dup.EncryptionSettingsCollection != nil { + objectMap["encryptionSettingsCollection"] = dup.EncryptionSettingsCollection + } + if dup.DiskIOPSReadWrite != nil { + objectMap["diskIOPSReadWrite"] = dup.DiskIOPSReadWrite + } + if dup.DiskMBpsReadWrite != nil { + objectMap["diskMBpsReadWrite"] = dup.DiskMBpsReadWrite + } + if dup.DiskIOPSReadOnly != nil { + objectMap["diskIOPSReadOnly"] = dup.DiskIOPSReadOnly + } + if dup.DiskMBpsReadOnly != nil { + objectMap["diskMBpsReadOnly"] = dup.DiskMBpsReadOnly + } + if dup.MaxShares != nil { + objectMap["maxShares"] = dup.MaxShares + } + if dup.Encryption != nil { + objectMap["encryption"] = dup.Encryption + } + if dup.NetworkAccessPolicy != "" { + objectMap["networkAccessPolicy"] = dup.NetworkAccessPolicy + } + if dup.DiskAccessID != nil { + objectMap["diskAccessId"] = dup.DiskAccessID + } + if dup.Tier != nil { + objectMap["tier"] = dup.Tier + } + if dup.BurstingEnabled != nil { + objectMap["burstingEnabled"] = dup.BurstingEnabled + } + if dup.PurchasePlan != nil { + objectMap["purchasePlan"] = dup.PurchasePlan + } + if dup.SupportedCapabilities != nil { + objectMap["supportedCapabilities"] = dup.SupportedCapabilities + } + if dup.SupportsHibernation != nil { + objectMap["supportsHibernation"] = dup.SupportsHibernation + } + if dup.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = dup.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// Encryption encryption at rest settings for disk or snapshot +type Encryption struct { + // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` + // Type - Possible values include: 'EncryptionTypeEncryptionAtRestWithPlatformKey', 'EncryptionTypeEncryptionAtRestWithCustomerKey', 'EncryptionTypeEncryptionAtRestWithPlatformAndCustomerKeys' + Type EncryptionType `json:"type,omitempty"` +} + +// EncryptionImages optional. Allows users to provide customer managed keys for encrypting the OS and data +// disks in the gallery artifact. +type EncryptionImages struct { + OsDiskImage *OSDiskImageEncryption `json:"osDiskImage,omitempty"` + // DataDiskImages - A list of encryption specifications for data disk images. + DataDiskImages *[]DataDiskImageEncryption `json:"dataDiskImages,omitempty"` +} + +// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on +// the key vault before it can be used to encrypt disks. +type EncryptionSetIdentity struct { + // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations. Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active Directory tenant; it will cause the encrypted resources to lose access to the keys. Possible values include: 'DiskEncryptionSetIdentityTypeSystemAssigned', 'DiskEncryptionSetIdentityTypeNone' + Type DiskEncryptionSetIdentityType `json:"type,omitempty"` + // PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity + TenantID *string `json:"tenantId,omitempty"` +} + +// MarshalJSON is the custom marshaler for EncryptionSetIdentity. +func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esi.Type != "" { + objectMap["type"] = esi.Type + } + return json.Marshal(objectMap) +} + +// EncryptionSetProperties ... +type EncryptionSetProperties struct { + // EncryptionType - Possible values include: 'DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey', 'DiskEncryptionSetTypeEncryptionAtRestWithPlatformAndCustomerKeys', 'DiskEncryptionSetTypeConfidentialVMEncryptedWithCustomerKey' + EncryptionType DiskEncryptionSetType `json:"encryptionType,omitempty"` + // ActiveKey - The key vault key which is currently used by this disk encryption set. + ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"` + // PreviousKeys - READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. + PreviousKeys *[]KeyForDiskEncryptionSet `json:"previousKeys,omitempty"` + // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RotationToLatestKeyVersionEnabled - Set this flag to true to enable auto-updating of this disk encryption set to the latest key version. + RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"` + // LastKeyRotationTimestamp - READ-ONLY; The time when the active key of this disk encryption set was updated. + LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` + // AutoKeyRotationError - READ-ONLY; The error that was encountered during auto-key rotation. If an error is present, then auto-key rotation will not be attempted until the error on this disk encryption set is fixed. + AutoKeyRotationError *APIError `json:"autoKeyRotationError,omitempty"` +} + +// MarshalJSON is the custom marshaler for EncryptionSetProperties. +func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if esp.EncryptionType != "" { + objectMap["encryptionType"] = esp.EncryptionType + } + if esp.ActiveKey != nil { + objectMap["activeKey"] = esp.ActiveKey + } + if esp.RotationToLatestKeyVersionEnabled != nil { + objectMap["rotationToLatestKeyVersionEnabled"] = esp.RotationToLatestKeyVersionEnabled + } + return json.Marshal(objectMap) +} + +// EncryptionSettingsCollection encryption settings for disk or snapshot +type EncryptionSettingsCollection struct { + // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. + Enabled *bool `json:"enabled,omitempty"` + // EncryptionSettings - A collection of encryption settings, one for each disk volume. + EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` + // EncryptionSettingsVersion - Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. + EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` +} + +// EncryptionSettingsElement encryption settings for one disk volume. +type EncryptionSettingsElement struct { + // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key + DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` + // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. + KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` +} + +// ExtendedLocation the complex type of the extended location. +type ExtendedLocation struct { + // Name - The name of the extended location. + Name *string `json:"name,omitempty"` + // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' + Type ExtendedLocationTypes `json:"type,omitempty"` +} + +// Extension describes a cloud service Extension. +type Extension struct { + // Name - The name of the extension. + Name *string `json:"name,omitempty"` + Properties *CloudServiceExtensionProperties `json:"properties,omitempty"` +} + +// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type GalleriesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleriesClient) (Gallery, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. +func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + g.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { + g, err = client.CreateOrUpdateResponder(g.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type GalleriesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleriesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleriesDeleteFuture.Result. +func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type GalleriesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleriesClient) (Gallery, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleriesUpdateFuture.Result. +func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + g.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { + g, err = client.UpdateResponder(g.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") + } + } + return +} + +// Gallery specifies information about the Shared Image Gallery that you want to create or update. +type Gallery struct { + autorest.Response `json:"-"` + *GalleryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Gallery. +func (g Gallery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if g.GalleryProperties != nil { + objectMap["properties"] = g.GalleryProperties + } + if g.Location != nil { + objectMap["location"] = g.Location + } + if g.Tags != nil { + objectMap["tags"] = g.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Gallery struct. +func (g *Gallery) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryProperties GalleryProperties + err = json.Unmarshal(*v, &galleryProperties) + if err != nil { + return err + } + g.GalleryProperties = &galleryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + g.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + g.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + g.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + g.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + g.Tags = tags + } + } + } + + return nil +} + +// GalleryApplication specifies information about the gallery Application Definition that you want to +// create or update. +type GalleryApplication struct { + autorest.Response `json:"-"` + *GalleryApplicationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryApplication. +func (ga GalleryApplication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ga.GalleryApplicationProperties != nil { + objectMap["properties"] = ga.GalleryApplicationProperties + } + if ga.Location != nil { + objectMap["location"] = ga.Location + } + if ga.Tags != nil { + objectMap["tags"] = ga.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. +func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryApplicationProperties GalleryApplicationProperties + err = json.Unmarshal(*v, &galleryApplicationProperties) + if err != nil { + return err + } + ga.GalleryApplicationProperties = &galleryApplicationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ga.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ga.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ga.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ga.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ga.Tags = tags + } + } + } + + return nil +} + +// GalleryApplicationList the List Gallery Applications operation response. +type GalleryApplicationList struct { + autorest.Response `json:"-"` + // Value - A list of Gallery Applications. + Value *[]GalleryApplication `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. + NextLink *string `json:"nextLink,omitempty"` +} + +// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. +type GalleryApplicationListIterator struct { + i int + page GalleryApplicationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GalleryApplicationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GalleryApplicationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GalleryApplicationListIterator) Value() GalleryApplication { + if !iter.page.NotDone() { + return GalleryApplication{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GalleryApplicationListIterator type. +func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { + return GalleryApplicationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (gal GalleryApplicationList) IsEmpty() bool { + return gal.Value == nil || len(*gal.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (gal GalleryApplicationList) hasNextLink() bool { + return gal.NextLink != nil && len(*gal.NextLink) != 0 +} + +// galleryApplicationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { + if !gal.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(gal.NextLink))) +} + +// GalleryApplicationListPage contains a page of GalleryApplication values. +type GalleryApplicationListPage struct { + fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) + gal GalleryApplicationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.gal) + if err != nil { + return err + } + page.gal = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GalleryApplicationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GalleryApplicationListPage) NotDone() bool { + return !page.gal.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GalleryApplicationListPage) Response() GalleryApplicationList { + return page.gal +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GalleryApplicationListPage) Values() []GalleryApplication { + if page.gal.IsEmpty() { + return nil + } + return *page.gal.Value +} + +// Creates a new instance of the GalleryApplicationListPage type. +func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { + return GalleryApplicationListPage{ + fn: getNextPage, + gal: cur, + } +} + +// GalleryApplicationProperties describes the properties of a gallery Application Definition. +type GalleryApplicationProperties struct { + // Description - The description of this gallery Application Definition resource. This property is updatable. + Description *string `json:"description,omitempty"` + // Eula - The Eula agreement for the gallery Application Definition. + Eula *string `json:"eula,omitempty"` + // PrivacyStatementURI - The privacy statement uri. + PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` + // ReleaseNoteURI - The release note uri. + ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` + // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // SupportedOSType - This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

**Windows**

**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` +} + +// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryApplicationsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationsClient) (GalleryApplication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. +func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ga.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { + ga, err = client.CreateOrUpdateResponder(ga.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryApplicationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryApplicationsDeleteFuture.Result. +func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryApplicationsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationsClient) (GalleryApplication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryApplicationsUpdateFuture.Result. +func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ga.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { + ga, err = client.UpdateResponder(ga.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to +// update. +type GalleryApplicationUpdate struct { + *GalleryApplicationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. +func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gau.GalleryApplicationProperties != nil { + objectMap["properties"] = gau.GalleryApplicationProperties + } + if gau.Tags != nil { + objectMap["tags"] = gau.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. +func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryApplicationProperties GalleryApplicationProperties + err = json.Unmarshal(*v, &galleryApplicationProperties) + if err != nil { + return err + } + gau.GalleryApplicationProperties = &galleryApplicationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gau.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gau.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gau.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gau.Tags = tags + } + } + } + + return nil +} + +// GalleryApplicationVersion specifies information about the gallery Application Version that you want to +// create or update. +type GalleryApplicationVersion struct { + autorest.Response `json:"-"` + *GalleryApplicationVersionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryApplicationVersion. +func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gav.GalleryApplicationVersionProperties != nil { + objectMap["properties"] = gav.GalleryApplicationVersionProperties + } + if gav.Location != nil { + objectMap["location"] = gav.Location + } + if gav.Tags != nil { + objectMap["tags"] = gav.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. +func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryApplicationVersionProperties GalleryApplicationVersionProperties + err = json.Unmarshal(*v, &galleryApplicationVersionProperties) + if err != nil { + return err + } + gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gav.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gav.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gav.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gav.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gav.Tags = tags + } + } + } + + return nil +} + +// GalleryApplicationVersionList the List Gallery Application version operation response. +type GalleryApplicationVersionList struct { + autorest.Response `json:"-"` + // Value - A list of gallery Application Versions. + Value *[]GalleryApplicationVersion `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. + NextLink *string `json:"nextLink,omitempty"` +} + +// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion +// values. +type GalleryApplicationVersionListIterator struct { + i int + page GalleryApplicationVersionListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GalleryApplicationVersionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GalleryApplicationVersionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { + if !iter.page.NotDone() { + return GalleryApplicationVersion{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GalleryApplicationVersionListIterator type. +func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { + return GalleryApplicationVersionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (gavl GalleryApplicationVersionList) IsEmpty() bool { + return gavl.Value == nil || len(*gavl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (gavl GalleryApplicationVersionList) hasNextLink() bool { + return gavl.NextLink != nil && len(*gavl.NextLink) != 0 +} + +// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { + if !gavl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(gavl.NextLink))) +} + +// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. +type GalleryApplicationVersionListPage struct { + fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) + gavl GalleryApplicationVersionList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.gavl) + if err != nil { + return err + } + page.gavl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GalleryApplicationVersionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GalleryApplicationVersionListPage) NotDone() bool { + return !page.gavl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { + return page.gavl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { + if page.gavl.IsEmpty() { + return nil + } + return *page.gavl.Value +} + +// Creates a new instance of the GalleryApplicationVersionListPage type. +func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { + return GalleryApplicationVersionListPage{ + fn: getNextPage, + gavl: cur, + } +} + +// GalleryApplicationVersionProperties describes the properties of a gallery image version. +type GalleryApplicationVersionProperties struct { + PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' + ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` + // ReplicationStatus - READ-ONLY + ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. +func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gavp.PublishingProfile != nil { + objectMap["publishingProfile"] = gavp.PublishingProfile + } + return json.Marshal(objectMap) +} + +// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery image version. +type GalleryApplicationVersionPublishingProfile struct { + Source *UserArtifactSource `json:"source,omitempty"` + ManageActions *UserArtifactManage `json:"manageActions,omitempty"` + // EnableHealthCheck - Optional. Whether or not this application reports health. + EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` + // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. + TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` + // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. + ReplicaCount *int32 `json:"replicaCount,omitempty"` + // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. + ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` + // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. + PublishedDate *date.Time `json:"publishedDate,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'ReplicationModeFull', 'ReplicationModeShallow' + ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. +func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gavpp.Source != nil { + objectMap["source"] = gavpp.Source + } + if gavpp.ManageActions != nil { + objectMap["manageActions"] = gavpp.ManageActions + } + if gavpp.EnableHealthCheck != nil { + objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck + } + if gavpp.TargetRegions != nil { + objectMap["targetRegions"] = gavpp.TargetRegions + } + if gavpp.ReplicaCount != nil { + objectMap["replicaCount"] = gavpp.ReplicaCount + } + if gavpp.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest + } + if gavpp.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate + } + if gavpp.StorageAccountType != "" { + objectMap["storageAccountType"] = gavpp.StorageAccountType + } + if gavpp.ReplicationMode != "" { + objectMap["replicationMode"] = gavpp.ReplicationMode + } + return json.Marshal(objectMap) +} + +// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type GalleryApplicationVersionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. +func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gav.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { + gav, err = client.CreateOrUpdateResponder(gav.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryApplicationVersionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationVersionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. +func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryApplicationVersionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. +func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gav.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { + gav, err = client.UpdateResponder(gav.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you +// want to update. +type GalleryApplicationVersionUpdate struct { + *GalleryApplicationVersionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. +func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gavu.GalleryApplicationVersionProperties != nil { + objectMap["properties"] = gavu.GalleryApplicationVersionProperties + } + if gavu.Tags != nil { + objectMap["tags"] = gavu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. +func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryApplicationVersionProperties GalleryApplicationVersionProperties + err = json.Unmarshal(*v, &galleryApplicationVersionProperties) + if err != nil { + return err + } + gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gavu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gavu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gavu.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gavu.Tags = tags + } + } + } + + return nil +} + +// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. +type GalleryArtifactPublishingProfileBase struct { + // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. + TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` + // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. + ReplicaCount *int32 `json:"replicaCount,omitempty"` + // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. + ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` + // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. + PublishedDate *date.Time `json:"publishedDate,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'ReplicationModeFull', 'ReplicationModeShallow' + ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. +func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gappb.TargetRegions != nil { + objectMap["targetRegions"] = gappb.TargetRegions + } + if gappb.ReplicaCount != nil { + objectMap["replicaCount"] = gappb.ReplicaCount + } + if gappb.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest + } + if gappb.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gappb.EndOfLifeDate + } + if gappb.StorageAccountType != "" { + objectMap["storageAccountType"] = gappb.StorageAccountType + } + if gappb.ReplicationMode != "" { + objectMap["replicationMode"] = gappb.ReplicationMode + } + return json.Marshal(objectMap) +} + +// GalleryArtifactSource the source image from which the Image Version is going to be created. +type GalleryArtifactSource struct { + ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` +} + +// GalleryArtifactVersionSource the gallery artifact version source. +type GalleryArtifactVersionSource struct { + // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. + ID *string `json:"id,omitempty"` + // URI - The uri of the gallery artifact version source. Currently used to specify vhd/blob source. + URI *string `json:"uri,omitempty"` +} + +// GalleryDataDiskImage this is the data disk image. +type GalleryDataDiskImage struct { + // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. + Lun *int32 `json:"lun,omitempty"` + // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. + SizeInGB *int32 `json:"sizeInGB,omitempty"` + // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' + HostCaching HostCaching `json:"hostCaching,omitempty"` + Source *GalleryArtifactVersionSource `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryDataDiskImage. +func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gddi.Lun != nil { + objectMap["lun"] = gddi.Lun + } + if gddi.HostCaching != "" { + objectMap["hostCaching"] = gddi.HostCaching + } + if gddi.Source != nil { + objectMap["source"] = gddi.Source + } + return json.Marshal(objectMap) +} + +// GalleryDiskImage this is the disk image base class. +type GalleryDiskImage struct { + // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. + SizeInGB *int32 `json:"sizeInGB,omitempty"` + // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' + HostCaching HostCaching `json:"hostCaching,omitempty"` + Source *GalleryArtifactVersionSource `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryDiskImage. +func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gdi.HostCaching != "" { + objectMap["hostCaching"] = gdi.HostCaching + } + if gdi.Source != nil { + objectMap["source"] = gdi.Source + } + return json.Marshal(objectMap) +} + +// GalleryIdentifier describes the gallery unique name. +type GalleryIdentifier struct { + // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. + UniqueName *string `json:"uniqueName,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryIdentifier. +func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GalleryImage specifies information about the gallery image definition that you want to create or update. +type GalleryImage struct { + autorest.Response `json:"-"` + *GalleryImageProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryImage. +func (gi GalleryImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gi.GalleryImageProperties != nil { + objectMap["properties"] = gi.GalleryImageProperties + } + if gi.Location != nil { + objectMap["location"] = gi.Location + } + if gi.Tags != nil { + objectMap["tags"] = gi.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. +func (gi *GalleryImage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryImageProperties GalleryImageProperties + err = json.Unmarshal(*v, &galleryImageProperties) + if err != nil { + return err + } + gi.GalleryImageProperties = &galleryImageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gi.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + gi.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gi.Tags = tags + } + } + } + + return nil +} + +// GalleryImageFeature a feature for gallery image. +type GalleryImageFeature struct { + // Name - The name of the gallery image feature. + Name *string `json:"name,omitempty"` + // Value - The value of the gallery image feature. + Value *string `json:"value,omitempty"` +} + +// GalleryImageIdentifier this is the gallery image definition identifier. +type GalleryImageIdentifier struct { + // Publisher - The name of the gallery image definition publisher. + Publisher *string `json:"publisher,omitempty"` + // Offer - The name of the gallery image definition offer. + Offer *string `json:"offer,omitempty"` + // Sku - The name of the gallery image definition SKU. + Sku *string `json:"sku,omitempty"` +} + +// GalleryImageList the List Gallery Images operation response. +type GalleryImageList struct { + autorest.Response `json:"-"` + // Value - A list of Shared Image Gallery images. + Value *[]GalleryImage `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery image definitions. + NextLink *string `json:"nextLink,omitempty"` +} + +// GalleryImageListIterator provides access to a complete listing of GalleryImage values. +type GalleryImageListIterator struct { + i int + page GalleryImageListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GalleryImageListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GalleryImageListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GalleryImageListIterator) Response() GalleryImageList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GalleryImageListIterator) Value() GalleryImage { + if !iter.page.NotDone() { + return GalleryImage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GalleryImageListIterator type. +func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { + return GalleryImageListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (gil GalleryImageList) IsEmpty() bool { + return gil.Value == nil || len(*gil.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (gil GalleryImageList) hasNextLink() bool { + return gil.NextLink != nil && len(*gil.NextLink) != 0 +} + +// galleryImageListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { + if !gil.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(gil.NextLink))) +} + +// GalleryImageListPage contains a page of GalleryImage values. +type GalleryImageListPage struct { + fn func(context.Context, GalleryImageList) (GalleryImageList, error) + gil GalleryImageList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.gil) + if err != nil { + return err + } + page.gil = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GalleryImageListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GalleryImageListPage) NotDone() bool { + return !page.gil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GalleryImageListPage) Response() GalleryImageList { + return page.gil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GalleryImageListPage) Values() []GalleryImage { + if page.gil.IsEmpty() { + return nil + } + return *page.gil.Value +} + +// Creates a new instance of the GalleryImageListPage type. +func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { + return GalleryImageListPage{ + fn: getNextPage, + gil: cur, + } +} + +// GalleryImageProperties describes the properties of a gallery image definition. +type GalleryImageProperties struct { + // Description - The description of this gallery image definition resource. This property is updatable. + Description *string `json:"description,omitempty"` + // Eula - The Eula agreement for the gallery image definition. + Eula *string `json:"eula,omitempty"` + // PrivacyStatementURI - The privacy statement uri. + PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` + // ReleaseNoteURI - The release note uri. + ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` + // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' + OsState OperatingSystemStateTypes `json:"osState,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` + Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` + Disallowed *Disallowed `json:"disallowed,omitempty"` + PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' + ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` + // Features - A list of gallery image features. + Features *[]GalleryImageFeature `json:"features,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryImageProperties. +func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gip.Description != nil { + objectMap["description"] = gip.Description + } + if gip.Eula != nil { + objectMap["eula"] = gip.Eula + } + if gip.PrivacyStatementURI != nil { + objectMap["privacyStatementUri"] = gip.PrivacyStatementURI + } + if gip.ReleaseNoteURI != nil { + objectMap["releaseNoteUri"] = gip.ReleaseNoteURI + } + if gip.OsType != "" { + objectMap["osType"] = gip.OsType + } + if gip.OsState != "" { + objectMap["osState"] = gip.OsState + } + if gip.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = gip.HyperVGeneration + } + if gip.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = gip.EndOfLifeDate + } + if gip.Identifier != nil { + objectMap["identifier"] = gip.Identifier + } + if gip.Recommended != nil { + objectMap["recommended"] = gip.Recommended + } + if gip.Disallowed != nil { + objectMap["disallowed"] = gip.Disallowed + } + if gip.PurchasePlan != nil { + objectMap["purchasePlan"] = gip.PurchasePlan + } + if gip.Features != nil { + objectMap["features"] = gip.Features + } + return json.Marshal(objectMap) +} + +// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryImagesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImagesClient) (GalleryImage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. +func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { + gi, err = client.CreateOrUpdateResponder(gi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type GalleryImagesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImagesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryImagesDeleteFuture.Result. +func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type GalleryImagesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImagesClient) (GalleryImage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryImagesUpdateFuture.Result. +func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + gi.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { + gi, err = client.UpdateResponder(gi.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryImageUpdate specifies information about the gallery image definition that you want to update. +type GalleryImageUpdate struct { + *GalleryImageProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryImageUpdate. +func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if giu.GalleryImageProperties != nil { + objectMap["properties"] = giu.GalleryImageProperties + } + if giu.Tags != nil { + objectMap["tags"] = giu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. +func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryImageProperties GalleryImageProperties + err = json.Unmarshal(*v, &galleryImageProperties) + if err != nil { + return err + } + giu.GalleryImageProperties = &galleryImageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + giu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + giu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + giu.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + giu.Tags = tags + } + } + } + + return nil +} + +// GalleryImageVersion specifies information about the gallery image version that you want to create or +// update. +type GalleryImageVersion struct { + autorest.Response `json:"-"` + *GalleryImageVersionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryImageVersion. +func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if giv.GalleryImageVersionProperties != nil { + objectMap["properties"] = giv.GalleryImageVersionProperties + } + if giv.Location != nil { + objectMap["location"] = giv.Location + } + if giv.Tags != nil { + objectMap["tags"] = giv.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. +func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryImageVersionProperties GalleryImageVersionProperties + err = json.Unmarshal(*v, &galleryImageVersionProperties) + if err != nil { + return err + } + giv.GalleryImageVersionProperties = &galleryImageVersionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + giv.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + giv.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + giv.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + giv.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + giv.Tags = tags + } + } + } + + return nil +} + +// GalleryImageVersionList the List Gallery Image version operation response. +type GalleryImageVersionList struct { + autorest.Response `json:"-"` + // Value - A list of gallery image versions. + Value *[]GalleryImageVersion `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of gallery image versions. Call ListNext() with this to fetch the next page of gallery image versions. + NextLink *string `json:"nextLink,omitempty"` +} + +// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. +type GalleryImageVersionListIterator struct { + i int + page GalleryImageVersionListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GalleryImageVersionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GalleryImageVersionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { + if !iter.page.NotDone() { + return GalleryImageVersion{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GalleryImageVersionListIterator type. +func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { + return GalleryImageVersionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (givl GalleryImageVersionList) IsEmpty() bool { + return givl.Value == nil || len(*givl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (givl GalleryImageVersionList) hasNextLink() bool { + return givl.NextLink != nil && len(*givl.NextLink) != 0 +} + +// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { + if !givl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(givl.NextLink))) +} + +// GalleryImageVersionListPage contains a page of GalleryImageVersion values. +type GalleryImageVersionListPage struct { + fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) + givl GalleryImageVersionList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.givl) + if err != nil { + return err + } + page.givl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GalleryImageVersionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GalleryImageVersionListPage) NotDone() bool { + return !page.givl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { + return page.givl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { + if page.givl.IsEmpty() { + return nil + } + return *page.givl.Value +} + +// Creates a new instance of the GalleryImageVersionListPage type. +func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { + return GalleryImageVersionListPage{ + fn: getNextPage, + givl: cur, + } +} + +// GalleryImageVersionProperties describes the properties of a gallery image version. +type GalleryImageVersionProperties struct { + PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' + ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` + StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` + // ReplicationStatus - READ-ONLY + ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. +func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givp.PublishingProfile != nil { + objectMap["publishingProfile"] = givp.PublishingProfile + } + if givp.StorageProfile != nil { + objectMap["storageProfile"] = givp.StorageProfile + } + return json.Marshal(objectMap) +} + +// GalleryImageVersionPublishingProfile the publishing profile of a gallery image Version. +type GalleryImageVersionPublishingProfile struct { + // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. + TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` + // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. + ReplicaCount *int32 `json:"replicaCount,omitempty"` + // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. + ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` + // PublishedDate - READ-ONLY; The timestamp for when the gallery image version is published. + PublishedDate *date.Time `json:"publishedDate,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // ReplicationMode - Optional parameter which specifies the mode to be used for replication. This property is not updatable. Possible values include: 'ReplicationModeFull', 'ReplicationModeShallow' + ReplicationMode ReplicationMode `json:"replicationMode,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. +func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givpp.TargetRegions != nil { + objectMap["targetRegions"] = givpp.TargetRegions + } + if givpp.ReplicaCount != nil { + objectMap["replicaCount"] = givpp.ReplicaCount + } + if givpp.ExcludeFromLatest != nil { + objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest + } + if givpp.EndOfLifeDate != nil { + objectMap["endOfLifeDate"] = givpp.EndOfLifeDate + } + if givpp.StorageAccountType != "" { + objectMap["storageAccountType"] = givpp.StorageAccountType + } + if givpp.ReplicationMode != "" { + objectMap["replicationMode"] = givpp.ReplicationMode + } + return json.Marshal(objectMap) +} + +// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryImageVersionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. +func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + giv.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { + giv, err = client.CreateOrUpdateResponder(giv.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryImageVersionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImageVersionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. +func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. +type GalleryImageVersionStorageProfile struct { + Source *GalleryArtifactVersionSource `json:"source,omitempty"` + OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` + // DataDiskImages - A list of data disk images. + DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` +} + +// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GalleryImageVersionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. +func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + giv.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { + giv, err = client.UpdateResponder(giv.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryImageVersionUpdate specifies information about the gallery image version that you want to update. +type GalleryImageVersionUpdate struct { + *GalleryImageVersionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. +func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if givu.GalleryImageVersionProperties != nil { + objectMap["properties"] = givu.GalleryImageVersionProperties + } + if givu.Tags != nil { + objectMap["tags"] = givu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. +func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryImageVersionProperties GalleryImageVersionProperties + err = json.Unmarshal(*v, &galleryImageVersionProperties) + if err != nil { + return err + } + givu.GalleryImageVersionProperties = &galleryImageVersionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + givu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + givu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + givu.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + givu.Tags = tags + } + } + } + + return nil +} + +// GalleryList the List Galleries operation response. +type GalleryList struct { + autorest.Response `json:"-"` + // Value - A list of galleries. + Value *[]Gallery `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. + NextLink *string `json:"nextLink,omitempty"` +} + +// GalleryListIterator provides access to a complete listing of Gallery values. +type GalleryListIterator struct { + i int + page GalleryListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GalleryListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GalleryListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GalleryListIterator) Response() GalleryList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GalleryListIterator) Value() Gallery { + if !iter.page.NotDone() { + return Gallery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GalleryListIterator type. +func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { + return GalleryListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (gl GalleryList) IsEmpty() bool { + return gl.Value == nil || len(*gl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (gl GalleryList) hasNextLink() bool { + return gl.NextLink != nil && len(*gl.NextLink) != 0 +} + +// galleryListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { + if !gl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(gl.NextLink))) +} + +// GalleryListPage contains a page of Gallery values. +type GalleryListPage struct { + fn func(context.Context, GalleryList) (GalleryList, error) + gl GalleryList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.gl) + if err != nil { + return err + } + page.gl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GalleryListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GalleryListPage) NotDone() bool { + return !page.gl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GalleryListPage) Response() GalleryList { + return page.gl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GalleryListPage) Values() []Gallery { + if page.gl.IsEmpty() { + return nil + } + return *page.gl.Value +} + +// Creates a new instance of the GalleryListPage type. +func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { + return GalleryListPage{ + fn: getNextPage, + gl: cur, + } +} + +// GalleryOSDiskImage this is the OS disk image. +type GalleryOSDiskImage struct { + // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. + SizeInGB *int32 `json:"sizeInGB,omitempty"` + // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' + HostCaching HostCaching `json:"hostCaching,omitempty"` + Source *GalleryArtifactVersionSource `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryOSDiskImage. +func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if godi.HostCaching != "" { + objectMap["hostCaching"] = godi.HostCaching + } + if godi.Source != nil { + objectMap["source"] = godi.Source + } + return json.Marshal(objectMap) +} + +// GalleryProperties describes the properties of a Shared Image Gallery. +type GalleryProperties struct { + // Description - The description of this Shared Image Gallery resource. This property is updatable. + Description *string `json:"description,omitempty"` + Identifier *GalleryIdentifier `json:"identifier,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + SharingProfile *SharingProfile `json:"sharingProfile,omitempty"` + SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryProperties. +func (gp GalleryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gp.Description != nil { + objectMap["description"] = gp.Description + } + if gp.Identifier != nil { + objectMap["identifier"] = gp.Identifier + } + if gp.SharingProfile != nil { + objectMap["sharingProfile"] = gp.SharingProfile + } + if gp.SoftDeletePolicy != nil { + objectMap["softDeletePolicy"] = gp.SoftDeletePolicy + } + return json.Marshal(objectMap) +} + +// GallerySharingProfileUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type GallerySharingProfileUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GallerySharingProfileClient) (SharingUpdate, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GallerySharingProfileUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GallerySharingProfileUpdateFuture.Result. +func (future *GallerySharingProfileUpdateFuture) result(client GallerySharingProfileClient) (su SharingUpdate, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + su.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.GallerySharingProfileUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if su.Response.Response, err = future.GetResult(sender); err == nil && su.Response.Response.StatusCode != http.StatusNoContent { + su, err = client.UpdateResponder(su.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.GallerySharingProfileUpdateFuture", "Result", su.Response.Response, "Failure responding to request") + } + } + return +} + +// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. +type GalleryUpdate struct { + *GalleryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for GalleryUpdate. +func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gu.GalleryProperties != nil { + objectMap["properties"] = gu.GalleryProperties + } + if gu.Tags != nil { + objectMap["tags"] = gu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. +func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var galleryProperties GalleryProperties + err = json.Unmarshal(*v, &galleryProperties) + if err != nil { + return err + } + gu.GalleryProperties = &galleryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gu.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gu.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + gu.Tags = tags + } + } + } + + return nil +} + +// GrantAccessData data used for requesting a SAS. +type GrantAccessData struct { + // Access - Possible values include: 'AccessLevelNone', 'AccessLevelRead', 'AccessLevelWrite' + Access AccessLevel `json:"access,omitempty"` + // DurationInSeconds - Time duration in seconds until the SAS access expires. + DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` + // GetSecureVMGuestStateSAS - Set this flag to true to get additional SAS for VM guest state + GetSecureVMGuestStateSAS *bool `json:"getSecureVMGuestStateSAS,omitempty"` +} + +// HardwareProfile specifies the hardware settings for the virtual machine. +type HardwareProfile struct { + // VMSize - Specifies the size of the virtual machine.

The enum data type is currently deprecated and will be removed by December 23rd 2023.

Recommended way to get the list of available sizes is using these APIs:

[List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)

[List all available virtual machine sizes in a region]( https://docs.microsoft.com/rest/api/compute/resourceskus/list)

[List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/sizes).

The available VM sizes depend on region and availability set. Possible values include: 'VirtualMachineSizeTypesBasicA0', 'VirtualMachineSizeTypesBasicA1', 'VirtualMachineSizeTypesBasicA2', 'VirtualMachineSizeTypesBasicA3', 'VirtualMachineSizeTypesBasicA4', 'VirtualMachineSizeTypesStandardA0', 'VirtualMachineSizeTypesStandardA1', 'VirtualMachineSizeTypesStandardA2', 'VirtualMachineSizeTypesStandardA3', 'VirtualMachineSizeTypesStandardA4', 'VirtualMachineSizeTypesStandardA5', 'VirtualMachineSizeTypesStandardA6', 'VirtualMachineSizeTypesStandardA7', 'VirtualMachineSizeTypesStandardA8', 'VirtualMachineSizeTypesStandardA9', 'VirtualMachineSizeTypesStandardA10', 'VirtualMachineSizeTypesStandardA11', 'VirtualMachineSizeTypesStandardA1V2', 'VirtualMachineSizeTypesStandardA2V2', 'VirtualMachineSizeTypesStandardA4V2', 'VirtualMachineSizeTypesStandardA8V2', 'VirtualMachineSizeTypesStandardA2mV2', 'VirtualMachineSizeTypesStandardA4mV2', 'VirtualMachineSizeTypesStandardA8mV2', 'VirtualMachineSizeTypesStandardB1s', 'VirtualMachineSizeTypesStandardB1ms', 'VirtualMachineSizeTypesStandardB2s', 'VirtualMachineSizeTypesStandardB2ms', 'VirtualMachineSizeTypesStandardB4ms', 'VirtualMachineSizeTypesStandardB8ms', 'VirtualMachineSizeTypesStandardD1', 'VirtualMachineSizeTypesStandardD2', 'VirtualMachineSizeTypesStandardD3', 'VirtualMachineSizeTypesStandardD4', 'VirtualMachineSizeTypesStandardD11', 'VirtualMachineSizeTypesStandardD12', 'VirtualMachineSizeTypesStandardD13', 'VirtualMachineSizeTypesStandardD14', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD2V3', 'VirtualMachineSizeTypesStandardD4V3', 'VirtualMachineSizeTypesStandardD8V3', 'VirtualMachineSizeTypesStandardD16V3', 'VirtualMachineSizeTypesStandardD32V3', 'VirtualMachineSizeTypesStandardD64V3', 'VirtualMachineSizeTypesStandardD2sV3', 'VirtualMachineSizeTypesStandardD4sV3', 'VirtualMachineSizeTypesStandardD8sV3', 'VirtualMachineSizeTypesStandardD16sV3', 'VirtualMachineSizeTypesStandardD32sV3', 'VirtualMachineSizeTypesStandardD64sV3', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardD14V2', 'VirtualMachineSizeTypesStandardD15V2', 'VirtualMachineSizeTypesStandardDS1', 'VirtualMachineSizeTypesStandardDS2', 'VirtualMachineSizeTypesStandardDS3', 'VirtualMachineSizeTypesStandardDS4', 'VirtualMachineSizeTypesStandardDS11', 'VirtualMachineSizeTypesStandardDS12', 'VirtualMachineSizeTypesStandardDS13', 'VirtualMachineSizeTypesStandardDS14', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardDS14V2', 'VirtualMachineSizeTypesStandardDS15V2', 'VirtualMachineSizeTypesStandardDS134V2', 'VirtualMachineSizeTypesStandardDS132V2', 'VirtualMachineSizeTypesStandardDS148V2', 'VirtualMachineSizeTypesStandardDS144V2', 'VirtualMachineSizeTypesStandardE2V3', 'VirtualMachineSizeTypesStandardE4V3', 'VirtualMachineSizeTypesStandardE8V3', 'VirtualMachineSizeTypesStandardE16V3', 'VirtualMachineSizeTypesStandardE32V3', 'VirtualMachineSizeTypesStandardE64V3', 'VirtualMachineSizeTypesStandardE2sV3', 'VirtualMachineSizeTypesStandardE4sV3', 'VirtualMachineSizeTypesStandardE8sV3', 'VirtualMachineSizeTypesStandardE16sV3', 'VirtualMachineSizeTypesStandardE32sV3', 'VirtualMachineSizeTypesStandardE64sV3', 'VirtualMachineSizeTypesStandardE3216V3', 'VirtualMachineSizeTypesStandardE328sV3', 'VirtualMachineSizeTypesStandardE6432sV3', 'VirtualMachineSizeTypesStandardE6416sV3', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s', 'VirtualMachineSizeTypesStandardF2sV2', 'VirtualMachineSizeTypesStandardF4sV2', 'VirtualMachineSizeTypesStandardF8sV2', 'VirtualMachineSizeTypesStandardF16sV2', 'VirtualMachineSizeTypesStandardF32sV2', 'VirtualMachineSizeTypesStandardF64sV2', 'VirtualMachineSizeTypesStandardF72sV2', 'VirtualMachineSizeTypesStandardG1', 'VirtualMachineSizeTypesStandardG2', 'VirtualMachineSizeTypesStandardG3', 'VirtualMachineSizeTypesStandardG4', 'VirtualMachineSizeTypesStandardG5', 'VirtualMachineSizeTypesStandardGS1', 'VirtualMachineSizeTypesStandardGS2', 'VirtualMachineSizeTypesStandardGS3', 'VirtualMachineSizeTypesStandardGS4', 'VirtualMachineSizeTypesStandardGS5', 'VirtualMachineSizeTypesStandardGS48', 'VirtualMachineSizeTypesStandardGS44', 'VirtualMachineSizeTypesStandardGS516', 'VirtualMachineSizeTypesStandardGS58', 'VirtualMachineSizeTypesStandardH8', 'VirtualMachineSizeTypesStandardH16', 'VirtualMachineSizeTypesStandardH8m', 'VirtualMachineSizeTypesStandardH16m', 'VirtualMachineSizeTypesStandardH16r', 'VirtualMachineSizeTypesStandardH16mr', 'VirtualMachineSizeTypesStandardL4s', 'VirtualMachineSizeTypesStandardL8s', 'VirtualMachineSizeTypesStandardL16s', 'VirtualMachineSizeTypesStandardL32s', 'VirtualMachineSizeTypesStandardM64s', 'VirtualMachineSizeTypesStandardM64ms', 'VirtualMachineSizeTypesStandardM128s', 'VirtualMachineSizeTypesStandardM128ms', 'VirtualMachineSizeTypesStandardM6432ms', 'VirtualMachineSizeTypesStandardM6416ms', 'VirtualMachineSizeTypesStandardM12864ms', 'VirtualMachineSizeTypesStandardM12832ms', 'VirtualMachineSizeTypesStandardNC6', 'VirtualMachineSizeTypesStandardNC12', 'VirtualMachineSizeTypesStandardNC24', 'VirtualMachineSizeTypesStandardNC24r', 'VirtualMachineSizeTypesStandardNC6sV2', 'VirtualMachineSizeTypesStandardNC12sV2', 'VirtualMachineSizeTypesStandardNC24sV2', 'VirtualMachineSizeTypesStandardNC24rsV2', 'VirtualMachineSizeTypesStandardNC6sV3', 'VirtualMachineSizeTypesStandardNC12sV3', 'VirtualMachineSizeTypesStandardNC24sV3', 'VirtualMachineSizeTypesStandardNC24rsV3', 'VirtualMachineSizeTypesStandardND6s', 'VirtualMachineSizeTypesStandardND12s', 'VirtualMachineSizeTypesStandardND24s', 'VirtualMachineSizeTypesStandardND24rs', 'VirtualMachineSizeTypesStandardNV6', 'VirtualMachineSizeTypesStandardNV12', 'VirtualMachineSizeTypesStandardNV24' + VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` + // VMSizeProperties - Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-07-01.

This feature is still in preview mode and is not supported for VirtualMachineScaleSet.

Please follow the instructions in [VM Customization](https://aka.ms/vmcustomization) for more details. + VMSizeProperties *VMSizeProperties `json:"vmSizeProperties,omitempty"` +} + +// Image the source user image virtual hard disk. The virtual hard disk will be copied before being +// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not +// exist. +type Image struct { + autorest.Response `json:"-"` + *ImageProperties `json:"properties,omitempty"` + // ExtendedLocation - The extended location of the Image. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Image. +func (i Image) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.ImageProperties != nil { + objectMap["properties"] = i.ImageProperties + } + if i.ExtendedLocation != nil { + objectMap["extendedLocation"] = i.ExtendedLocation + } + if i.Location != nil { + objectMap["location"] = i.Location + } + if i.Tags != nil { + objectMap["tags"] = i.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Image struct. +func (i *Image) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var imageProperties ImageProperties + err = json.Unmarshal(*v, &imageProperties) + if err != nil { + return err + } + i.ImageProperties = &imageProperties + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + i.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + i.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + i.Tags = tags + } + } + } + + return nil +} + +// ImageDataDisk describes a data disk. +type ImageDataDisk struct { + // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + Lun *int32 `json:"lun,omitempty"` + // Snapshot - The snapshot. + Snapshot *SubResource `json:"snapshot,omitempty"` + // ManagedDisk - The managedDisk. + ManagedDisk *SubResource `json:"managedDisk,omitempty"` + // BlobURI - The Virtual Hard Disk. + BlobURI *string `json:"blobUri,omitempty"` + // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` +} + +// ImageDisk describes a image disk. +type ImageDisk struct { + // Snapshot - The snapshot. + Snapshot *SubResource `json:"snapshot,omitempty"` + // ManagedDisk - The managedDisk. + ManagedDisk *SubResource `json:"managedDisk,omitempty"` + // BlobURI - The Virtual Hard Disk. + BlobURI *string `json:"blobUri,omitempty"` + // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` +} + +// ImageDiskReference the source image used for creating the disk. +type ImageDiskReference struct { + // ID - A relative uri containing either a Platform Image Repository or user image reference. + ID *string `json:"id,omitempty"` + // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. + Lun *int32 `json:"lun,omitempty"` +} + +// ImageListResult the List Image operation response. +type ImageListResult struct { + autorest.Response `json:"-"` + // Value - The list of Images. + Value *[]Image `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. + NextLink *string `json:"nextLink,omitempty"` +} + +// ImageListResultIterator provides access to a complete listing of Image values. +type ImageListResultIterator struct { + i int + page ImageListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ImageListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ImageListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ImageListResultIterator) Response() ImageListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ImageListResultIterator) Value() Image { + if !iter.page.NotDone() { + return Image{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ImageListResultIterator type. +func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { + return ImageListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ilr ImageListResult) IsEmpty() bool { + return ilr.Value == nil || len(*ilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ilr ImageListResult) hasNextLink() bool { + return ilr.NextLink != nil && len(*ilr.NextLink) != 0 +} + +// imageListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ilr.NextLink))) +} + +// ImageListResultPage contains a page of Image values. +type ImageListResultPage struct { + fn func(context.Context, ImageListResult) (ImageListResult, error) + ilr ImageListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ImageListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ImageListResultPage) NotDone() bool { + return !page.ilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ImageListResultPage) Response() ImageListResult { + return page.ilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ImageListResultPage) Values() []Image { + if page.ilr.IsEmpty() { + return nil + } + return *page.ilr.Value +} + +// Creates a new instance of the ImageListResultPage type. +func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { + return ImageListResultPage{ + fn: getNextPage, + ilr: cur, + } +} + +// ImageOSDisk describes an Operating System disk. +type ImageOSDisk struct { + // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

Possible values are:

**Windows**

**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // OsState - The OS State. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' + OsState OperatingSystemStateTypes `json:"osState,omitempty"` + // Snapshot - The snapshot. + Snapshot *SubResource `json:"snapshot,omitempty"` + // ManagedDisk - The managedDisk. + ManagedDisk *SubResource `json:"managedDisk,omitempty"` + // BlobURI - The Virtual Hard Disk. + BlobURI *string `json:"blobUri,omitempty"` + // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` +} + +// ImageProperties describes the properties of an Image. +type ImageProperties struct { + // SourceVirtualMachine - The source virtual machine from which Image is created. + SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` + // StorageProfile - Specifies the storage settings for the virtual machine disks. + StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // HyperVGeneration - Specifies the HyperVGenerationType of the VirtualMachine created from the image. From API Version 2019-03-01 if the image source is a blob, then we need the user to specify the value, if the source is managed resource like disk or snapshot, we may require the user to specify the property if we cannot deduce it from the source managed resource. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' + HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImageProperties. +func (IP ImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.SourceVirtualMachine != nil { + objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine + } + if IP.StorageProfile != nil { + objectMap["storageProfile"] = IP.StorageProfile + } + if IP.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = IP.HyperVGeneration + } + return json.Marshal(objectMap) +} + +// ImagePurchasePlan describes the gallery image definition purchase plan. This is used by marketplace +// images. +type ImagePurchasePlan struct { + // Name - The plan ID. + Name *string `json:"name,omitempty"` + // Publisher - The publisher ID. + Publisher *string `json:"publisher,omitempty"` + // Product - The product ID. + Product *string `json:"product,omitempty"` +} + +// ImageReference specifies information about the image to use. You can specify information about platform +// images, marketplace images, or virtual machine images. This element is required when you want to use a +// platform image, marketplace image, or virtual machine image, but is not used in other creation +// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. +type ImageReference struct { + // Publisher - The image publisher. + Publisher *string `json:"publisher,omitempty"` + // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. + Offer *string `json:"offer,omitempty"` + // Sku - The image SKU. + Sku *string `json:"sku,omitempty"` + // Version - Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + Version *string `json:"version,omitempty"` + // ExactVersion - READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. + ExactVersion *string `json:"exactVersion,omitempty"` + // SharedGalleryImageID - Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. + SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImageReference. +func (ir ImageReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ir.Publisher != nil { + objectMap["publisher"] = ir.Publisher + } + if ir.Offer != nil { + objectMap["offer"] = ir.Offer + } + if ir.Sku != nil { + objectMap["sku"] = ir.Sku + } + if ir.Version != nil { + objectMap["version"] = ir.Version + } + if ir.SharedGalleryImageID != nil { + objectMap["sharedGalleryImageId"] = ir.SharedGalleryImageID + } + if ir.ID != nil { + objectMap["id"] = ir.ID + } + return json.Marshal(objectMap) +} + +// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ImagesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ImagesClient) (Image, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ImagesCreateOrUpdateFuture.Result. +func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + i.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { + i, err = client.CreateOrUpdateResponder(i.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") + } + } + return +} + +// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ImagesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ImagesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ImagesDeleteFuture.Result. +func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ImageStorageProfile describes a storage profile. +type ImageStorageProfile struct { + // OsDisk - Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + OsDisk *ImageOSDisk `json:"osDisk,omitempty"` + // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.

For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` + // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). + ZoneResilient *bool `json:"zoneResilient,omitempty"` +} + +// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type ImagesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ImagesClient) (Image, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ImagesUpdateFuture.Result. +func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + i.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { + i, err = client.UpdateResponder(i.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") + } + } + return +} + +// ImageUpdate the source user image virtual hard disk. Only tags may be updated. +type ImageUpdate struct { + *ImageProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ImageUpdate. +func (iu ImageUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iu.ImageProperties != nil { + objectMap["properties"] = iu.ImageProperties + } + if iu.Tags != nil { + objectMap["tags"] = iu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. +func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var imageProperties ImageProperties + err = json.Unmarshal(*v, &imageProperties) + if err != nil { + return err + } + iu.ImageProperties = &imageProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + iu.Tags = tags + } + } + } + + return nil +} + +// InnerError inner error details. +type InnerError struct { + // Exceptiontype - The exception type. + Exceptiontype *string `json:"exceptiontype,omitempty"` + // Errordetail - The internal error message or exception dump. + Errordetail *string `json:"errordetail,omitempty"` +} + +// InstanceSku ... +type InstanceSku struct { + // Name - READ-ONLY; The sku name. + Name *string `json:"name,omitempty"` + // Tier - READ-ONLY; The tier of the cloud service role instance. + Tier *string `json:"tier,omitempty"` +} + +// MarshalJSON is the custom marshaler for InstanceSku. +func (is InstanceSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// InstanceViewStatus instance view status. +type InstanceViewStatus struct { + // Code - The status code. + Code *string `json:"code,omitempty"` + // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' + Level StatusLevelTypes `json:"level,omitempty"` + // DisplayStatus - The short localizable label for the status. + DisplayStatus *string `json:"displayStatus,omitempty"` + // Message - The detailed status message, including for alerts and error messages. + Message *string `json:"message,omitempty"` + // Time - The time of the status. + Time *date.Time `json:"time,omitempty"` +} + +// InstanceViewStatusesSummary instance view statuses. +type InstanceViewStatusesSummary struct { + // StatusesSummary - READ-ONLY + StatusesSummary *[]StatusCodeCount `json:"statusesSummary,omitempty"` +} + +// MarshalJSON is the custom marshaler for InstanceViewStatusesSummary. +func (ivss InstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// KeyForDiskEncryptionSet key Vault Key Url to be used for server side encryption of Managed Disks and +// Snapshots +type KeyForDiskEncryptionSet struct { + // SourceVault - Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if the KeyVault subscription is not the same as the Disk Encryption Set subscription. + SourceVault *SourceVault `json:"sourceVault,omitempty"` + // KeyURL - Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of rotationToLatestKeyVersionEnabled value. + KeyURL *string `json:"keyUrl,omitempty"` +} + +// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used +// to unwrap the encryptionKey +type KeyVaultAndKeyReference struct { + // SourceVault - Resource id of the KeyVault containing the key or secret + SourceVault *SourceVault `json:"sourceVault,omitempty"` + // KeyURL - Url pointing to a key or secret in KeyVault + KeyURL *string `json:"keyUrl,omitempty"` +} + +// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key +type KeyVaultAndSecretReference struct { + // SourceVault - Resource id of the KeyVault containing the key or secret + SourceVault *SourceVault `json:"sourceVault,omitempty"` + // SecretURL - Url pointing to a key or secret in KeyVault + SecretURL *string `json:"secretUrl,omitempty"` +} + +// KeyVaultKeyReference describes a reference to Key Vault Key +type KeyVaultKeyReference struct { + // KeyURL - The URL referencing a key encryption key in Key Vault. + KeyURL *string `json:"keyUrl,omitempty"` + // SourceVault - The relative URL of the Key Vault containing the key. + SourceVault *SubResource `json:"sourceVault,omitempty"` +} + +// KeyVaultSecretReference describes a reference to Key Vault Secret +type KeyVaultSecretReference struct { + // SecretURL - The URL referencing a secret in a Key Vault. + SecretURL *string `json:"secretUrl,omitempty"` + // SourceVault - The relative URL of the Key Vault containing the secret. + SourceVault *SubResource `json:"sourceVault,omitempty"` +} + +// LastPatchInstallationSummary describes the properties of the last installed patch summary. +type LastPatchInstallationSummary struct { + // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' + Status PatchOperationStatus `json:"status,omitempty"` + // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. + InstallationActivityID *string `json:"installationActivityId,omitempty"` + // MaintenanceWindowExceeded - READ-ONLY; Describes whether the operation ran out of time before it completed all its intended actions + MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` + // NotSelectedPatchCount - READ-ONLY; The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry. + NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` + // ExcludedPatchCount - READ-ONLY; The number of all available patches but excluded explicitly by a customer-specified exclusion list match. + ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` + // PendingPatchCount - READ-ONLY; The number of all available patches expected to be installed over the course of the patch installation operation. + PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` + // InstalledPatchCount - READ-ONLY; The count of patches that successfully installed. + InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` + // FailedPatchCount - READ-ONLY; The count of patches that failed installation. + FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` + // StartTime - READ-ONLY; The UTC timestamp when the operation began. + StartTime *date.Time `json:"startTime,omitempty"` + // LastModifiedTime - READ-ONLY; The UTC timestamp when the operation began. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. + Error *APIError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for LastPatchInstallationSummary. +func (lpis LastPatchInstallationSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

For a +// list of supported Linux distributions, see [Linux on Azure-Endorsed +// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). +type LinuxConfiguration struct { + // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. + DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` + // SSH - Specifies the ssh key configuration for a Linux OS. + SSH *SSHConfiguration `json:"ssh,omitempty"` + // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine.

When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + PatchSettings *LinuxPatchSettings `json:"patchSettings,omitempty"` +} + +// LinuxParameters input for InstallPatches on a Linux VM, as directly received by the API +type LinuxParameters struct { + // ClassificationsToInclude - The update classifications to select when installing patches for Linux. + ClassificationsToInclude *[]VMGuestPatchClassificationLinux `json:"classificationsToInclude,omitempty"` + // PackageNameMasksToInclude - packages to include in the patch operation. Format: packageName_packageVersion + PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` + // PackageNameMasksToExclude - packages to exclude in the patch operation. Format: packageName_packageVersion + PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` + // MaintenanceRunID - This is used as a maintenance run identifier for Auto VM Guest Patching in Linux. + MaintenanceRunID *string `json:"maintenanceRunId,omitempty"` +} + +// LinuxPatchSettings specifies settings related to VM Guest Patching on Linux. +type LinuxPatchSettings struct { + // PatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**ImageDefault** - The virtual machine's default patching configuration is used.

**AutomaticByPlatform** - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true. Possible values include: 'LinuxVMGuestPatchModeImageDefault', 'LinuxVMGuestPatchModeAutomaticByPlatform' + PatchMode LinuxVMGuestPatchMode `json:"patchMode,omitempty"` + // AssessmentMode - Specifies the mode of VM Guest Patch Assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'LinuxPatchAssessmentModeImageDefault', 'LinuxPatchAssessmentModeAutomaticByPlatform' + AssessmentMode LinuxPatchAssessmentMode `json:"assessmentMode,omitempty"` +} + +// ListUsagesResult the List Usages operation response. +type ListUsagesResult struct { + autorest.Response `json:"-"` + // Value - The list of compute resource usages. + Value *[]Usage `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListUsagesResultIterator provides access to a complete listing of Usage values. +type ListUsagesResultIterator struct { + i int + page ListUsagesResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListUsagesResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListUsagesResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListUsagesResultIterator) Response() ListUsagesResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListUsagesResultIterator) Value() Usage { + if !iter.page.NotDone() { + return Usage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListUsagesResultIterator type. +func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { + return ListUsagesResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lur ListUsagesResult) IsEmpty() bool { + return lur.Value == nil || len(*lur.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lur ListUsagesResult) hasNextLink() bool { + return lur.NextLink != nil && len(*lur.NextLink) != 0 +} + +// listUsagesResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { + if !lur.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lur.NextLink))) +} + +// ListUsagesResultPage contains a page of Usage values. +type ListUsagesResultPage struct { + fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) + lur ListUsagesResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lur) + if err != nil { + return err + } + page.lur = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListUsagesResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListUsagesResultPage) NotDone() bool { + return !page.lur.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListUsagesResultPage) Response() ListUsagesResult { + return page.lur +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListUsagesResultPage) Values() []Usage { + if page.lur.IsEmpty() { + return nil + } + return *page.lur.Value +} + +// Creates a new instance of the ListUsagesResultPage type. +func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { + return ListUsagesResultPage{ + fn: getNextPage, + lur: cur, + } +} + +// ListVirtualMachineExtensionImage ... +type ListVirtualMachineExtensionImage struct { + autorest.Response `json:"-"` + Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` +} + +// ListVirtualMachineImageResource ... +type ListVirtualMachineImageResource struct { + autorest.Response `json:"-"` + Value *[]VirtualMachineImageResource `json:"value,omitempty"` +} + +// LoadBalancerConfiguration describes the load balancer configuration. +type LoadBalancerConfiguration struct { + // ID - Resource Id + ID *string `json:"id,omitempty"` + // Name - The name of the Load balancer + Name *string `json:"name,omitempty"` + // Properties - Properties of the load balancer configuration. + Properties *LoadBalancerConfigurationProperties `json:"properties,omitempty"` +} + +// LoadBalancerConfigurationProperties ... +type LoadBalancerConfigurationProperties struct { + // FrontendIPConfigurations - Specifies the frontend IP to be used for the load balancer. Only IPv4 frontend IP address is supported. Each load balancer configuration must have exactly one frontend IP configuration. + FrontendIPConfigurations *[]LoadBalancerFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` +} + +// LoadBalancerFrontendIPConfiguration ... +type LoadBalancerFrontendIPConfiguration struct { + // Name - The name of the resource that is unique within the set of frontend IP configurations used by the load balancer. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Properties - Properties of load balancer frontend ip configuration. + Properties *LoadBalancerFrontendIPConfigurationProperties `json:"properties,omitempty"` +} + +// LoadBalancerFrontendIPConfigurationProperties describes a cloud service IP Configuration +type LoadBalancerFrontendIPConfigurationProperties struct { + // PublicIPAddress - The reference to the public ip address resource. + PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` + // Subnet - The reference to the virtual network subnet resource. + Subnet *SubResource `json:"subnet,omitempty"` + // PrivateIPAddress - The virtual network private IP address of the IP configuration. + PrivateIPAddress *string `json:"privateIPAddress,omitempty"` +} + +// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type LogAnalyticsExportRequestRateByIntervalFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. +func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + laor.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { + laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") + } + } + return +} + +// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LogAnalyticsExportThrottledRequestsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. +func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + laor.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { + laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") + } + } + return +} + +// LogAnalyticsInputBase api input base class for LogAnalytics Api. +type LogAnalyticsInputBase struct { + // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. + BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` + // FromTime - From time of the query + FromTime *date.Time `json:"fromTime,omitempty"` + // ToTime - To time of the query + ToTime *date.Time `json:"toTime,omitempty"` + // GroupByThrottlePolicy - Group query result by Throttle Policy applied. + GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` + // GroupByOperationName - Group query result by Operation Name. + GroupByOperationName *bool `json:"groupByOperationName,omitempty"` + // GroupByResourceName - Group query result by Resource Name. + GroupByResourceName *bool `json:"groupByResourceName,omitempty"` + // GroupByClientApplicationID - Group query result by Client Application ID. + GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` + // GroupByUserAgent - Group query result by User Agent. + GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` +} + +// LogAnalyticsOperationResult logAnalytics operation status response +type LogAnalyticsOperationResult struct { + autorest.Response `json:"-"` + // Properties - READ-ONLY; LogAnalyticsOutput + Properties *LogAnalyticsOutput `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. +func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// LogAnalyticsOutput logAnalytics output properties +type LogAnalyticsOutput struct { + // Output - READ-ONLY; Output file Uri path to blob container. + Output *string `json:"output,omitempty"` +} + +// MarshalJSON is the custom marshaler for LogAnalyticsOutput. +func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MaintenanceRedeployStatus maintenance Operation Status. +type MaintenanceRedeployStatus struct { + // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. + IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` + // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. + PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` + // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. + PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` + // MaintenanceWindowStartTime - Start Time for the Maintenance Window. + MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` + // MaintenanceWindowEndTime - End Time for the Maintenance Window. + MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` + // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' + LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` + // LastOperationMessage - Message returned for the last Maintenance Operation. + LastOperationMessage *string `json:"lastOperationMessage,omitempty"` +} + +// ManagedArtifact the managed artifact. +type ManagedArtifact struct { + // ID - The managed artifact id. + ID *string `json:"id,omitempty"` +} + +// ManagedDiskParameters the parameters of a managed disk. +type ManagedDiskParameters struct { + // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// NetworkInterfaceReference describes a network interface reference. +type NetworkInterfaceReference struct { + *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkInterfaceReference. +func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nir.NetworkInterfaceReferenceProperties != nil { + objectMap["properties"] = nir.NetworkInterfaceReferenceProperties + } + if nir.ID != nil { + objectMap["id"] = nir.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. +func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties + err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) + if err != nil { + return err + } + nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nir.ID = &ID + } + } + } + + return nil +} + +// NetworkInterfaceReferenceProperties describes a network interface reference properties. +type NetworkInterfaceReferenceProperties struct { + // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. + Primary *bool `json:"primary,omitempty"` + // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + DeleteOption DeleteOptions `json:"deleteOption,omitempty"` +} + +// NetworkProfile specifies the network interfaces or the networking configuration of the virtual machine. +type NetworkProfile struct { + // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. + NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` + // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' + NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` + // NetworkInterfaceConfigurations - Specifies the networking configurations that will be used to create the virtual machine networking resources. + NetworkInterfaceConfigurations *[]VirtualMachineNetworkInterfaceConfiguration `json:"networkInterfaceConfigurations,omitempty"` +} + +// OperationListResult the List Compute Operation operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of compute operations + Value *[]OperationValue `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationValue describes the properties of a Compute Operation value. +type OperationValue struct { + // Origin - READ-ONLY; The origin of the compute operation. + Origin *string `json:"origin,omitempty"` + // Name - READ-ONLY; The name of the compute operation. + Name *string `json:"name,omitempty"` + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Compute Operation Value Display. +type OperationValueDisplay struct { + // Operation - READ-ONLY; The display name of the compute operation. + Operation *string `json:"operation,omitempty"` + // Resource - READ-ONLY; The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - READ-ONLY; The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValueDisplay. +func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OrchestrationServiceStateInput the input for OrchestrationServiceState +type OrchestrationServiceStateInput struct { + // ServiceName - The name of the service. Possible values include: 'OrchestrationServiceNamesAutomaticRepairs' + ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` + // Action - The action to be performed. Possible values include: 'OrchestrationServiceStateActionResume', 'OrchestrationServiceStateActionSuspend' + Action OrchestrationServiceStateAction `json:"action,omitempty"` +} + +// OrchestrationServiceSummary summary for an orchestration service of a virtual machine scale set. +type OrchestrationServiceSummary struct { + // ServiceName - READ-ONLY; The name of the service. Possible values include: 'OrchestrationServiceNamesAutomaticRepairs', 'OrchestrationServiceNamesDummyOrchestrationServiceName' + ServiceName OrchestrationServiceNames `json:"serviceName,omitempty"` + // ServiceState - READ-ONLY; The current state of the service. Possible values include: 'OrchestrationServiceStateNotRunning', 'OrchestrationServiceStateRunning', 'OrchestrationServiceStateSuspended' + ServiceState OrchestrationServiceState `json:"serviceState,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrchestrationServiceSummary. +func (oss OrchestrationServiceSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OSDisk specifies information about the operating system disk used by the virtual machine.

For +// more information about disks, see [About disks and VHDs for Azure virtual +// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). +type OSDisk struct { + // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

Possible values are:

**Windows**

**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // EncryptionSettings - Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15 + EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + // Name - The disk name. + Name *string `json:"name,omitempty"` + // Vhd - The virtual hard disk. + Vhd *VirtualHardDisk `json:"vhd,omitempty"` + // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. + Image *VirtualHardDisk `json:"image,omitempty"` + // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None** for Standard storage. **ReadOnly** for Premium storage. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` + // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. + DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` + // CreateOption - Specifies how the virtual machine should be created.

Possible values are:

**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' + CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` + // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // ManagedDisk - The managed disk parameters. + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + // DeleteOption - Specifies whether OS Disk should be deleted or detached upon VM deletion.

Possible values:

**Delete** If this value is used, the OS disk is deleted when VM is deleted.

**Detach** If this value is used, the os disk is retained after VM is deleted.

The default value is set to **detach**. For an ephemeral OS Disk, the default value is set to **Delete**. User cannot change the delete option for ephemeral OS Disk. Possible values include: 'DiskDeleteOptionTypesDelete', 'DiskDeleteOptionTypesDetach' + DeleteOption DiskDeleteOptionTypes `json:"deleteOption,omitempty"` +} + +// OSDiskImage contains the os disk image information. +type OSDiskImage struct { + // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` +} + +// OSDiskImageEncryption contains encryption settings for an OS disk image. +type OSDiskImageEncryption struct { + // DiskEncryptionSetID - A relative URI containing the resource ID of the disk encryption set. + DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` +} + +// OSFamily describes a cloud service OS family. +type OSFamily struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + Properties *OSFamilyProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OSFamily. +func (of OSFamily) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if of.Properties != nil { + objectMap["properties"] = of.Properties + } + return json.Marshal(objectMap) +} + +// OSFamilyListResult ... +type OSFamilyListResult struct { + autorest.Response `json:"-"` + Value *[]OSFamily `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// OSFamilyListResultIterator provides access to a complete listing of OSFamily values. +type OSFamilyListResultIterator struct { + i int + page OSFamilyListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OSFamilyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OSFamilyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OSFamilyListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OSFamilyListResultIterator) Response() OSFamilyListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OSFamilyListResultIterator) Value() OSFamily { + if !iter.page.NotDone() { + return OSFamily{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OSFamilyListResultIterator type. +func NewOSFamilyListResultIterator(page OSFamilyListResultPage) OSFamilyListResultIterator { + return OSFamilyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oflr OSFamilyListResult) IsEmpty() bool { + return oflr.Value == nil || len(*oflr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (oflr OSFamilyListResult) hasNextLink() bool { + return oflr.NextLink != nil && len(*oflr.NextLink) != 0 +} + +// oSFamilyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oflr OSFamilyListResult) oSFamilyListResultPreparer(ctx context.Context) (*http.Request, error) { + if !oflr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oflr.NextLink))) +} + +// OSFamilyListResultPage contains a page of OSFamily values. +type OSFamilyListResultPage struct { + fn func(context.Context, OSFamilyListResult) (OSFamilyListResult, error) + oflr OSFamilyListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OSFamilyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OSFamilyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.oflr) + if err != nil { + return err + } + page.oflr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OSFamilyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OSFamilyListResultPage) NotDone() bool { + return !page.oflr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OSFamilyListResultPage) Response() OSFamilyListResult { + return page.oflr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OSFamilyListResultPage) Values() []OSFamily { + if page.oflr.IsEmpty() { + return nil + } + return *page.oflr.Value +} + +// Creates a new instance of the OSFamilyListResultPage type. +func NewOSFamilyListResultPage(cur OSFamilyListResult, getNextPage func(context.Context, OSFamilyListResult) (OSFamilyListResult, error)) OSFamilyListResultPage { + return OSFamilyListResultPage{ + fn: getNextPage, + oflr: cur, + } +} + +// OSFamilyProperties OS family properties. +type OSFamilyProperties struct { + // Name - READ-ONLY; The OS family name. + Name *string `json:"name,omitempty"` + // Label - READ-ONLY; The OS family label. + Label *string `json:"label,omitempty"` + // Versions - READ-ONLY; List of OS versions belonging to this family. + Versions *[]OSVersionPropertiesBase `json:"versions,omitempty"` +} + +// MarshalJSON is the custom marshaler for OSFamilyProperties. +func (ofp OSFamilyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot +// be changed once VM is provisioned. +type OSProfile struct { + // ComputerName - Specifies the host OS name of the virtual machine.

This name cannot be updated after the VM is created.

**Max-length (Windows):** 15 characters

**Max-length (Linux):** 64 characters.

For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/azure-resource-manager/management/resource-name-rules). + ComputerName *string `json:"computerName,omitempty"` + // AdminUsername - Specifies the name of the administrator account.

This property cannot be updated after the VM is created.

**Windows-only restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 characters. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - Specifies the password of the administrator account.

**Minimum-length (Windows):** 8 characters

**Minimum-length (Linux):** 6 characters

**Max-length (Windows):** 123 characters

**Max-length (Linux):** 72 characters

**Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters
Has upper characters
Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + AdminPassword *string `json:"adminPassword,omitempty"` + // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

**Note: Do not pass any secrets or passwords in customData property**

This property cannot be updated after the VM is created.

customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://azure.microsoft.com/blog/custom-data-and-cloud-init-on-windows-azure/)

For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + CustomData *string `json:"customData,omitempty"` + // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` + // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` + // Secrets - Specifies set of certificates that should be installed onto the virtual machine. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` + // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine.

This may only be set to False when no extensions are present on the virtual machine. + AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` + // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. **Note: This property is for private testing only, and all customers must not set the property to false.** + RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` +} + +// OSVersion describes a cloud service OS version. +type OSVersion struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Resource location. + Location *string `json:"location,omitempty"` + Properties *OSVersionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OSVersion. +func (ov OSVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.Properties != nil { + objectMap["properties"] = ov.Properties + } + return json.Marshal(objectMap) +} + +// OSVersionListResult ... +type OSVersionListResult struct { + autorest.Response `json:"-"` + Value *[]OSVersion `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// OSVersionListResultIterator provides access to a complete listing of OSVersion values. +type OSVersionListResultIterator struct { + i int + page OSVersionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OSVersionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OSVersionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OSVersionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OSVersionListResultIterator) Response() OSVersionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OSVersionListResultIterator) Value() OSVersion { + if !iter.page.NotDone() { + return OSVersion{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OSVersionListResultIterator type. +func NewOSVersionListResultIterator(page OSVersionListResultPage) OSVersionListResultIterator { + return OSVersionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ovlr OSVersionListResult) IsEmpty() bool { + return ovlr.Value == nil || len(*ovlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ovlr OSVersionListResult) hasNextLink() bool { + return ovlr.NextLink != nil && len(*ovlr.NextLink) != 0 +} + +// oSVersionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ovlr OSVersionListResult) oSVersionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ovlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ovlr.NextLink))) +} + +// OSVersionListResultPage contains a page of OSVersion values. +type OSVersionListResultPage struct { + fn func(context.Context, OSVersionListResult) (OSVersionListResult, error) + ovlr OSVersionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OSVersionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OSVersionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ovlr) + if err != nil { + return err + } + page.ovlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OSVersionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OSVersionListResultPage) NotDone() bool { + return !page.ovlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OSVersionListResultPage) Response() OSVersionListResult { + return page.ovlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OSVersionListResultPage) Values() []OSVersion { + if page.ovlr.IsEmpty() { + return nil + } + return *page.ovlr.Value +} + +// Creates a new instance of the OSVersionListResultPage type. +func NewOSVersionListResultPage(cur OSVersionListResult, getNextPage func(context.Context, OSVersionListResult) (OSVersionListResult, error)) OSVersionListResultPage { + return OSVersionListResultPage{ + fn: getNextPage, + ovlr: cur, + } +} + +// OSVersionProperties OS version properties. +type OSVersionProperties struct { + // Family - READ-ONLY; The family of this OS version. + Family *string `json:"family,omitempty"` + // FamilyLabel - READ-ONLY; The family label of this OS version. + FamilyLabel *string `json:"familyLabel,omitempty"` + // Version - READ-ONLY; The OS version. + Version *string `json:"version,omitempty"` + // Label - READ-ONLY; The OS version label. + Label *string `json:"label,omitempty"` + // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. + IsDefault *bool `json:"isDefault,omitempty"` + // IsActive - READ-ONLY; Specifies whether this OS version is active. + IsActive *bool `json:"isActive,omitempty"` +} + +// MarshalJSON is the custom marshaler for OSVersionProperties. +func (ovp OSVersionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OSVersionPropertiesBase configuration view of an OS version. +type OSVersionPropertiesBase struct { + // Version - READ-ONLY; The OS version. + Version *string `json:"version,omitempty"` + // Label - READ-ONLY; The OS version label. + Label *string `json:"label,omitempty"` + // IsDefault - READ-ONLY; Specifies whether this is the default OS version for its family. + IsDefault *bool `json:"isDefault,omitempty"` + // IsActive - READ-ONLY; Specifies whether this OS version is active. + IsActive *bool `json:"isActive,omitempty"` +} + +// MarshalJSON is the custom marshaler for OSVersionPropertiesBase. +func (ovpb OSVersionPropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PatchInstallationDetail information about a specific patch that was encountered during an installation +// action. +type PatchInstallationDetail struct { + // PatchID - READ-ONLY; A unique identifier for the patch. + PatchID *string `json:"patchId,omitempty"` + // Name - READ-ONLY; The friendly name of the patch. + Name *string `json:"name,omitempty"` + // Version - READ-ONLY; The version string of the package. It may conform to Semantic Versioning. Only applies to Linux. + Version *string `json:"version,omitempty"` + // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. + KbID *string `json:"kbId,omitempty"` + // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. + Classifications *[]string `json:"classifications,omitempty"` + // InstallationState - READ-ONLY; The state of the patch after the installation operation completed. Possible values include: 'PatchInstallationStateUnknown', 'PatchInstallationStateInstalled', 'PatchInstallationStateFailed', 'PatchInstallationStateExcluded', 'PatchInstallationStateNotSelected', 'PatchInstallationStatePending' + InstallationState PatchInstallationState `json:"installationState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PatchInstallationDetail. +func (pid PatchInstallationDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PatchSettings specifies settings related to VM Guest Patching on Windows. +type PatchSettings struct { + // PatchMode - Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual machines associated to virtual machine scale set with OrchestrationMode as Flexible.

Possible values are:

**Manual** - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

**AutomaticByOS** - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

**AutomaticByPlatform** - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. Possible values include: 'WindowsVMGuestPatchModeManual', 'WindowsVMGuestPatchModeAutomaticByOS', 'WindowsVMGuestPatchModeAutomaticByPlatform' + PatchMode WindowsVMGuestPatchMode `json:"patchMode,omitempty"` + // EnableHotpatching - Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. + EnableHotpatching *bool `json:"enableHotpatching,omitempty"` + // AssessmentMode - Specifies the mode of VM Guest patch assessment for the IaaS virtual machine.

Possible values are:

**ImageDefault** - You control the timing of patch assessments on a virtual machine.

**AutomaticByPlatform** - The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. Possible values include: 'WindowsPatchAssessmentModeImageDefault', 'WindowsPatchAssessmentModeAutomaticByPlatform' + AssessmentMode WindowsPatchAssessmentMode `json:"assessmentMode,omitempty"` +} + +// PirCommunityGalleryResource base information about the community gallery resource in pir. +type PirCommunityGalleryResource struct { + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *CommunityGalleryIdentifier `json:"identifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for PirCommunityGalleryResource. +func (pcgr PirCommunityGalleryResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcgr.CommunityGalleryIdentifier != nil { + objectMap["identifier"] = pcgr.CommunityGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PirCommunityGalleryResource struct. +func (pcgr *PirCommunityGalleryResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pcgr.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pcgr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pcgr.Type = &typeVar + } + case "identifier": + if v != nil { + var communityGalleryIdentifier CommunityGalleryIdentifier + err = json.Unmarshal(*v, &communityGalleryIdentifier) + if err != nil { + return err + } + pcgr.CommunityGalleryIdentifier = &communityGalleryIdentifier + } + } + } + + return nil +} + +// PirResource the Resource model definition. +type PirResource struct { + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for PirResource. +func (pr PirResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PirSharedGalleryResource base information about the shared gallery resource in pir. +type PirSharedGalleryResource struct { + *SharedGalleryIdentifier `json:"identifier,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for PirSharedGalleryResource. +func (psgr PirSharedGalleryResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if psgr.SharedGalleryIdentifier != nil { + objectMap["identifier"] = psgr.SharedGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PirSharedGalleryResource struct. +func (psgr *PirSharedGalleryResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identifier": + if v != nil { + var sharedGalleryIdentifier SharedGalleryIdentifier + err = json.Unmarshal(*v, &sharedGalleryIdentifier) + if err != nil { + return err + } + psgr.SharedGalleryIdentifier = &sharedGalleryIdentifier + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + psgr.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + psgr.Location = &location + } + } + } + + return nil +} + +// Plan specifies information about the marketplace image used to create the virtual machine. This element +// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable +// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use +// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and +// then click **Save**. +type Plan struct { + // Name - The plan ID. + Name *string `json:"name,omitempty"` + // Publisher - The publisher ID. + Publisher *string `json:"publisher,omitempty"` + // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. + Product *string `json:"product,omitempty"` + // PromotionCode - The promotion code. + PromotionCode *string `json:"promotionCode,omitempty"` +} + +// PrivateEndpoint the Private Endpoint resource. +type PrivateEndpoint struct { + // ID - READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpoint. +func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnection the Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; private endpoint connection Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; private endpoint connection name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; private endpoint connection type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult a list of private link resources +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateEndpointConnectionListResultIterator provides access to a complete listing of +// PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultIterator struct { + i int + page PrivateEndpointConnectionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateEndpointConnectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { + if !iter.page.NotDone() { + return PrivateEndpointConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. +func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { + return PrivateEndpointConnectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { + return peclr.Value == nil || len(*peclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { + return peclr.NextLink != nil && len(*peclr.NextLink) != 0 +} + +// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !peclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(peclr.NextLink))) +} + +// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultPage struct { + fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) + peclr PrivateEndpointConnectionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.peclr) + if err != nil { + return err + } + page.peclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateEndpointConnectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateEndpointConnectionListResultPage) NotDone() bool { + return !page.peclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { + return page.peclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { + if page.peclr.IsEmpty() { + return nil + } + return *page.peclr.Value +} + +// Creates a new instance of the PrivateEndpointConnectionListResultPage type. +func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { + return PrivateEndpointConnectionListResultPage{ + fn: getNextPage, + peclr: cur, + } +} + +// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - READ-ONLY; The resource of private end point. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between DiskAccess and Virtual Network. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed' + ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState + } + if pecp.ProvisioningState != "" { + objectMap["provisioningState"] = pecp.ProvisioningState + } + return json.Marshal(objectMap) +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; private link resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; private link resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; private link resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The private link resource DNS zone name. + 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 a collection of information about the state of the connection between +// service consumer and provider. +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateEndpointServiceConnectionStatusPending', 'PrivateEndpointServiceConnectionStatusApproved', 'PrivateEndpointServiceConnectionStatusRejected' + Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + // Description - The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// PropertyUpdatesInProgress properties of the disk for which update is pending. +type PropertyUpdatesInProgress struct { + // TargetTier - The target performance tier of the disk if a tier change operation is in progress. + TargetTier *string `json:"targetTier,omitempty"` +} + +// ProximityPlacementGroup specifies information about the proximity placement group. +type ProximityPlacementGroup struct { + autorest.Response `json:"-"` + // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. + *ProximityPlacementGroupProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ProximityPlacementGroup. +func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppg.ProximityPlacementGroupProperties != nil { + objectMap["properties"] = ppg.ProximityPlacementGroupProperties + } + if ppg.Location != nil { + objectMap["location"] = ppg.Location + } + if ppg.Tags != nil { + objectMap["tags"] = ppg.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. +func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var proximityPlacementGroupProperties ProximityPlacementGroupProperties + err = json.Unmarshal(*v, &proximityPlacementGroupProperties) + if err != nil { + return err + } + ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ppg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ppg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ppg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ppg.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ppg.Tags = tags + } + } + } + + return nil +} + +// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. +type ProximityPlacementGroupListResult struct { + autorest.Response `json:"-"` + // Value - The list of proximity placement groups + Value *[]ProximityPlacementGroup `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of proximity placement groups. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProximityPlacementGroupListResultIterator provides access to a complete listing of +// ProximityPlacementGroup values. +type ProximityPlacementGroupListResultIterator struct { + i int + page ProximityPlacementGroupListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProximityPlacementGroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { + if !iter.page.NotDone() { + return ProximityPlacementGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProximityPlacementGroupListResultIterator type. +func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { + return ProximityPlacementGroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { + return ppglr.Value == nil || len(*ppglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { + return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 +} + +// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ppglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ppglr.NextLink))) +} + +// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. +type ProximityPlacementGroupListResultPage struct { + fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) + ppglr ProximityPlacementGroupListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ppglr) + if err != nil { + return err + } + page.ppglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProximityPlacementGroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProximityPlacementGroupListResultPage) NotDone() bool { + return !page.ppglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { + return page.ppglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { + if page.ppglr.IsEmpty() { + return nil + } + return *page.ppglr.Value +} + +// Creates a new instance of the ProximityPlacementGroupListResultPage type. +func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { + return ProximityPlacementGroupListResultPage{ + fn: getNextPage, + ppglr: cur, + } +} + +// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. +type ProximityPlacementGroupProperties struct { + // ProximityPlacementGroupType - Specifies the type of the proximity placement group.

Possible values are:

**Standard** : Co-locate resources within an Azure region or Availability Zone.

**Ultra** : For future use. Possible values include: 'ProximityPlacementGroupTypeStandard', 'ProximityPlacementGroupTypeUltra' + ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` + // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. + VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` + // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. + VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` + // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. + AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` + // ColocationStatus - Describes colocation status of the Proximity Placement Group. + ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. +func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppgp.ProximityPlacementGroupType != "" { + objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType + } + if ppgp.ColocationStatus != nil { + objectMap["colocationStatus"] = ppgp.ColocationStatus + } + return json.Marshal(objectMap) +} + +// ProximityPlacementGroupUpdate specifies information about the proximity placement group. +type ProximityPlacementGroupUpdate struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. +func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppgu.Tags != nil { + objectMap["tags"] = ppgu.Tags + } + return json.Marshal(objectMap) +} + +// ProxyOnlyResource the ProxyOnly Resource model definition. +type ProxyOnlyResource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyOnlyResource. +func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ProxyResource the resource model definition for an Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PublicIPAddressSku describes the public IP Sku +type PublicIPAddressSku struct { + // Name - Specify public IP sku name. Possible values include: 'PublicIPAddressSkuNameBasic', 'PublicIPAddressSkuNameStandard' + Name PublicIPAddressSkuName `json:"name,omitempty"` + // Tier - Specify public IP sku tier. Possible values include: 'PublicIPAddressSkuTierRegional', 'PublicIPAddressSkuTierGlobal' + Tier PublicIPAddressSkuTier `json:"tier,omitempty"` +} + +// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. +type PurchasePlan struct { + // Publisher - The publisher ID. + Publisher *string `json:"publisher,omitempty"` + // Name - The plan ID. + Name *string `json:"name,omitempty"` + // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. + Product *string `json:"product,omitempty"` + // PromotionCode - The Offer Promotion Code. + PromotionCode *string `json:"promotionCode,omitempty"` +} + +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} + +// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this +// Image Definition. These properties are updatable. +type RecommendedMachineConfiguration struct { + VCPUs *ResourceRange `json:"vCPUs,omitempty"` + Memory *ResourceRange `json:"memory,omitempty"` +} + +// RecoveryWalkResponse response after calling a manual recovery walk +type RecoveryWalkResponse struct { + autorest.Response `json:"-"` + // WalkPerformed - READ-ONLY; Whether the recovery walk was performed + WalkPerformed *bool `json:"walkPerformed,omitempty"` + // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed + NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecoveryWalkResponse. +func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RegionalReplicationStatus this is the regional replication status. +type RegionalReplicationStatus struct { + // Region - READ-ONLY; The region to which the gallery image version is being replicated to. + Region *string `json:"region,omitempty"` + // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' + State ReplicationState `json:"state,omitempty"` + // Details - READ-ONLY; The details of the replication status. + Details *string `json:"details,omitempty"` + // Progress - READ-ONLY; It indicates progress of the replication job. + Progress *int32 `json:"progress,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegionalReplicationStatus. +func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ReplicationStatus this is the replication status of the gallery image version. +type ReplicationStatus struct { + // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'AggregatedReplicationStateUnknown', 'AggregatedReplicationStateInProgress', 'AggregatedReplicationStateCompleted', 'AggregatedReplicationStateFailed' + AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` + // Summary - READ-ONLY; This is a summary of replication status for each region. + Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationStatus. +func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. +type RequestRateByIntervalInput struct { + // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'IntervalInMinsThreeMins', 'IntervalInMinsFiveMins', 'IntervalInMinsThirtyMins', 'IntervalInMinsSixtyMins' + IntervalLength IntervalInMins `json:"intervalLength,omitempty"` + // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. + BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` + // FromTime - From time of the query + FromTime *date.Time `json:"fromTime,omitempty"` + // ToTime - To time of the query + ToTime *date.Time `json:"toTime,omitempty"` + // GroupByThrottlePolicy - Group query result by Throttle Policy applied. + GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` + // GroupByOperationName - Group query result by Operation Name. + GroupByOperationName *bool `json:"groupByOperationName,omitempty"` + // GroupByResourceName - Group query result by Resource Name. + GroupByResourceName *bool `json:"groupByResourceName,omitempty"` + // GroupByClientApplicationID - Group query result by Client Application ID. + GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` + // GroupByUserAgent - Group query result by User Agent. + GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceInstanceViewStatus instance view status. +type ResourceInstanceViewStatus struct { + // Code - READ-ONLY; The status code. + Code *string `json:"code,omitempty"` + // DisplayStatus - READ-ONLY; The short localizable label for the status. + DisplayStatus *string `json:"displayStatus,omitempty"` + // Message - READ-ONLY; The detailed status message, including for alerts and error messages. + Message *string `json:"message,omitempty"` + // Time - READ-ONLY; The time of the status. + Time *date.Time `json:"time,omitempty"` + // Level - The level code. Possible values include: 'StatusLevelTypesInfo', 'StatusLevelTypesWarning', 'StatusLevelTypesError' + Level StatusLevelTypes `json:"level,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceInstanceViewStatus. +func (rivs ResourceInstanceViewStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rivs.Level != "" { + objectMap["level"] = rivs.Level + } + return json.Marshal(objectMap) +} + +// ResourceRange describes the resource range. +type ResourceRange struct { + // Min - The minimum number of the resource. + Min *int32 `json:"min,omitempty"` + // Max - The maximum number of the resource. + Max *int32 `json:"max,omitempty"` +} + +// ResourceSku describes an available Compute SKU. +type ResourceSku struct { + // ResourceType - READ-ONLY; The type of resource the SKU applies to. + ResourceType *string `json:"resourceType,omitempty"` + // Name - READ-ONLY; The name of SKU. + Name *string `json:"name,omitempty"` + // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** + Tier *string `json:"tier,omitempty"` + // Size - READ-ONLY; The Size of the SKU. + Size *string `json:"size,omitempty"` + // Family - READ-ONLY; The Family of this particular SKU. + Family *string `json:"family,omitempty"` + // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. + Kind *string `json:"kind,omitempty"` + // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. + Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` + // Locations - READ-ONLY; The set of locations that the SKU is available. + Locations *[]string `json:"locations,omitempty"` + // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. + LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` + // APIVersions - READ-ONLY; The api versions that support this SKU. + APIVersions *[]string `json:"apiVersions,omitempty"` + // Costs - READ-ONLY; Metadata for retrieving price info. + Costs *[]ResourceSkuCosts `json:"costs,omitempty"` + // Capabilities - READ-ONLY; A name value pair to describe the capability. + Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` + // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSku. +func (rs ResourceSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuCapabilities describes The SKU capabilities object. +type ResourceSkuCapabilities struct { + // Name - READ-ONLY; An invariant to describe the feature. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; An invariant if the feature is measured by quantity. + Value *string `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. +func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuCapacity describes scaling information of a SKU. +type ResourceSkuCapacity struct { + // Minimum - READ-ONLY; The minimum capacity. + Minimum *int64 `json:"minimum,omitempty"` + // Maximum - READ-ONLY; The maximum capacity that can be set. + Maximum *int64 `json:"maximum,omitempty"` + // Default - READ-ONLY; The default capacity. + Default *int64 `json:"default,omitempty"` + // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' + ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuCapacity. +func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuCosts describes metadata for retrieving price info. +type ResourceSkuCosts struct { + // MeterID - READ-ONLY; Used for querying price from commerce. + MeterID *string `json:"meterID,omitempty"` + // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. + Quantity *int64 `json:"quantity,omitempty"` + // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. + ExtendedUnit *string `json:"extendedUnit,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuCosts. +func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuLocationInfo describes an available Compute SKU Location Information. +type ResourceSkuLocationInfo struct { + // Location - READ-ONLY; Location of the SKU + Location *string `json:"location,omitempty"` + // Zones - READ-ONLY; List of availability zones where the SKU is supported. + Zones *[]string `json:"zones,omitempty"` + // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. + ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` + // ExtendedLocations - READ-ONLY; The names of extended locations. + ExtendedLocations *[]string `json:"extendedLocations,omitempty"` + // Type - READ-ONLY; The type of the extended location. Possible values include: 'ExtendedLocationTypeEdgeZone' + Type ExtendedLocationType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. +func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuRestrictionInfo describes an available Compute SKU Restriction Information. +type ResourceSkuRestrictionInfo struct { + // Locations - READ-ONLY; Locations where the SKU is restricted + Locations *[]string `json:"locations,omitempty"` + // Zones - READ-ONLY; List of availability zones where the SKU is restricted. + Zones *[]string `json:"zones,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. +func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkuRestrictions describes scaling information of a SKU. +type ResourceSkuRestrictions struct { + // Type - READ-ONLY; The type of restrictions. Possible values include: 'ResourceSkuRestrictionsTypeLocation', 'ResourceSkuRestrictionsTypeZone' + Type ResourceSkuRestrictionsType `json:"type,omitempty"` + // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + Values *[]string `json:"values,omitempty"` + // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. + RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` + // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'ResourceSkuRestrictionsReasonCodeQuotaID', 'ResourceSkuRestrictionsReasonCodeNotAvailableForSubscription' + ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. +func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceSkusResult the List Resource Skus operation response. +type ResourceSkusResult struct { + autorest.Response `json:"-"` + // Value - The list of skus available for the subscription. + Value *[]ResourceSku `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. +type ResourceSkusResultIterator struct { + i int + page ResourceSkusResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceSkusResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceSkusResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceSkusResultIterator) Value() ResourceSku { + if !iter.page.NotDone() { + return ResourceSku{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceSkusResultIterator type. +func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { + return ResourceSkusResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rsr ResourceSkusResult) IsEmpty() bool { + return rsr.Value == nil || len(*rsr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rsr ResourceSkusResult) hasNextLink() bool { + return rsr.NextLink != nil && len(*rsr.NextLink) != 0 +} + +// resourceSkusResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { + if !rsr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rsr.NextLink))) +} + +// ResourceSkusResultPage contains a page of ResourceSku values. +type ResourceSkusResultPage struct { + fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) + rsr ResourceSkusResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rsr) + if err != nil { + return err + } + page.rsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceSkusResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceSkusResultPage) NotDone() bool { + return !page.rsr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceSkusResultPage) Response() ResourceSkusResult { + return page.rsr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceSkusResultPage) Values() []ResourceSku { + if page.rsr.IsEmpty() { + return nil + } + return *page.rsr.Value +} + +// Creates a new instance of the ResourceSkusResultPage type. +func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { + return ResourceSkusResultPage{ + fn: getNextPage, + rsr: cur, + } +} + +// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. +type ResourceSkuZoneDetails struct { + // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. + Name *[]string `json:"name,omitempty"` + // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. + Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. +func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceURIList the List resources which are encrypted with the disk encryption set. +type ResourceURIList struct { + autorest.Response `json:"-"` + // Value - A list of IDs or Owner IDs of resources which are encrypted with the disk encryption set. + Value *[]string `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of encrypted resources. Call ListNext() with this to fetch the next page of encrypted resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceURIListIterator provides access to a complete listing of string values. +type ResourceURIListIterator struct { + i int + page ResourceURIListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceURIListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceURIListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceURIListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceURIListIterator) Response() ResourceURIList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceURIListIterator) Value() string { + if !iter.page.NotDone() { + return "" + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceURIListIterator type. +func NewResourceURIListIterator(page ResourceURIListPage) ResourceURIListIterator { + return ResourceURIListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rul ResourceURIList) IsEmpty() bool { + return rul.Value == nil || len(*rul.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rul ResourceURIList) hasNextLink() bool { + return rul.NextLink != nil && len(*rul.NextLink) != 0 +} + +// resourceURIListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rul ResourceURIList) resourceURIListPreparer(ctx context.Context) (*http.Request, error) { + if !rul.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rul.NextLink))) +} + +// ResourceURIListPage contains a page of string values. +type ResourceURIListPage struct { + fn func(context.Context, ResourceURIList) (ResourceURIList, error) + rul ResourceURIList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceURIListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceURIListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rul) + if err != nil { + return err + } + page.rul = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceURIListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceURIListPage) NotDone() bool { + return !page.rul.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceURIListPage) Response() ResourceURIList { + return page.rul +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceURIListPage) Values() []string { + if page.rul.IsEmpty() { + return nil + } + return *page.rul.Value +} + +// Creates a new instance of the ResourceURIListPage type. +func NewResourceURIListPage(cur ResourceURIList, getNextPage func(context.Context, ResourceURIList) (ResourceURIList, error)) ResourceURIListPage { + return ResourceURIListPage{ + fn: getNextPage, + rul: cur, + } +} + +// RestorePoint restore Point details. +type RestorePoint struct { + autorest.Response `json:"-"` + *RestorePointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorePoint. +func (rp RestorePoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RestorePointProperties != nil { + objectMap["properties"] = rp.RestorePointProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorePoint struct. +func (rp *RestorePoint) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorePointProperties RestorePointProperties + err = json.Unmarshal(*v, &restorePointProperties) + if err != nil { + return err + } + rp.RestorePointProperties = &restorePointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rp.Type = &typeVar + } + } + } + + return nil +} + +// RestorePointCollection create or update Restore Point collection parameters. +type RestorePointCollection struct { + autorest.Response `json:"-"` + *RestorePointCollectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RestorePointCollection. +func (RPCVar RestorePointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if RPCVar.RestorePointCollectionProperties != nil { + objectMap["properties"] = RPCVar.RestorePointCollectionProperties + } + if RPCVar.Location != nil { + objectMap["location"] = RPCVar.Location + } + if RPCVar.Tags != nil { + objectMap["tags"] = RPCVar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorePointCollection struct. +func (RPCVar *RestorePointCollection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorePointCollectionProperties RestorePointCollectionProperties + err = json.Unmarshal(*v, &restorePointCollectionProperties) + if err != nil { + return err + } + RPCVar.RestorePointCollectionProperties = &restorePointCollectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + RPCVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + RPCVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + RPCVar.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + RPCVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + RPCVar.Tags = tags + } + } + } + + return nil +} + +// RestorePointCollectionListResult the List restore point collection operation response. +type RestorePointCollectionListResult struct { + autorest.Response `json:"-"` + // Value - Gets the list of restore point collections. + Value *[]RestorePointCollection `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of RestorePointCollections. Call ListNext() with this to fetch the next page of RestorePointCollections + NextLink *string `json:"nextLink,omitempty"` +} + +// RestorePointCollectionListResultIterator provides access to a complete listing of RestorePointCollection +// values. +type RestorePointCollectionListResultIterator struct { + i int + page RestorePointCollectionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RestorePointCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RestorePointCollectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RestorePointCollectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RestorePointCollectionListResultIterator) Response() RestorePointCollectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RestorePointCollectionListResultIterator) Value() RestorePointCollection { + if !iter.page.NotDone() { + return RestorePointCollection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RestorePointCollectionListResultIterator type. +func NewRestorePointCollectionListResultIterator(page RestorePointCollectionListResultPage) RestorePointCollectionListResultIterator { + return RestorePointCollectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rpclr RestorePointCollectionListResult) IsEmpty() bool { + return rpclr.Value == nil || len(*rpclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rpclr RestorePointCollectionListResult) hasNextLink() bool { + return rpclr.NextLink != nil && len(*rpclr.NextLink) != 0 +} + +// restorePointCollectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rpclr RestorePointCollectionListResult) restorePointCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rpclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rpclr.NextLink))) +} + +// RestorePointCollectionListResultPage contains a page of RestorePointCollection values. +type RestorePointCollectionListResultPage struct { + fn func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error) + rpclr RestorePointCollectionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RestorePointCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rpclr) + if err != nil { + return err + } + page.rpclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RestorePointCollectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RestorePointCollectionListResultPage) NotDone() bool { + return !page.rpclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RestorePointCollectionListResultPage) Response() RestorePointCollectionListResult { + return page.rpclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RestorePointCollectionListResultPage) Values() []RestorePointCollection { + if page.rpclr.IsEmpty() { + return nil + } + return *page.rpclr.Value +} + +// Creates a new instance of the RestorePointCollectionListResultPage type. +func NewRestorePointCollectionListResultPage(cur RestorePointCollectionListResult, getNextPage func(context.Context, RestorePointCollectionListResult) (RestorePointCollectionListResult, error)) RestorePointCollectionListResultPage { + return RestorePointCollectionListResultPage{ + fn: getNextPage, + rpclr: cur, + } +} + +// RestorePointCollectionProperties the restore point collection properties. +type RestorePointCollectionProperties struct { + Source *RestorePointCollectionSourceProperties `json:"source,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the restore point collection. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RestorePointCollectionID - READ-ONLY; The unique id of the restore point collection. + RestorePointCollectionID *string `json:"restorePointCollectionId,omitempty"` + // RestorePoints - READ-ONLY; A list containing all restore points created under this restore point collection. + RestorePoints *[]RestorePoint `json:"restorePoints,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorePointCollectionProperties. +func (rpcp RestorePointCollectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpcp.Source != nil { + objectMap["source"] = rpcp.Source + } + return json.Marshal(objectMap) +} + +// RestorePointCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RestorePointCollectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RestorePointCollectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RestorePointCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RestorePointCollectionsDeleteFuture.Result. +func (future *RestorePointCollectionsDeleteFuture) result(client RestorePointCollectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.RestorePointCollectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RestorePointCollectionSourceProperties the properties of the source resource that this restore point +// collection is created from. +type RestorePointCollectionSourceProperties struct { + // Location - READ-ONLY; Location of the source resource used to create this restore point collection. + Location *string `json:"location,omitempty"` + // ID - Resource Id of the source resource used to create this restore point collection + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorePointCollectionSourceProperties. +func (rpcsp RestorePointCollectionSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpcsp.ID != nil { + objectMap["id"] = rpcsp.ID + } + return json.Marshal(objectMap) +} + +// RestorePointCollectionUpdate update Restore Point collection parameters. +type RestorePointCollectionUpdate struct { + *RestorePointCollectionProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RestorePointCollectionUpdate. +func (rpcu RestorePointCollectionUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpcu.RestorePointCollectionProperties != nil { + objectMap["properties"] = rpcu.RestorePointCollectionProperties + } + if rpcu.Tags != nil { + objectMap["tags"] = rpcu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestorePointCollectionUpdate struct. +func (rpcu *RestorePointCollectionUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restorePointCollectionProperties RestorePointCollectionProperties + err = json.Unmarshal(*v, &restorePointCollectionProperties) + if err != nil { + return err + } + rpcu.RestorePointCollectionProperties = &restorePointCollectionProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rpcu.Tags = tags + } + } + } + + return nil +} + +// RestorePointProperties the restore point properties. +type RestorePointProperties struct { + // ExcludeDisks - List of disk resource ids that the customer wishes to exclude from the restore point. If no disks are specified, all disks will be included. + ExcludeDisks *[]APIEntityReference `json:"excludeDisks,omitempty"` + // SourceMetadata - READ-ONLY; Gets the details of the VM captured at the time of the restore point creation. + SourceMetadata *RestorePointSourceMetadata `json:"sourceMetadata,omitempty"` + // ProvisioningState - READ-ONLY; Gets the provisioning state of the restore point. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ConsistencyMode - READ-ONLY; Gets the consistency mode for the restore point. Please refer to https://aka.ms/RestorePoints for more details. Possible values include: 'ConsistencyModeTypesCrashConsistent', 'ConsistencyModeTypesFileSystemConsistent', 'ConsistencyModeTypesApplicationConsistent' + ConsistencyMode ConsistencyModeTypes `json:"consistencyMode,omitempty"` + // TimeCreated - Gets the creation time of the restore point. + TimeCreated *date.Time `json:"timeCreated,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestorePointProperties. +func (rpp RestorePointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpp.ExcludeDisks != nil { + objectMap["excludeDisks"] = rpp.ExcludeDisks + } + if rpp.TimeCreated != nil { + objectMap["timeCreated"] = rpp.TimeCreated + } + return json.Marshal(objectMap) +} + +// RestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RestorePointsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RestorePointsClient) (RestorePoint, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RestorePointsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RestorePointsCreateFuture.Result. +func (future *RestorePointsCreateFuture) result(client RestorePointsClient) (rp RestorePoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.RestorePointsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rp.Response.Response, err = future.GetResult(sender); err == nil && rp.Response.Response.StatusCode != http.StatusNoContent { + rp, err = client.CreateResponder(rp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsCreateFuture", "Result", rp.Response.Response, "Failure responding to request") + } + } + return +} + +// RestorePointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RestorePointsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RestorePointsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RestorePointsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RestorePointsDeleteFuture.Result. +func (future *RestorePointsDeleteFuture) result(client RestorePointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.RestorePointsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RestorePointSourceMetadata describes the properties of the Virtual Machine for which the restore point +// was created. The properties provided are a subset and the snapshot of the overall Virtual Machine +// properties captured at the time of the restore point creation. +type RestorePointSourceMetadata struct { + // HardwareProfile - Gets the hardware profile. + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + // StorageProfile - Gets the storage profile. + StorageProfile *RestorePointSourceVMStorageProfile `json:"storageProfile,omitempty"` + // OsProfile - Gets the OS profile. + OsProfile *OSProfile `json:"osProfile,omitempty"` + // DiagnosticsProfile - Gets the diagnostics profile. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + // LicenseType - Gets the license type, which is for bring your own license scenario. + LicenseType *string `json:"licenseType,omitempty"` + // VMID - Gets the virtual machine unique id. + VMID *string `json:"vmId,omitempty"` + // SecurityProfile - Gets the security profile. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // Location - Location of the VM from which the restore point was created. + Location *string `json:"location,omitempty"` +} + +// RestorePointSourceVMDataDisk describes a data disk. +type RestorePointSourceVMDataDisk struct { + // Lun - Gets the logical unit number. + Lun *int32 `json:"lun,omitempty"` + // Name - Gets the disk name. + Name *string `json:"name,omitempty"` + // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // DiskSizeGB - Gets the initial disk size in GB for blank data disks, and the new desired size for existing OS and Data disks. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // ManagedDisk - Gets the managed disk details + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + // DiskRestorePoint - Gets the disk restore point Id. + DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` +} + +// RestorePointSourceVMOSDisk describes an Operating System disk. +type RestorePointSourceVMOSDisk struct { + // OsType - Gets the Operating System type. Possible values include: 'OperatingSystemTypeWindows', 'OperatingSystemTypeLinux' + OsType OperatingSystemType `json:"osType,omitempty"` + // EncryptionSettings - Gets the disk encryption settings. + EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + // Name - Gets the disk name. + Name *string `json:"name,omitempty"` + // Caching - Gets the caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // DiskSizeGB - Gets the disk size in GB. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // ManagedDisk - Gets the managed disk details + ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` + // DiskRestorePoint - Gets the disk restore point Id. + DiskRestorePoint *APIEntityReference `json:"diskRestorePoint,omitempty"` +} + +// RestorePointSourceVMStorageProfile describes the storage profile. +type RestorePointSourceVMStorageProfile struct { + // OsDisk - Gets the OS disk of the VM captured at the time of the restore point creation. + OsDisk *RestorePointSourceVMOSDisk `json:"osDisk,omitempty"` + // DataDisks - Gets the data disks of the VM captured at the time of the restore point creation. + DataDisks *[]RestorePointSourceVMDataDisk `json:"dataDisks,omitempty"` +} + +// RetrieveBootDiagnosticsDataResult the SAS URIs of the console screenshot and serial log blobs. +type RetrieveBootDiagnosticsDataResult struct { + autorest.Response `json:"-"` + // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI + ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` + // SerialConsoleLogBlobURI - READ-ONLY; The serial console log blob URI. + SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` +} + +// MarshalJSON is the custom marshaler for RetrieveBootDiagnosticsDataResult. +func (rbddr RetrieveBootDiagnosticsDataResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RoleInstance ... +type RoleInstance struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource Type. + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Resource Location. + Location *string `json:"location,omitempty"` + // Tags - READ-ONLY; Resource tags. + Tags map[string]*string `json:"tags"` + Sku *InstanceSku `json:"sku,omitempty"` + Properties *RoleInstanceProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoleInstance. +func (ri RoleInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ri.Sku != nil { + objectMap["sku"] = ri.Sku + } + if ri.Properties != nil { + objectMap["properties"] = ri.Properties + } + return json.Marshal(objectMap) +} + +// RoleInstanceInstanceView the instance view of the role instance. +type RoleInstanceInstanceView struct { + autorest.Response `json:"-"` + // PlatformUpdateDomain - READ-ONLY; The Update Domain. + PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` + // PlatformFaultDomain - READ-ONLY; The Fault Domain. + PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` + // PrivateID - READ-ONLY; Specifies a unique identifier generated internally for the cloud service associated with this role instance.

NOTE: If you are using Azure Diagnostics extension, this property can be used as 'DeploymentId' for querying details. + PrivateID *string `json:"privateId,omitempty"` + // Statuses - READ-ONLY + Statuses *[]ResourceInstanceViewStatus `json:"statuses,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoleInstanceInstanceView. +func (riiv RoleInstanceInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RoleInstanceListResult ... +type RoleInstanceListResult struct { + autorest.Response `json:"-"` + Value *[]RoleInstance `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// RoleInstanceListResultIterator provides access to a complete listing of RoleInstance values. +type RoleInstanceListResultIterator struct { + i int + page RoleInstanceListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RoleInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RoleInstanceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RoleInstanceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RoleInstanceListResultIterator) Response() RoleInstanceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RoleInstanceListResultIterator) Value() RoleInstance { + if !iter.page.NotDone() { + return RoleInstance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RoleInstanceListResultIterator type. +func NewRoleInstanceListResultIterator(page RoleInstanceListResultPage) RoleInstanceListResultIterator { + return RoleInstanceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rilr RoleInstanceListResult) IsEmpty() bool { + return rilr.Value == nil || len(*rilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rilr RoleInstanceListResult) hasNextLink() bool { + return rilr.NextLink != nil && len(*rilr.NextLink) != 0 +} + +// roleInstanceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rilr RoleInstanceListResult) roleInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rilr.NextLink))) +} + +// RoleInstanceListResultPage contains a page of RoleInstance values. +type RoleInstanceListResultPage struct { + fn func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error) + rilr RoleInstanceListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RoleInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleInstanceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rilr) + if err != nil { + return err + } + page.rilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RoleInstanceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RoleInstanceListResultPage) NotDone() bool { + return !page.rilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RoleInstanceListResultPage) Response() RoleInstanceListResult { + return page.rilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RoleInstanceListResultPage) Values() []RoleInstance { + if page.rilr.IsEmpty() { + return nil + } + return *page.rilr.Value +} + +// Creates a new instance of the RoleInstanceListResultPage type. +func NewRoleInstanceListResultPage(cur RoleInstanceListResult, getNextPage func(context.Context, RoleInstanceListResult) (RoleInstanceListResult, error)) RoleInstanceListResultPage { + return RoleInstanceListResultPage{ + fn: getNextPage, + rilr: cur, + } +} + +// RoleInstanceNetworkProfile describes the network profile for the role instance. +type RoleInstanceNetworkProfile struct { + // NetworkInterfaces - READ-ONLY; Specifies the list of resource Ids for the network interfaces associated with the role instance. + NetworkInterfaces *[]SubResource `json:"networkInterfaces,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoleInstanceNetworkProfile. +func (rinp RoleInstanceNetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RoleInstanceProperties ... +type RoleInstanceProperties struct { + NetworkProfile *RoleInstanceNetworkProfile `json:"networkProfile,omitempty"` + InstanceView *RoleInstanceInstanceView `json:"instanceView,omitempty"` +} + +// RoleInstances specifies a list of role instances from the cloud service. +type RoleInstances struct { + // RoleInstances - List of cloud service role instance names. Value of '*' will signify all role instances of the cloud service. + RoleInstances *[]string `json:"roleInstances,omitempty"` +} + +// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. +type RollbackStatusInfo struct { + // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. + SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` + // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. + FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` + // RollbackError - READ-ONLY; Error details if OS rollback failed. + RollbackError *APIError `json:"rollbackError,omitempty"` +} + +// MarshalJSON is the custom marshaler for RollbackStatusInfo. +func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. +type RollingUpgradePolicy struct { + // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. + MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` + // MaxUnhealthyInstancePercent - The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. + MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` + // MaxUnhealthyUpgradedInstancePercent - The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. + MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` + // PauseTimeBetweenBatches - The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). + PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` + // EnableCrossZoneUpgrade - Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. + EnableCrossZoneUpgrade *bool `json:"enableCrossZoneUpgrade,omitempty"` + // PrioritizeUnhealthyInstances - Upgrade all unhealthy instances in a scale set before any healthy instances. + PrioritizeUnhealthyInstances *bool `json:"prioritizeUnhealthyInstances,omitempty"` +} + +// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade +// state. +type RollingUpgradeProgressInfo struct { + // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. + SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` + // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. + FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` + // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. + InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` + // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. + PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. +func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. +type RollingUpgradeRunningStatus struct { + // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' + Code RollingUpgradeStatusCode `json:"code,omitempty"` + // StartTime - READ-ONLY; Start time of the upgrade. + StartTime *date.Time `json:"startTime,omitempty"` + // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'RollingUpgradeActionTypeStart', 'RollingUpgradeActionTypeCancel' + LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` + // LastActionTime - READ-ONLY; Last action time of the upgrade. + LastActionTime *date.Time `json:"lastActionTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. +func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. +type RollingUpgradeStatusInfo struct { + autorest.Response `json:"-"` + *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. +func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rusi.RollingUpgradeStatusInfoProperties != nil { + objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties + } + if rusi.Location != nil { + objectMap["location"] = rusi.Location + } + if rusi.Tags != nil { + objectMap["tags"] = rusi.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. +func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties + err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) + if err != nil { + return err + } + rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rusi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rusi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rusi.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rusi.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rusi.Tags = tags + } + } + } + + return nil +} + +// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. +type RollingUpgradeStatusInfoProperties struct { + // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. + Policy *RollingUpgradePolicy `json:"policy,omitempty"` + // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. + RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` + // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. + Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` + // Error - READ-ONLY; Error details for this upgrade, if there are any. + Error *APIError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. +func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RunCommandDocument describes the properties of a Run Command. +type RunCommandDocument struct { + autorest.Response `json:"-"` + // Script - The script to be executed. + Script *[]string `json:"script,omitempty"` + // Parameters - The parameters used by the script. + Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` + // Schema - The VM run command schema. + Schema *string `json:"$schema,omitempty"` + // ID - The VM run command id. + ID *string `json:"id,omitempty"` + // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // Label - The VM run command label. + Label *string `json:"label,omitempty"` + // Description - The VM run command description. + Description *string `json:"description,omitempty"` +} + +// RunCommandDocumentBase describes the properties of a Run Command metadata. +type RunCommandDocumentBase struct { + // Schema - The VM run command schema. + Schema *string `json:"$schema,omitempty"` + // ID - The VM run command id. + ID *string `json:"id,omitempty"` + // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // Label - The VM run command label. + Label *string `json:"label,omitempty"` + // Description - The VM run command description. + Description *string `json:"description,omitempty"` +} + +// RunCommandInput capture Virtual Machine parameters. +type RunCommandInput struct { + // CommandID - The run command id. + CommandID *string `json:"commandId,omitempty"` + // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. + Script *[]string `json:"script,omitempty"` + // Parameters - The run command parameters. + Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` +} + +// RunCommandInputParameter describes the properties of a run command parameter. +type RunCommandInputParameter struct { + // Name - The run command parameter name. + Name *string `json:"name,omitempty"` + // Value - The run command parameter value. + Value *string `json:"value,omitempty"` +} + +// RunCommandListResult the List Virtual Machine operation response. +type RunCommandListResult struct { + autorest.Response `json:"-"` + // Value - The list of virtual machine run commands. + Value *[]RunCommandDocumentBase `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. + NextLink *string `json:"nextLink,omitempty"` +} + +// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. +type RunCommandListResultIterator struct { + i int + page RunCommandListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RunCommandListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RunCommandListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RunCommandListResultIterator) Response() RunCommandListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { + if !iter.page.NotDone() { + return RunCommandDocumentBase{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RunCommandListResultIterator type. +func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { + return RunCommandListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rclr RunCommandListResult) IsEmpty() bool { + return rclr.Value == nil || len(*rclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rclr RunCommandListResult) hasNextLink() bool { + return rclr.NextLink != nil && len(*rclr.NextLink) != 0 +} + +// runCommandListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rclr.NextLink))) +} + +// RunCommandListResultPage contains a page of RunCommandDocumentBase values. +type RunCommandListResultPage struct { + fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) + rclr RunCommandListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rclr) + if err != nil { + return err + } + page.rclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RunCommandListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RunCommandListResultPage) NotDone() bool { + return !page.rclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RunCommandListResultPage) Response() RunCommandListResult { + return page.rclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { + if page.rclr.IsEmpty() { + return nil + } + return *page.rclr.Value +} + +// Creates a new instance of the RunCommandListResultPage type. +func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { + return RunCommandListResultPage{ + fn: getNextPage, + rclr: cur, + } +} + +// RunCommandParameterDefinition describes the properties of a run command parameter. +type RunCommandParameterDefinition struct { + // Name - The run command parameter name. + Name *string `json:"name,omitempty"` + // Type - The run command parameter type. + Type *string `json:"type,omitempty"` + // DefaultValue - The run command parameter default value. + DefaultValue *string `json:"defaultValue,omitempty"` + // Required - The run command parameter required. + Required *bool `json:"required,omitempty"` +} + +// RunCommandResult ... +type RunCommandResult struct { + autorest.Response `json:"-"` + // Value - Run command operation response. + Value *[]InstanceViewStatus `json:"value,omitempty"` +} + +// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. +type ScaleInPolicy struct { + // Rules - The rules to be followed when scaling-in a virtual machine scale set.

Possible values are:

**Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

**OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

**NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

+ Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` + // ForceDeletion - This property allows you to specify if virtual machines chosen for removal have to be force deleted when a virtual machine scale set is being scaled-in.(Feature in Preview) + ForceDeletion *bool `json:"forceDeletion,omitempty"` +} + +// ScheduledEventsProfile ... +type ScheduledEventsProfile struct { + // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. + TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` +} + +// SecurityProfile specifies the Security profile settings for the virtual machine or virtual machine scale +// set. +type SecurityProfile struct { + // UefiSettings - Specifies the security settings like secure boot and vTPM used while creating the virtual machine.

Minimum api-version: 2020-12-01 + UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` + // EncryptionAtHost - This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself.

Default: The Encryption at host will be disabled unless this property is set to true for the resource. + EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` + // SecurityType - Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings.

Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch. Possible values include: 'SecurityTypesTrustedLaunch' + SecurityType SecurityTypes `json:"securityType,omitempty"` +} + +// SharedGallery specifies information about the Shared Gallery that you want to create or update. +type SharedGallery struct { + autorest.Response `json:"-"` + *SharedGalleryIdentifier `json:"identifier,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SharedGallery. +func (sg SharedGallery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sg.SharedGalleryIdentifier != nil { + objectMap["identifier"] = sg.SharedGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SharedGallery struct. +func (sg *SharedGallery) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identifier": + if v != nil { + var sharedGalleryIdentifier SharedGalleryIdentifier + err = json.Unmarshal(*v, &sharedGalleryIdentifier) + if err != nil { + return err + } + sg.SharedGalleryIdentifier = &sharedGalleryIdentifier + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sg.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sg.Location = &location + } + } + } + + return nil +} + +// SharedGalleryIdentifier the identifier information of shared gallery. +type SharedGalleryIdentifier struct { + // UniqueID - The unique id of this shared gallery. + UniqueID *string `json:"uniqueId,omitempty"` +} + +// SharedGalleryImage specifies information about the gallery image definition that you want to create or +// update. +type SharedGalleryImage struct { + autorest.Response `json:"-"` + *SharedGalleryImageProperties `json:"properties,omitempty"` + *SharedGalleryIdentifier `json:"identifier,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SharedGalleryImage. +func (sgi SharedGalleryImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sgi.SharedGalleryImageProperties != nil { + objectMap["properties"] = sgi.SharedGalleryImageProperties + } + if sgi.SharedGalleryIdentifier != nil { + objectMap["identifier"] = sgi.SharedGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SharedGalleryImage struct. +func (sgi *SharedGalleryImage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sharedGalleryImageProperties SharedGalleryImageProperties + err = json.Unmarshal(*v, &sharedGalleryImageProperties) + if err != nil { + return err + } + sgi.SharedGalleryImageProperties = &sharedGalleryImageProperties + } + case "identifier": + if v != nil { + var sharedGalleryIdentifier SharedGalleryIdentifier + err = json.Unmarshal(*v, &sharedGalleryIdentifier) + if err != nil { + return err + } + sgi.SharedGalleryIdentifier = &sharedGalleryIdentifier + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sgi.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sgi.Location = &location + } + } + } + + return nil +} + +// SharedGalleryImageList the List Shared Gallery Images operation response. +type SharedGalleryImageList struct { + autorest.Response `json:"-"` + // Value - A list of shared gallery images. + Value *[]SharedGalleryImage `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of shared gallery images. Call ListNext() with this to fetch the next page of shared gallery images. + NextLink *string `json:"nextLink,omitempty"` +} + +// SharedGalleryImageListIterator provides access to a complete listing of SharedGalleryImage values. +type SharedGalleryImageListIterator struct { + i int + page SharedGalleryImageListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SharedGalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SharedGalleryImageListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SharedGalleryImageListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SharedGalleryImageListIterator) Response() SharedGalleryImageList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SharedGalleryImageListIterator) Value() SharedGalleryImage { + if !iter.page.NotDone() { + return SharedGalleryImage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SharedGalleryImageListIterator type. +func NewSharedGalleryImageListIterator(page SharedGalleryImageListPage) SharedGalleryImageListIterator { + return SharedGalleryImageListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sgil SharedGalleryImageList) IsEmpty() bool { + return sgil.Value == nil || len(*sgil.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sgil SharedGalleryImageList) hasNextLink() bool { + return sgil.NextLink != nil && len(*sgil.NextLink) != 0 +} + +// sharedGalleryImageListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sgil SharedGalleryImageList) sharedGalleryImageListPreparer(ctx context.Context) (*http.Request, error) { + if !sgil.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sgil.NextLink))) +} + +// SharedGalleryImageListPage contains a page of SharedGalleryImage values. +type SharedGalleryImageListPage struct { + fn func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error) + sgil SharedGalleryImageList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SharedGalleryImageListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sgil) + if err != nil { + return err + } + page.sgil = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SharedGalleryImageListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SharedGalleryImageListPage) NotDone() bool { + return !page.sgil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SharedGalleryImageListPage) Response() SharedGalleryImageList { + return page.sgil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SharedGalleryImageListPage) Values() []SharedGalleryImage { + if page.sgil.IsEmpty() { + return nil + } + return *page.sgil.Value +} + +// Creates a new instance of the SharedGalleryImageListPage type. +func NewSharedGalleryImageListPage(cur SharedGalleryImageList, getNextPage func(context.Context, SharedGalleryImageList) (SharedGalleryImageList, error)) SharedGalleryImageListPage { + return SharedGalleryImageListPage{ + fn: getNextPage, + sgil: cur, + } +} + +// SharedGalleryImageProperties describes the properties of a gallery image definition. +type SharedGalleryImageProperties struct { + // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'OperatingSystemStateTypesGeneralized', 'OperatingSystemStateTypesSpecialized' + OsState OperatingSystemStateTypes `json:"osState,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` + Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` + Disallowed *Disallowed `json:"disallowed,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` + // Features - A list of gallery image features. + Features *[]GalleryImageFeature `json:"features,omitempty"` + PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` +} + +// SharedGalleryImageVersion specifies information about the gallery image version that you want to create +// or update. +type SharedGalleryImageVersion struct { + autorest.Response `json:"-"` + *SharedGalleryImageVersionProperties `json:"properties,omitempty"` + *SharedGalleryIdentifier `json:"identifier,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for SharedGalleryImageVersion. +func (sgiv SharedGalleryImageVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sgiv.SharedGalleryImageVersionProperties != nil { + objectMap["properties"] = sgiv.SharedGalleryImageVersionProperties + } + if sgiv.SharedGalleryIdentifier != nil { + objectMap["identifier"] = sgiv.SharedGalleryIdentifier + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SharedGalleryImageVersion struct. +func (sgiv *SharedGalleryImageVersion) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sharedGalleryImageVersionProperties SharedGalleryImageVersionProperties + err = json.Unmarshal(*v, &sharedGalleryImageVersionProperties) + if err != nil { + return err + } + sgiv.SharedGalleryImageVersionProperties = &sharedGalleryImageVersionProperties + } + case "identifier": + if v != nil { + var sharedGalleryIdentifier SharedGalleryIdentifier + err = json.Unmarshal(*v, &sharedGalleryIdentifier) + if err != nil { + return err + } + sgiv.SharedGalleryIdentifier = &sharedGalleryIdentifier + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sgiv.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sgiv.Location = &location + } + } + } + + return nil +} + +// SharedGalleryImageVersionList the List Shared Gallery Image versions operation response. +type SharedGalleryImageVersionList struct { + autorest.Response `json:"-"` + // Value - A list of shared gallery images versions. + Value *[]SharedGalleryImageVersion `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of shared gallery image versions. Call ListNext() with this to fetch the next page of shared gallery image versions. + NextLink *string `json:"nextLink,omitempty"` +} + +// SharedGalleryImageVersionListIterator provides access to a complete listing of SharedGalleryImageVersion +// values. +type SharedGalleryImageVersionListIterator struct { + i int + page SharedGalleryImageVersionListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SharedGalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SharedGalleryImageVersionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SharedGalleryImageVersionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SharedGalleryImageVersionListIterator) Response() SharedGalleryImageVersionList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SharedGalleryImageVersionListIterator) Value() SharedGalleryImageVersion { + if !iter.page.NotDone() { + return SharedGalleryImageVersion{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SharedGalleryImageVersionListIterator type. +func NewSharedGalleryImageVersionListIterator(page SharedGalleryImageVersionListPage) SharedGalleryImageVersionListIterator { + return SharedGalleryImageVersionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sgivl SharedGalleryImageVersionList) IsEmpty() bool { + return sgivl.Value == nil || len(*sgivl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sgivl SharedGalleryImageVersionList) hasNextLink() bool { + return sgivl.NextLink != nil && len(*sgivl.NextLink) != 0 +} + +// sharedGalleryImageVersionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sgivl SharedGalleryImageVersionList) sharedGalleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { + if !sgivl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sgivl.NextLink))) +} + +// SharedGalleryImageVersionListPage contains a page of SharedGalleryImageVersion values. +type SharedGalleryImageVersionListPage struct { + fn func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error) + sgivl SharedGalleryImageVersionList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SharedGalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sgivl) + if err != nil { + return err + } + page.sgivl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SharedGalleryImageVersionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SharedGalleryImageVersionListPage) NotDone() bool { + return !page.sgivl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SharedGalleryImageVersionListPage) Response() SharedGalleryImageVersionList { + return page.sgivl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SharedGalleryImageVersionListPage) Values() []SharedGalleryImageVersion { + if page.sgivl.IsEmpty() { + return nil + } + return *page.sgivl.Value +} + +// Creates a new instance of the SharedGalleryImageVersionListPage type. +func NewSharedGalleryImageVersionListPage(cur SharedGalleryImageVersionList, getNextPage func(context.Context, SharedGalleryImageVersionList) (SharedGalleryImageVersionList, error)) SharedGalleryImageVersionListPage { + return SharedGalleryImageVersionListPage{ + fn: getNextPage, + sgivl: cur, + } +} + +// SharedGalleryImageVersionProperties describes the properties of a gallery image version. +type SharedGalleryImageVersionProperties struct { + // PublishedDate - The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. + PublishedDate *date.Time `json:"publishedDate,omitempty"` + // EndOfLifeDate - The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This property is updatable. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` +} + +// SharedGalleryList the List Shared Galleries operation response. +type SharedGalleryList struct { + autorest.Response `json:"-"` + // Value - A list of shared galleries. + Value *[]SharedGallery `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of shared galleries. Call ListNext() with this to fetch the next page of shared galleries. + NextLink *string `json:"nextLink,omitempty"` +} + +// SharedGalleryListIterator provides access to a complete listing of SharedGallery values. +type SharedGalleryListIterator struct { + i int + page SharedGalleryListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SharedGalleryListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SharedGalleryListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SharedGalleryListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SharedGalleryListIterator) Response() SharedGalleryList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SharedGalleryListIterator) Value() SharedGallery { + if !iter.page.NotDone() { + return SharedGallery{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SharedGalleryListIterator type. +func NewSharedGalleryListIterator(page SharedGalleryListPage) SharedGalleryListIterator { + return SharedGalleryListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sgl SharedGalleryList) IsEmpty() bool { + return sgl.Value == nil || len(*sgl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sgl SharedGalleryList) hasNextLink() bool { + return sgl.NextLink != nil && len(*sgl.NextLink) != 0 +} + +// sharedGalleryListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sgl SharedGalleryList) sharedGalleryListPreparer(ctx context.Context) (*http.Request, error) { + if !sgl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sgl.NextLink))) +} + +// SharedGalleryListPage contains a page of SharedGallery values. +type SharedGalleryListPage struct { + fn func(context.Context, SharedGalleryList) (SharedGalleryList, error) + sgl SharedGalleryList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SharedGalleryListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sgl) + if err != nil { + return err + } + page.sgl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SharedGalleryListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SharedGalleryListPage) NotDone() bool { + return !page.sgl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SharedGalleryListPage) Response() SharedGalleryList { + return page.sgl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SharedGalleryListPage) Values() []SharedGallery { + if page.sgl.IsEmpty() { + return nil + } + return *page.sgl.Value +} + +// Creates a new instance of the SharedGalleryListPage type. +func NewSharedGalleryListPage(cur SharedGalleryList, getNextPage func(context.Context, SharedGalleryList) (SharedGalleryList, error)) SharedGalleryListPage { + return SharedGalleryListPage{ + fn: getNextPage, + sgl: cur, + } +} + +// ShareInfoElement ... +type ShareInfoElement struct { + // VMURI - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. + VMURI *string `json:"vmUri,omitempty"` +} + +// MarshalJSON is the custom marshaler for ShareInfoElement. +func (sie ShareInfoElement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SharingProfile profile for gallery sharing to subscription or tenant +type SharingProfile struct { + // Permissions - This property allows you to specify the permission of sharing gallery.

Possible values are:

**Private**

**Groups**. Possible values include: 'GallerySharingPermissionTypesPrivate', 'GallerySharingPermissionTypesGroups' + Permissions GallerySharingPermissionTypes `json:"permissions,omitempty"` + // Groups - READ-ONLY; A list of sharing profile groups. + Groups *[]SharingProfileGroup `json:"groups,omitempty"` +} + +// MarshalJSON is the custom marshaler for SharingProfile. +func (sp SharingProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.Permissions != "" { + objectMap["permissions"] = sp.Permissions + } + return json.Marshal(objectMap) +} + +// SharingProfileGroup group of the gallery sharing profile +type SharingProfileGroup struct { + // Type - This property allows you to specify the type of sharing group.

Possible values are:

**Subscriptions**

**AADTenants**. Possible values include: 'SharingProfileGroupTypesSubscriptions', 'SharingProfileGroupTypesAADTenants' + Type SharingProfileGroupTypes `json:"type,omitempty"` + // Ids - A list of subscription/tenant ids the gallery is aimed to be shared to. + Ids *[]string `json:"ids,omitempty"` +} + +// SharingUpdate specifies information about the gallery sharing profile update. +type SharingUpdate struct { + autorest.Response `json:"-"` + // OperationType - This property allows you to specify the operation type of gallery sharing update.

Possible values are:

**Add**

**Remove**

**Reset**. Possible values include: 'SharingUpdateOperationTypesAdd', 'SharingUpdateOperationTypesRemove', 'SharingUpdateOperationTypesReset' + OperationType SharingUpdateOperationTypes `json:"operationType,omitempty"` + // Groups - A list of sharing profile groups. + Groups *[]SharingProfileGroup `json:"groups,omitempty"` +} + +// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware +// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU +// name. +type Sku struct { + // Name - The sku name. + Name *string `json:"name,omitempty"` + // Tier - Specifies the tier of virtual machines in a scale set.

Possible Values:

**Standard**

**Basic** + Tier *string `json:"tier,omitempty"` + // Capacity - Specifies the number of virtual machines in the scale set. + Capacity *int64 `json:"capacity,omitempty"` +} + +// Snapshot snapshot resource. +type Snapshot struct { + autorest.Response `json:"-"` + // ManagedBy - READ-ONLY; Unused. Always Null. + ManagedBy *string `json:"managedBy,omitempty"` + Sku *SnapshotSku `json:"sku,omitempty"` + // ExtendedLocation - The extended location where the snapshot will be created. Extended location cannot be changed. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + *SnapshotProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Sku != nil { + objectMap["sku"] = s.Sku + } + if s.ExtendedLocation != nil { + objectMap["extendedLocation"] = s.ExtendedLocation + } + if s.SnapshotProperties != nil { + objectMap["properties"] = s.SnapshotProperties + } + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Snapshot struct. +func (s *Snapshot) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "managedBy": + if v != nil { + var managedBy string + err = json.Unmarshal(*v, &managedBy) + if err != nil { + return err + } + s.ManagedBy = &managedBy + } + case "sku": + if v != nil { + var sku SnapshotSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + s.Sku = &sku + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + s.ExtendedLocation = &extendedLocation + } + case "properties": + if v != nil { + var snapshotProperties SnapshotProperties + err = json.Unmarshal(*v, &snapshotProperties) + if err != nil { + return err + } + s.SnapshotProperties = &snapshotProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + } + } + + return nil +} + +// SnapshotList the List Snapshots operation response. +type SnapshotList struct { + autorest.Response `json:"-"` + // Value - A list of snapshots. + Value *[]Snapshot `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. + NextLink *string `json:"nextLink,omitempty"` +} + +// SnapshotListIterator provides access to a complete listing of Snapshot values. +type SnapshotListIterator struct { + i int + page SnapshotListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SnapshotListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SnapshotListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SnapshotListIterator) Response() SnapshotList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SnapshotListIterator) Value() Snapshot { + if !iter.page.NotDone() { + return Snapshot{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SnapshotListIterator type. +func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { + return SnapshotListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sl SnapshotList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sl SnapshotList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 +} + +// snapshotListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { + if !sl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sl.NextLink))) +} + +// SnapshotListPage contains a page of Snapshot values. +type SnapshotListPage struct { + fn func(context.Context, SnapshotList) (SnapshotList, error) + sl SnapshotList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sl) + if err != nil { + return err + } + page.sl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SnapshotListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SnapshotListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SnapshotListPage) Response() SnapshotList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SnapshotListPage) Values() []Snapshot { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the SnapshotListPage type. +func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { + return SnapshotListPage{ + fn: getNextPage, + sl: cur, + } +} + +// SnapshotProperties snapshot resource properties. +type SnapshotProperties struct { + // TimeCreated - READ-ONLY; The time when the snapshot was created. + TimeCreated *date.Time `json:"timeCreated,omitempty"` + // OsType - The Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'HyperVGenerationV1', 'HyperVGenerationV2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` + // PurchasePlan - Purchase plan information for the image from which the source disk for the snapshot was originally created. + PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"` + // SupportedCapabilities - List of supported capabilities (like Accelerated Networking) for the image from which the source disk from the snapshot was originally created. + SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` + // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. + CreationData *CreationData `json:"creationData,omitempty"` + // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. + DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` + // DiskState - The state of the snapshot. Possible values include: 'DiskStateUnattached', 'DiskStateAttached', 'DiskStateReserved', 'DiskStateFrozen', 'DiskStateActiveSAS', 'DiskStateActiveSASFrozen', 'DiskStateReadyToUpload', 'DiskStateActiveUpload' + DiskState DiskState `json:"diskState,omitempty"` + // UniqueID - READ-ONLY; Unique Guid identifying the resource. + UniqueID *string `json:"uniqueId,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` + // ProvisioningState - READ-ONLY; The disk provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. + Incremental *bool `json:"incremental,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` + // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' + NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` + // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. + DiskAccessID *string `json:"diskAccessId,omitempty"` + // SecurityProfile - Contains the security related information for the resource. + SecurityProfile *DiskSecurityProfile `json:"securityProfile,omitempty"` + // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. + SupportsHibernation *bool `json:"supportsHibernation,omitempty"` + // PublicNetworkAccess - Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // CompletionPercent - Percentage complete for the background copy when a resource is created via the CopyStart operation. + CompletionPercent *float64 `json:"completionPercent,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotProperties. +func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.OsType != "" { + objectMap["osType"] = sp.OsType + } + if sp.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = sp.HyperVGeneration + } + if sp.PurchasePlan != nil { + objectMap["purchasePlan"] = sp.PurchasePlan + } + if sp.SupportedCapabilities != nil { + objectMap["supportedCapabilities"] = sp.SupportedCapabilities + } + if sp.CreationData != nil { + objectMap["creationData"] = sp.CreationData + } + if sp.DiskSizeGB != nil { + objectMap["diskSizeGB"] = sp.DiskSizeGB + } + if sp.DiskState != "" { + objectMap["diskState"] = sp.DiskState + } + if sp.EncryptionSettingsCollection != nil { + objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection + } + if sp.Incremental != nil { + objectMap["incremental"] = sp.Incremental + } + if sp.Encryption != nil { + objectMap["encryption"] = sp.Encryption + } + if sp.NetworkAccessPolicy != "" { + objectMap["networkAccessPolicy"] = sp.NetworkAccessPolicy + } + if sp.DiskAccessID != nil { + objectMap["diskAccessId"] = sp.DiskAccessID + } + if sp.SecurityProfile != nil { + objectMap["securityProfile"] = sp.SecurityProfile + } + if sp.SupportsHibernation != nil { + objectMap["supportsHibernation"] = sp.SupportsHibernation + } + if sp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = sp.PublicNetworkAccess + } + if sp.CompletionPercent != nil { + objectMap["completionPercent"] = sp.CompletionPercent + } + return json.Marshal(objectMap) +} + +// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (Snapshot, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. +func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsDeleteFuture.Result. +func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsGrantAccessFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (AccessURI, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsGrantAccessFuture.Result. +func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + au.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { + au, err = client.GrantAccessResponder(au.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") + } + } + return +} + +// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. This is an +// optional parameter for incremental snapshot and the default behavior is the SKU will be set to the same +// sku as the previous snapshot +type SnapshotSku struct { + // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' + Name SnapshotStorageAccountTypes `json:"name,omitempty"` + // Tier - READ-ONLY; The sku tier. + Tier *string `json:"tier,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotSku. +func (ss SnapshotSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.Name != "" { + objectMap["name"] = ss.Name + } + return json.Marshal(objectMap) +} + +// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsRevokeAccessFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsRevokeAccessFuture.Result. +func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") + return + } + ar.Response = future.Response() + return +} + +// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SnapshotsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SnapshotsClient) (Snapshot, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SnapshotsUpdateFuture.Result. +func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.UpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// SnapshotUpdate snapshot update resource. +type SnapshotUpdate struct { + *SnapshotUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` + Sku *SnapshotSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotUpdate. +func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if su.SnapshotUpdateProperties != nil { + objectMap["properties"] = su.SnapshotUpdateProperties + } + if su.Tags != nil { + objectMap["tags"] = su.Tags + } + if su.Sku != nil { + objectMap["sku"] = su.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. +func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var snapshotUpdateProperties SnapshotUpdateProperties + err = json.Unmarshal(*v, &snapshotUpdateProperties) + if err != nil { + return err + } + su.SnapshotUpdateProperties = &snapshotUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + su.Tags = tags + } + case "sku": + if v != nil { + var sku SnapshotSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + su.Sku = &sku + } + } + } + + return nil +} + +// SnapshotUpdateProperties snapshot resource update properties. +type SnapshotUpdateProperties struct { + // OsType - the Operating System type. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` + // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + Encryption *Encryption `json:"encryption,omitempty"` + // NetworkAccessPolicy - Possible values include: 'NetworkAccessPolicyAllowAll', 'NetworkAccessPolicyAllowPrivate', 'NetworkAccessPolicyDenyAll' + NetworkAccessPolicy NetworkAccessPolicy `json:"networkAccessPolicy,omitempty"` + // DiskAccessID - ARM id of the DiskAccess resource for using private endpoints on disks. + DiskAccessID *string `json:"diskAccessId,omitempty"` + // SupportsHibernation - Indicates the OS on a snapshot supports hibernation. + SupportsHibernation *bool `json:"supportsHibernation,omitempty"` + // PublicNetworkAccess - Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // SupportedCapabilities - List of supported capabilities (like accelerated networking) for the image from which the OS disk was created. + SupportedCapabilities *SupportedCapabilities `json:"supportedCapabilities,omitempty"` +} + +// SoftDeletePolicy contains information about the soft deletion policy of the gallery. +type SoftDeletePolicy struct { + // IsSoftDeleteEnabled - Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. + IsSoftDeleteEnabled *bool `json:"isSoftDeleteEnabled,omitempty"` +} + +// SourceVault the vault id is an Azure Resource Manager Resource id in the form +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} +type SourceVault struct { + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// SpotRestorePolicy specifies the Spot-Try-Restore properties for the virtual machine scale set.

+// With this property customer can enable or disable automatic restore of the evicted Spot VMSS VM +// instances opportunistically based on capacity availability and pricing constraint. +type SpotRestorePolicy struct { + // Enabled - Enables the Spot-Try-Restore feature where evicted VMSS SPOT instances will be tried to be restored opportunistically based on capacity availability and pricing constraints + Enabled *bool `json:"enabled,omitempty"` + // RestoreTimeout - Timeout value expressed as an ISO 8601 time duration after which the platform will not try to restore the VMSS SPOT instances + RestoreTimeout *string `json:"restoreTimeout,omitempty"` +} + +// SSHConfiguration SSH configuration for Linux based VMs running on Azure +type SSHConfiguration struct { + // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. + PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` +} + +// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where +// the public key is placed. +type SSHPublicKey struct { + // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys + Path *string `json:"path,omitempty"` + // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + KeyData *string `json:"keyData,omitempty"` +} + +// SSHPublicKeyGenerateKeyPairResult response from generation of an SSH key pair. +type SSHPublicKeyGenerateKeyPairResult struct { + autorest.Response `json:"-"` + // PrivateKey - Private key portion of the key pair used to authenticate to a virtual machine through ssh. The private key is returned in RFC3447 format and should be treated as a secret. + PrivateKey *string `json:"privateKey,omitempty"` + // PublicKey - Public key portion of the key pair used to authenticate to a virtual machine through ssh. The public key is in ssh-rsa format. + PublicKey *string `json:"publicKey,omitempty"` + // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{SshPublicKeyName} + ID *string `json:"id,omitempty"` +} + +// SSHPublicKeyResource specifies information about the SSH public key. +type SSHPublicKeyResource struct { + autorest.Response `json:"-"` + // SSHPublicKeyResourceProperties - Properties of the SSH public key. + *SSHPublicKeyResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SSHPublicKeyResource. +func (spkr SSHPublicKeyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spkr.SSHPublicKeyResourceProperties != nil { + objectMap["properties"] = spkr.SSHPublicKeyResourceProperties + } + if spkr.Location != nil { + objectMap["location"] = spkr.Location + } + if spkr.Tags != nil { + objectMap["tags"] = spkr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyResource struct. +func (spkr *SSHPublicKeyResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties + err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) + if err != nil { + return err + } + spkr.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + spkr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + spkr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + spkr.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + spkr.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spkr.Tags = tags + } + } + } + + return nil +} + +// SSHPublicKeyResourceProperties properties of the SSH public key. +type SSHPublicKeyResourceProperties struct { + // PublicKey - SSH public key used to authenticate to a virtual machine through ssh. If this property is not initially provided when the resource is created, the publicKey property will be populated when generateKeyPair is called. If the public key is provided upon resource creation, the provided public key needs to be at least 2048-bit and in ssh-rsa format. + PublicKey *string `json:"publicKey,omitempty"` +} + +// SSHPublicKeysGroupListResult the list SSH public keys operation response. +type SSHPublicKeysGroupListResult struct { + autorest.Response `json:"-"` + // Value - The list of SSH public keys + Value *[]SSHPublicKeyResource `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of SSH public keys. Call ListNext() with this URI to fetch the next page of SSH public keys. + NextLink *string `json:"nextLink,omitempty"` +} + +// SSHPublicKeysGroupListResultIterator provides access to a complete listing of SSHPublicKeyResource +// values. +type SSHPublicKeysGroupListResultIterator struct { + i int + page SSHPublicKeysGroupListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SSHPublicKeysGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SSHPublicKeysGroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SSHPublicKeysGroupListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SSHPublicKeysGroupListResultIterator) Response() SSHPublicKeysGroupListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SSHPublicKeysGroupListResultIterator) Value() SSHPublicKeyResource { + if !iter.page.NotDone() { + return SSHPublicKeyResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SSHPublicKeysGroupListResultIterator type. +func NewSSHPublicKeysGroupListResultIterator(page SSHPublicKeysGroupListResultPage) SSHPublicKeysGroupListResultIterator { + return SSHPublicKeysGroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (spkglr SSHPublicKeysGroupListResult) IsEmpty() bool { + return spkglr.Value == nil || len(*spkglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (spkglr SSHPublicKeysGroupListResult) hasNextLink() bool { + return spkglr.NextLink != nil && len(*spkglr.NextLink) != 0 +} + +// sSHPublicKeysGroupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (spkglr SSHPublicKeysGroupListResult) sSHPublicKeysGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !spkglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(spkglr.NextLink))) +} + +// SSHPublicKeysGroupListResultPage contains a page of SSHPublicKeyResource values. +type SSHPublicKeysGroupListResultPage struct { + fn func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error) + spkglr SSHPublicKeysGroupListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SSHPublicKeysGroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysGroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.spkglr) + if err != nil { + return err + } + page.spkglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SSHPublicKeysGroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SSHPublicKeysGroupListResultPage) NotDone() bool { + return !page.spkglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SSHPublicKeysGroupListResultPage) Response() SSHPublicKeysGroupListResult { + return page.spkglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SSHPublicKeysGroupListResultPage) Values() []SSHPublicKeyResource { + if page.spkglr.IsEmpty() { + return nil + } + return *page.spkglr.Value +} + +// Creates a new instance of the SSHPublicKeysGroupListResultPage type. +func NewSSHPublicKeysGroupListResultPage(cur SSHPublicKeysGroupListResult, getNextPage func(context.Context, SSHPublicKeysGroupListResult) (SSHPublicKeysGroupListResult, error)) SSHPublicKeysGroupListResultPage { + return SSHPublicKeysGroupListResultPage{ + fn: getNextPage, + spkglr: cur, + } +} + +// SSHPublicKeyUpdateResource specifies information about the SSH public key. +type SSHPublicKeyUpdateResource struct { + // SSHPublicKeyResourceProperties - Properties of the SSH public key. + *SSHPublicKeyResourceProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SSHPublicKeyUpdateResource. +func (spkur SSHPublicKeyUpdateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spkur.SSHPublicKeyResourceProperties != nil { + objectMap["properties"] = spkur.SSHPublicKeyResourceProperties + } + if spkur.Tags != nil { + objectMap["tags"] = spkur.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SSHPublicKeyUpdateResource struct. +func (spkur *SSHPublicKeyUpdateResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var SSHPublicKeyResourceProperties SSHPublicKeyResourceProperties + err = json.Unmarshal(*v, &SSHPublicKeyResourceProperties) + if err != nil { + return err + } + spkur.SSHPublicKeyResourceProperties = &SSHPublicKeyResourceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + spkur.Tags = tags + } + } + } + + return nil +} + +// StatusCodeCount ... +type StatusCodeCount struct { + // Code - READ-ONLY; The instance view status code + Code *string `json:"code,omitempty"` + // Count - READ-ONLY; Number of instances having this status code + Count *int32 `json:"count,omitempty"` +} + +// MarshalJSON is the custom marshaler for StatusCodeCount. +func (scc StatusCodeCount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StorageProfile specifies the storage settings for the virtual machine disks. +type StorageProfile struct { + // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + ImageReference *ImageReference `json:"imageReference,omitempty"` + // OsDisk - Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + OsDisk *OSDisk `json:"osDisk,omitempty"` + // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.

For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + DataDisks *[]DataDisk `json:"dataDisks,omitempty"` +} + +// SubResource ... +type SubResource struct { + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// SubResourceReadOnly ... +type SubResourceReadOnly struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for SubResourceReadOnly. +func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SubResourceWithColocationStatus ... +type SubResourceWithColocationStatus struct { + // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. + ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// SupportedCapabilities list of supported capabilities (like accelerated networking) persisted on the disk +// resource for VM use. +type SupportedCapabilities struct { + // AcceleratedNetwork - True if the image from which the OS disk is created supports accelerated networking. + AcceleratedNetwork *bool `json:"acceleratedNetwork,omitempty"` +} + +// TargetRegion describes the target region information. +type TargetRegion struct { + // Name - The name of the region. + Name *string `json:"name,omitempty"` + // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. + RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` + // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS', 'StorageAccountTypePremiumLRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + Encryption *EncryptionImages `json:"encryption,omitempty"` +} + +// TerminateNotificationProfile ... +type TerminateNotificationProfile struct { + // NotBeforeTimeout - Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) + NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` + // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. + Enable *bool `json:"enable,omitempty"` +} + +// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. +type ThrottledRequestsInput struct { + // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. + BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` + // FromTime - From time of the query + FromTime *date.Time `json:"fromTime,omitempty"` + // ToTime - To time of the query + ToTime *date.Time `json:"toTime,omitempty"` + // GroupByThrottlePolicy - Group query result by Throttle Policy applied. + GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` + // GroupByOperationName - Group query result by Operation Name. + GroupByOperationName *bool `json:"groupByOperationName,omitempty"` + // GroupByResourceName - Group query result by Resource Name. + GroupByResourceName *bool `json:"groupByResourceName,omitempty"` + // GroupByClientApplicationID - Group query result by Client Application ID. + GroupByClientApplicationID *bool `json:"groupByClientApplicationId,omitempty"` + // GroupByUserAgent - Group query result by User Agent. + GroupByUserAgent *bool `json:"groupByUserAgent,omitempty"` +} + +// UefiSettings specifies the security settings like secure boot and vTPM used while creating the virtual +// machine.

Minimum api-version: 2020-12-01 +type UefiSettings struct { + // SecureBootEnabled - Specifies whether secure boot should be enabled on the virtual machine.

Minimum api-version: 2020-12-01 + SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` + // VTpmEnabled - Specifies whether vTPM should be enabled on the virtual machine.

Minimum api-version: 2020-12-01 + VTpmEnabled *bool `json:"vTpmEnabled,omitempty"` +} + +// UpdateDomain defines an update domain for the cloud service. +type UpdateDomain struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name + Name *string `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateDomain. +func (ud UpdateDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UpdateDomainListResult ... +type UpdateDomainListResult struct { + autorest.Response `json:"-"` + Value *[]UpdateDomain `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// UpdateDomainListResultIterator provides access to a complete listing of UpdateDomain values. +type UpdateDomainListResultIterator struct { + i int + page UpdateDomainListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *UpdateDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *UpdateDomainListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UpdateDomainListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter UpdateDomainListResultIterator) Response() UpdateDomainListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter UpdateDomainListResultIterator) Value() UpdateDomain { + if !iter.page.NotDone() { + return UpdateDomain{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UpdateDomainListResultIterator type. +func NewUpdateDomainListResultIterator(page UpdateDomainListResultPage) UpdateDomainListResultIterator { + return UpdateDomainListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (udlr UpdateDomainListResult) IsEmpty() bool { + return udlr.Value == nil || len(*udlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (udlr UpdateDomainListResult) hasNextLink() bool { + return udlr.NextLink != nil && len(*udlr.NextLink) != 0 +} + +// updateDomainListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (udlr UpdateDomainListResult) updateDomainListResultPreparer(ctx context.Context) (*http.Request, error) { + if !udlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(udlr.NextLink))) +} + +// UpdateDomainListResultPage contains a page of UpdateDomain values. +type UpdateDomainListResultPage struct { + fn func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error) + udlr UpdateDomainListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *UpdateDomainListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UpdateDomainListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.udlr) + if err != nil { + return err + } + page.udlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *UpdateDomainListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UpdateDomainListResultPage) NotDone() bool { + return !page.udlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UpdateDomainListResultPage) Response() UpdateDomainListResult { + return page.udlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UpdateDomainListResultPage) Values() []UpdateDomain { + if page.udlr.IsEmpty() { + return nil + } + return *page.udlr.Value +} + +// Creates a new instance of the UpdateDomainListResultPage type. +func NewUpdateDomainListResultPage(cur UpdateDomainListResult, getNextPage func(context.Context, UpdateDomainListResult) (UpdateDomainListResult, error)) UpdateDomainListResultPage { + return UpdateDomainListResultPage{ + fn: getNextPage, + udlr: cur, + } +} + +// UpdateResource the Update Resource model definition. +type UpdateResource struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UpdateResource. +func (ur UpdateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ur.Tags != nil { + objectMap["tags"] = ur.Tags + } + return json.Marshal(objectMap) +} + +// UpdateResourceDefinition the Update Resource model definition. +type UpdateResourceDefinition struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UpdateResourceDefinition. +func (urd UpdateResourceDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if urd.Tags != nil { + objectMap["tags"] = urd.Tags + } + return json.Marshal(objectMap) +} + +// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. +type UpgradeOperationHistoricalStatusInfo struct { + // Properties - READ-ONLY; Information about the properties of the upgrade operation. + Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Resource location + Location *string `json:"location,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. +func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale +// Set. +type UpgradeOperationHistoricalStatusInfoProperties struct { + // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. + RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` + // Progress - READ-ONLY; Counts of the VMs in each state. + Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` + // Error - READ-ONLY; Error Details for this upgrade if there are any. + Error *APIError `json:"error,omitempty"` + // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' + StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` + // TargetImageReference - READ-ONLY; Image Reference details + TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` + // RollbackInfo - READ-ONLY; Information about OS rollback if performed + RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. +func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. +type UpgradeOperationHistoryStatus struct { + // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' + Code UpgradeState `json:"code,omitempty"` + // StartTime - READ-ONLY; Start time of the upgrade. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time of the upgrade. + EndTime *date.Time `json:"endTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. +func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. +type UpgradePolicy struct { + // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.

Possible values are:

**Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

**Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'UpgradeModeAutomatic', 'UpgradeModeManual', 'UpgradeModeRolling' + Mode UpgradeMode `json:"mode,omitempty"` + // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. + RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` + // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. + AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` +} + +// Usage describes Compute Resource Usage. +type Usage struct { + // Unit - An enum describing the unit of usage measurement. + Unit *string `json:"unit,omitempty"` + // CurrentValue - The current usage of the resource. + CurrentValue *int32 `json:"currentValue,omitempty"` + // Limit - The maximum permitted usage of the resource. + Limit *int64 `json:"limit,omitempty"` + // Name - The name of the type of usage. + Name *UsageName `json:"name,omitempty"` +} + +// UsageName the Usage Names. +type UsageName struct { + // Value - The name of the resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// UserArtifactManage ... +type UserArtifactManage struct { + // Install - Required. The path and arguments to install the gallery application. This is limited to 4096 characters. + Install *string `json:"install,omitempty"` + // Remove - Required. The path and arguments to remove the gallery application. This is limited to 4096 characters. + Remove *string `json:"remove,omitempty"` + // Update - Optional. The path and arguments to update the gallery application. If not present, then update operation will invoke remove command on the previous version and install command on the current version of the gallery application. This is limited to 4096 characters. + Update *string `json:"update,omitempty"` +} + +// UserArtifactSource the source image from which the Image Version is going to be created. +type UserArtifactSource struct { + // MediaLink - Required. The mediaLink of the artifact, must be a readable storage page blob. + MediaLink *string `json:"mediaLink,omitempty"` + // DefaultConfigurationLink - Optional. The defaultConfigurationLink of the artifact, must be a readable storage page blob. + DefaultConfigurationLink *string `json:"defaultConfigurationLink,omitempty"` +} + +// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate +// should reside on the VM. +type VaultCertificate struct { + // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

{
"data":"",
"dataType":"pfx",
"password":""
}
To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + CertificateURL *string `json:"certificateUrl,omitempty"` + // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.

For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. + CertificateStore *string `json:"certificateStore,omitempty"` +} + +// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. +type VaultSecretGroup struct { + // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. + SourceVault *SubResource `json:"sourceVault,omitempty"` + // VaultCertificates - The list of key vault references in SourceVault which contain certificates. + VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` +} + +// VirtualHardDisk describes the uri of a disk. +type VirtualHardDisk struct { + // URI - Specifies the virtual hard disk's uri. + URI *string `json:"uri,omitempty"` +} + +// VirtualMachine describes a Virtual Machine. +type VirtualMachine struct { + autorest.Response `json:"-"` + // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + Plan *Plan `json:"plan,omitempty"` + *VirtualMachineProperties `json:"properties,omitempty"` + // Resources - READ-ONLY; The virtual machine child extension resources. + Resources *[]VirtualMachineExtension `json:"resources,omitempty"` + // Identity - The identity of the virtual machine, if configured. + Identity *VirtualMachineIdentity `json:"identity,omitempty"` + // Zones - The virtual machine zones. + Zones *[]string `json:"zones,omitempty"` + // ExtendedLocation - The extended location of the Virtual Machine. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachine. +func (VM VirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if VM.Plan != nil { + objectMap["plan"] = VM.Plan + } + if VM.VirtualMachineProperties != nil { + objectMap["properties"] = VM.VirtualMachineProperties + } + if VM.Identity != nil { + objectMap["identity"] = VM.Identity + } + if VM.Zones != nil { + objectMap["zones"] = VM.Zones + } + if VM.ExtendedLocation != nil { + objectMap["extendedLocation"] = VM.ExtendedLocation + } + if VM.Location != nil { + objectMap["location"] = VM.Location + } + if VM.Tags != nil { + objectMap["tags"] = VM.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. +func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + VM.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineProperties VirtualMachineProperties + err = json.Unmarshal(*v, &virtualMachineProperties) + if err != nil { + return err + } + VM.VirtualMachineProperties = &virtualMachineProperties + } + case "resources": + if v != nil { + var resources []VirtualMachineExtension + err = json.Unmarshal(*v, &resources) + if err != nil { + return err + } + VM.Resources = &resources + } + case "identity": + if v != nil { + var identity VirtualMachineIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + VM.Identity = &identity + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + VM.Zones = &zones + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + VM.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + VM.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + VM.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + VM.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + VM.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + VM.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. +type VirtualMachineAgentInstanceView struct { + // VMAgentVersion - The VM Agent full version. + VMAgentVersion *string `json:"vmAgentVersion,omitempty"` + // ExtensionHandlers - The virtual machine extension handler instance view. + ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// VirtualMachineAssessPatchesResult describes the properties of an AssessPatches result. +type VirtualMachineAssessPatchesResult struct { + autorest.Response `json:"-"` + // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' + Status PatchOperationStatus `json:"status,omitempty"` + // AssessmentActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. + AssessmentActivityID *string `json:"assessmentActivityId,omitempty"` + // RebootPending - READ-ONLY; The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. + RebootPending *bool `json:"rebootPending,omitempty"` + // CriticalAndSecurityPatchCount - READ-ONLY; The number of critical or security patches that have been detected as available and not yet installed. + CriticalAndSecurityPatchCount *int32 `json:"criticalAndSecurityPatchCount,omitempty"` + // OtherPatchCount - READ-ONLY; The number of all available patches excluding critical and security. + OtherPatchCount *int32 `json:"otherPatchCount,omitempty"` + // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. + StartDateTime *date.Time `json:"startDateTime,omitempty"` + // AvailablePatches - READ-ONLY; The list of patches that have been detected as available for installation. + AvailablePatches *[]VirtualMachineSoftwarePatchProperties `json:"availablePatches,omitempty"` + // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. + Error *APIError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineAssessPatchesResult. +func (vmapr VirtualMachineAssessPatchesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineCaptureParameters capture Virtual Machine parameters. +type VirtualMachineCaptureParameters struct { + // VhdPrefix - The captured virtual hard disk's name prefix. + VhdPrefix *string `json:"vhdPrefix,omitempty"` + // DestinationContainerName - The destination container name. + DestinationContainerName *string `json:"destinationContainerName,omitempty"` + // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. + OverwriteVhds *bool `json:"overwriteVhds,omitempty"` +} + +// VirtualMachineCaptureResult output of virtual machine capture operation. +type VirtualMachineCaptureResult struct { + autorest.Response `json:"-"` + // Schema - READ-ONLY; the schema of the captured virtual machine + Schema *string `json:"$schema,omitempty"` + // ContentVersion - READ-ONLY; the version of the content + ContentVersion *string `json:"contentVersion,omitempty"` + // Parameters - READ-ONLY; parameters of the captured virtual machine + Parameters interface{} `json:"parameters,omitempty"` + // Resources - READ-ONLY; a list of resource items of the captured virtual machine + Resources *[]interface{} `json:"resources,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. +func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmcr.ID != nil { + objectMap["id"] = vmcr.ID + } + return json.Marshal(objectMap) +} + +// VirtualMachineExtension describes a Virtual Machine Extension. +type VirtualMachineExtension struct { + autorest.Response `json:"-"` + *VirtualMachineExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineExtension. +func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vme.VirtualMachineExtensionProperties != nil { + objectMap["properties"] = vme.VirtualMachineExtensionProperties + } + if vme.Location != nil { + objectMap["location"] = vme.Location + } + if vme.Tags != nil { + objectMap["tags"] = vme.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. +func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualMachineExtensionProperties VirtualMachineExtensionProperties + err = json.Unmarshal(*v, &virtualMachineExtensionProperties) + if err != nil { + return err + } + vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vme.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vme.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vme.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vme.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vme.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. +type VirtualMachineExtensionHandlerInstanceView struct { + // Type - Specifies the type of the extension; an example is "CustomScriptExtension". + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the script handler. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // Status - The extension handler status. + Status *InstanceViewStatus `json:"status,omitempty"` +} + +// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. +type VirtualMachineExtensionImage struct { + autorest.Response `json:"-"` + *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. +func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmei.VirtualMachineExtensionImageProperties != nil { + objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties + } + if vmei.Location != nil { + objectMap["location"] = vmei.Location + } + if vmei.Tags != nil { + objectMap["tags"] = vmei.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. +func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties + err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) + if err != nil { + return err + } + vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmei.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmei.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmei.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmei.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmei.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. +type VirtualMachineExtensionImageProperties struct { + // OperatingSystem - The operating system this extension supports. + OperatingSystem *string `json:"operatingSystem,omitempty"` + // ComputeRole - The type of role (IaaS or PaaS) this extension supports. + ComputeRole *string `json:"computeRole,omitempty"` + // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. + HandlerSchema *string `json:"handlerSchema,omitempty"` + // VMScaleSetEnabled - Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. + VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` + // SupportsMultipleExtensions - Whether the handler can support multiple extensions. + SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` +} + +// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. +type VirtualMachineExtensionInstanceView struct { + // Name - The virtual machine extension name. + Name *string `json:"name,omitempty"` + // Type - Specifies the type of the extension; an example is "CustomScriptExtension". + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the script handler. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // Substatuses - The resource status information. + Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. +type VirtualMachineExtensionProperties struct { + // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + // Publisher - The name of the extension handler publisher. + Publisher *string `json:"publisher,omitempty"` + // Type - Specifies the type of the extension; an example is "CustomScriptExtension". + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the script handler. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + // Settings - Json formatted public settings for the extension. + Settings interface{} `json:"settings,omitempty"` + // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // InstanceView - The virtual machine extension instance view. + InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` + // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. + SuppressFailures *bool `json:"suppressFailures,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. +func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmep.ForceUpdateTag + } + if vmep.Publisher != nil { + objectMap["publisher"] = vmep.Publisher + } + if vmep.Type != nil { + objectMap["type"] = vmep.Type + } + if vmep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion + } + if vmep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion + } + if vmep.EnableAutomaticUpgrade != nil { + objectMap["enableAutomaticUpgrade"] = vmep.EnableAutomaticUpgrade + } + if vmep.Settings != nil { + objectMap["settings"] = vmep.Settings + } + if vmep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmep.ProtectedSettings + } + if vmep.InstanceView != nil { + objectMap["instanceView"] = vmep.InstanceView + } + if vmep.SuppressFailures != nil { + objectMap["suppressFailures"] = vmep.SuppressFailures + } + return json.Marshal(objectMap) +} + +// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type VirtualMachineExtensionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. +func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vme.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { + vme, err = client.CreateOrUpdateResponder(vme.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineExtensionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. +func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineExtensionsListResult the List Extension operation response +type VirtualMachineExtensionsListResult struct { + autorest.Response `json:"-"` + // Value - The list of extensions + Value *[]VirtualMachineExtension `json:"value,omitempty"` +} + +// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineExtensionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. +func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vme.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { + vme, err = client.UpdateResponder(vme.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. +type VirtualMachineExtensionUpdate struct { + *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. +func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmeu.VirtualMachineExtensionUpdateProperties != nil { + objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties + } + if vmeu.Tags != nil { + objectMap["tags"] = vmeu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. +func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties + err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) + if err != nil { + return err + } + vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmeu.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. +type VirtualMachineExtensionUpdateProperties struct { + // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + // Publisher - The name of the extension handler publisher. + Publisher *string `json:"publisher,omitempty"` + // Type - Specifies the type of the extension; an example is "CustomScriptExtension". + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the script handler. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + // Settings - Json formatted public settings for the extension. + Settings interface{} `json:"settings,omitempty"` + // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` + // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. + SuppressFailures *bool `json:"suppressFailures,omitempty"` +} + +// VirtualMachineHealthStatus the health status of the VM. +type VirtualMachineHealthStatus struct { + // Status - READ-ONLY; The health status information for the VM. + Status *InstanceViewStatus `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. +func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineIdentity identity for the virtual machine. +type VirtualMachineIdentity struct { + // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineIdentity. +func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmi.Type != "" { + objectMap["type"] = vmi.Type + } + if vmi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// VirtualMachineIdentityUserAssignedIdentitiesValue ... +type VirtualMachineIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. +func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineImage describes a Virtual Machine Image. +type VirtualMachineImage struct { + autorest.Response `json:"-"` + *VirtualMachineImageProperties `json:"properties,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Location - The supported Azure location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + Tags map[string]*string `json:"tags"` + // ExtendedLocation - The extended location of the Virtual Machine. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineImage. +func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmi.VirtualMachineImageProperties != nil { + objectMap["properties"] = vmi.VirtualMachineImageProperties + } + if vmi.Name != nil { + objectMap["name"] = vmi.Name + } + if vmi.Location != nil { + objectMap["location"] = vmi.Location + } + if vmi.Tags != nil { + objectMap["tags"] = vmi.Tags + } + if vmi.ExtendedLocation != nil { + objectMap["extendedLocation"] = vmi.ExtendedLocation + } + if vmi.ID != nil { + objectMap["id"] = vmi.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. +func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualMachineImageProperties VirtualMachineImageProperties + err = json.Unmarshal(*v, &virtualMachineImageProperties) + if err != nil { + return err + } + vmi.VirtualMachineImageProperties = &virtualMachineImageProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmi.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmi.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmi.Tags = tags + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + vmi.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmi.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineImageFeature specifies additional capabilities supported by the image +type VirtualMachineImageFeature struct { + // Name - The name of the feature. + Name *string `json:"name,omitempty"` + // Value - The corresponding value for the feature. + Value *string `json:"value,omitempty"` +} + +// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. +type VirtualMachineImageProperties struct { + Plan *PurchasePlan `json:"plan,omitempty"` + OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` + DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` + AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` + // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' + HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` + // Disallowed - Specifies disallowed configuration for the VirtualMachine created from the image + Disallowed *DisallowedConfiguration `json:"disallowed,omitempty"` + Features *[]VirtualMachineImageFeature `json:"features,omitempty"` +} + +// VirtualMachineImageResource virtual machine image resource information. +type VirtualMachineImageResource struct { + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // Location - The supported Azure location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). + Tags map[string]*string `json:"tags"` + // ExtendedLocation - The extended location of the Virtual Machine. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineImageResource. +func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmir.Name != nil { + objectMap["name"] = vmir.Name + } + if vmir.Location != nil { + objectMap["location"] = vmir.Location + } + if vmir.Tags != nil { + objectMap["tags"] = vmir.Tags + } + if vmir.ExtendedLocation != nil { + objectMap["extendedLocation"] = vmir.ExtendedLocation + } + if vmir.ID != nil { + objectMap["id"] = vmir.ID + } + return json.Marshal(objectMap) +} + +// VirtualMachineInstallPatchesParameters input for InstallPatches as directly received by the API +type VirtualMachineInstallPatchesParameters struct { + // MaximumDuration - Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours) + MaximumDuration *string `json:"maximumDuration,omitempty"` + // RebootSetting - Defines when it is acceptable to reboot a VM during a software update operation. Possible values include: 'VMGuestPatchRebootSettingIfRequired', 'VMGuestPatchRebootSettingNever', 'VMGuestPatchRebootSettingAlways' + RebootSetting VMGuestPatchRebootSetting `json:"rebootSetting,omitempty"` + // WindowsParameters - Input for InstallPatches on a Windows VM, as directly received by the API + WindowsParameters *WindowsParameters `json:"windowsParameters,omitempty"` + // LinuxParameters - Input for InstallPatches on a Linux VM, as directly received by the API + LinuxParameters *LinuxParameters `json:"linuxParameters,omitempty"` +} + +// VirtualMachineInstallPatchesResult the result summary of an installation operation. +type VirtualMachineInstallPatchesResult struct { + autorest.Response `json:"-"` + // Status - READ-ONLY; The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings.". Possible values include: 'PatchOperationStatusUnknown', 'PatchOperationStatusInProgress', 'PatchOperationStatusFailed', 'PatchOperationStatusSucceeded', 'PatchOperationStatusCompletedWithWarnings' + Status PatchOperationStatus `json:"status,omitempty"` + // InstallationActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. + InstallationActivityID *string `json:"installationActivityId,omitempty"` + // RebootStatus - READ-ONLY; The reboot state of the VM following completion of the operation. Possible values include: 'VMGuestPatchRebootStatusUnknown', 'VMGuestPatchRebootStatusNotNeeded', 'VMGuestPatchRebootStatusRequired', 'VMGuestPatchRebootStatusStarted', 'VMGuestPatchRebootStatusFailed', 'VMGuestPatchRebootStatusCompleted' + RebootStatus VMGuestPatchRebootStatus `json:"rebootStatus,omitempty"` + // MaintenanceWindowExceeded - READ-ONLY; Whether the operation ran out of time before it completed all its intended actions. + MaintenanceWindowExceeded *bool `json:"maintenanceWindowExceeded,omitempty"` + // ExcludedPatchCount - READ-ONLY; The number of patches that were not installed due to the user blocking their installation. + ExcludedPatchCount *int32 `json:"excludedPatchCount,omitempty"` + // NotSelectedPatchCount - READ-ONLY; The number of patches that were detected as available for install, but did not meet the operation's criteria. + NotSelectedPatchCount *int32 `json:"notSelectedPatchCount,omitempty"` + // PendingPatchCount - READ-ONLY; The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + PendingPatchCount *int32 `json:"pendingPatchCount,omitempty"` + // InstalledPatchCount - READ-ONLY; The number of patches successfully installed. + InstalledPatchCount *int32 `json:"installedPatchCount,omitempty"` + // FailedPatchCount - READ-ONLY; The number of patches that could not be installed due to some issue. See errors for details. + FailedPatchCount *int32 `json:"failedPatchCount,omitempty"` + // Patches - READ-ONLY; The patches that were installed during the operation. + Patches *[]PatchInstallationDetail `json:"patches,omitempty"` + // StartDateTime - READ-ONLY; The UTC timestamp when the operation began. + StartDateTime *date.Time `json:"startDateTime,omitempty"` + // Error - READ-ONLY; The errors that were encountered during execution of the operation. The details array contains the list of them. + Error *APIError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineInstallPatchesResult. +func (vmipr VirtualMachineInstallPatchesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineInstanceView the instance view of a virtual machine. +type VirtualMachineInstanceView struct { + autorest.Response `json:"-"` + // PlatformUpdateDomain - Specifies the update domain of the virtual machine. + PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` + // PlatformFaultDomain - Specifies the fault domain of the virtual machine. + PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` + // ComputerName - The computer name assigned to the virtual machine. + ComputerName *string `json:"computerName,omitempty"` + // OsName - The Operating System running on the virtual machine. + OsName *string `json:"osName,omitempty"` + // OsVersion - The version of Operating System running on the virtual machine. + OsVersion *string `json:"osVersion,omitempty"` + // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' + HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` + // RdpThumbPrint - The Remote desktop certificate thumbprint. + RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` + // VMAgent - The VM Agent running on the virtual machine. + VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` + // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. + MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` + // Disks - The virtual machine disk information. + Disks *[]DiskInstanceView `json:"disks,omitempty"` + // Extensions - The extensions information. + Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` + // VMHealth - READ-ONLY; The health status for the VM. + VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` + // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor. + BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` + // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled.

Minimum api-version: 2020-06-01. + AssignedHost *string `json:"assignedHost,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + // PatchStatus - [Preview Feature] The status of virtual machine patch operations. + PatchStatus *VirtualMachinePatchStatus `json:"patchStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineInstanceView. +func (vmiv VirtualMachineInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmiv.PlatformUpdateDomain != nil { + objectMap["platformUpdateDomain"] = vmiv.PlatformUpdateDomain + } + if vmiv.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = vmiv.PlatformFaultDomain + } + if vmiv.ComputerName != nil { + objectMap["computerName"] = vmiv.ComputerName + } + if vmiv.OsName != nil { + objectMap["osName"] = vmiv.OsName + } + if vmiv.OsVersion != nil { + objectMap["osVersion"] = vmiv.OsVersion + } + if vmiv.HyperVGeneration != "" { + objectMap["hyperVGeneration"] = vmiv.HyperVGeneration + } + if vmiv.RdpThumbPrint != nil { + objectMap["rdpThumbPrint"] = vmiv.RdpThumbPrint + } + if vmiv.VMAgent != nil { + objectMap["vmAgent"] = vmiv.VMAgent + } + if vmiv.MaintenanceRedeployStatus != nil { + objectMap["maintenanceRedeployStatus"] = vmiv.MaintenanceRedeployStatus + } + if vmiv.Disks != nil { + objectMap["disks"] = vmiv.Disks + } + if vmiv.Extensions != nil { + objectMap["extensions"] = vmiv.Extensions + } + if vmiv.BootDiagnostics != nil { + objectMap["bootDiagnostics"] = vmiv.BootDiagnostics + } + if vmiv.Statuses != nil { + objectMap["statuses"] = vmiv.Statuses + } + if vmiv.PatchStatus != nil { + objectMap["patchStatus"] = vmiv.PatchStatus + } + return json.Marshal(objectMap) +} + +// VirtualMachineIPTag contains the IP tag associated with the public IP address. +type VirtualMachineIPTag struct { + // IPTagType - IP tag type. Example: FirstPartyUsage. + IPTagType *string `json:"ipTagType,omitempty"` + // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. + Tag *string `json:"tag,omitempty"` +} + +// VirtualMachineListResult the List Virtual Machine operation response. +type VirtualMachineListResult struct { + autorest.Response `json:"-"` + // Value - The list of virtual machines. + Value *[]VirtualMachine `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. +type VirtualMachineListResultIterator struct { + i int + page VirtualMachineListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineListResultIterator) Value() VirtualMachine { + if !iter.page.NotDone() { + return VirtualMachine{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineListResultIterator type. +func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { + return VirtualMachineListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmlr VirtualMachineListResult) IsEmpty() bool { + return vmlr.Value == nil || len(*vmlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmlr VirtualMachineListResult) hasNextLink() bool { + return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 +} + +// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmlr.NextLink))) +} + +// VirtualMachineListResultPage contains a page of VirtualMachine values. +type VirtualMachineListResultPage struct { + fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) + vmlr VirtualMachineListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmlr) + if err != nil { + return err + } + page.vmlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineListResultPage) NotDone() bool { + return !page.vmlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { + return page.vmlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineListResultPage) Values() []VirtualMachine { + if page.vmlr.IsEmpty() { + return nil + } + return *page.vmlr.Value +} + +// Creates a new instance of the VirtualMachineListResultPage type. +func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { + return VirtualMachineListResultPage{ + fn: getNextPage, + vmlr: cur, + } +} + +// VirtualMachineNetworkInterfaceConfiguration describes a virtual machine network interface +// configurations. +type VirtualMachineNetworkInterfaceConfiguration struct { + // Name - The network interface configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineNetworkInterfaceConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceConfiguration. +func (vmnic VirtualMachineNetworkInterfaceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmnic.Name != nil { + objectMap["name"] = vmnic.Name + } + if vmnic.VirtualMachineNetworkInterfaceConfigurationProperties != nil { + objectMap["properties"] = vmnic.VirtualMachineNetworkInterfaceConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceConfiguration struct. +func (vmnic *VirtualMachineNetworkInterfaceConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmnic.Name = &name + } + case "properties": + if v != nil { + var virtualMachineNetworkInterfaceConfigurationProperties VirtualMachineNetworkInterfaceConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceConfigurationProperties) + if err != nil { + return err + } + vmnic.VirtualMachineNetworkInterfaceConfigurationProperties = &virtualMachineNetworkInterfaceConfigurationProperties + } + } + } + + return nil +} + +// VirtualMachineNetworkInterfaceConfigurationProperties describes a virtual machine network profile's IP +// configuration. +type VirtualMachineNetworkInterfaceConfigurationProperties struct { + // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. + Primary *bool `json:"primary,omitempty"` + // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + DeleteOption DeleteOptions `json:"deleteOption,omitempty"` + // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. + EnableFpga *bool `json:"enableFpga,omitempty"` + // EnableIPForwarding - Whether IP forwarding enabled on this NIC. + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + // NetworkSecurityGroup - The network security group. + NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` + // DNSSettings - The dns settings to be applied on the network interfaces. + DNSSettings *VirtualMachineNetworkInterfaceDNSSettingsConfiguration `json:"dnsSettings,omitempty"` + // IPConfigurations - Specifies the IP configurations of the network interface. + IPConfigurations *[]VirtualMachineNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` +} + +// VirtualMachineNetworkInterfaceDNSSettingsConfiguration describes a virtual machines network +// configuration's DNS settings. +type VirtualMachineNetworkInterfaceDNSSettingsConfiguration struct { + // DNSServers - List of DNS servers IP addresses + DNSServers *[]string `json:"dnsServers,omitempty"` +} + +// VirtualMachineNetworkInterfaceIPConfiguration describes a virtual machine network profile's IP +// configuration. +type VirtualMachineNetworkInterfaceIPConfiguration struct { + // Name - The IP configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineNetworkInterfaceIPConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineNetworkInterfaceIPConfiguration. +func (vmniic VirtualMachineNetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmniic.Name != nil { + objectMap["name"] = vmniic.Name + } + if vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties != nil { + objectMap["properties"] = vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineNetworkInterfaceIPConfiguration struct. +func (vmniic *VirtualMachineNetworkInterfaceIPConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmniic.Name = &name + } + case "properties": + if v != nil { + var virtualMachineNetworkInterfaceIPConfigurationProperties VirtualMachineNetworkInterfaceIPConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineNetworkInterfaceIPConfigurationProperties) + if err != nil { + return err + } + vmniic.VirtualMachineNetworkInterfaceIPConfigurationProperties = &virtualMachineNetworkInterfaceIPConfigurationProperties + } + } + } + + return nil +} + +// VirtualMachineNetworkInterfaceIPConfigurationProperties describes a virtual machine network interface IP +// configuration properties. +type VirtualMachineNetworkInterfaceIPConfigurationProperties struct { + // Subnet - Specifies the identifier of the subnet. + Subnet *SubResource `json:"subnet,omitempty"` + // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. + Primary *bool `json:"primary,omitempty"` + // PublicIPAddressConfiguration - The publicIPAddressConfiguration. + PublicIPAddressConfiguration *VirtualMachinePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` + // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPVersionsIPv4', 'IPVersionsIPv6' + PrivateIPAddressVersion IPVersions `json:"privateIPAddressVersion,omitempty"` + // ApplicationSecurityGroups - Specifies an array of references to application security group. + ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` + // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A virtual machine can reference backend address pools of multiple application gateways. Multiple virtual machines cannot use the same application gateway. + ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` + // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A virtual machine can reference backend address pools of one public and one internal load balancer. [Multiple virtual machines cannot use the same basic sku load balancer]. + LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` +} + +// VirtualMachinePatchStatus the status of virtual machine patch operations. +type VirtualMachinePatchStatus struct { + // AvailablePatchSummary - The available patch summary of the latest assessment operation for the virtual machine. + AvailablePatchSummary *AvailablePatchSummary `json:"availablePatchSummary,omitempty"` + // LastPatchInstallationSummary - The installation summary of the latest installation operation for the virtual machine. + LastPatchInstallationSummary *LastPatchInstallationSummary `json:"lastPatchInstallationSummary,omitempty"` + // ConfigurationStatuses - READ-ONLY; The enablement status of the specified patchMode + ConfigurationStatuses *[]InstanceViewStatus `json:"configurationStatuses,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachinePatchStatus. +func (vmps VirtualMachinePatchStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmps.AvailablePatchSummary != nil { + objectMap["availablePatchSummary"] = vmps.AvailablePatchSummary + } + if vmps.LastPatchInstallationSummary != nil { + objectMap["lastPatchInstallationSummary"] = vmps.LastPatchInstallationSummary + } + return json.Marshal(objectMap) +} + +// VirtualMachineProperties describes the properties of a Virtual Machine. +type VirtualMachineProperties struct { + // HardwareProfile - Specifies the hardware settings for the virtual machine. + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + // StorageProfile - Specifies the storage settings for the virtual machine disks. + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. + AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. + OsProfile *OSProfile `json:"osProfile,omitempty"` + // NetworkProfile - Specifies the network interfaces of the virtual machine. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // SecurityProfile - Specifies the Security related profile settings for the virtual machine. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // DiagnosticsProfile - Specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).

For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)

Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set.

This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. + AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` + // VirtualMachineScaleSet - Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set.

This property cannot exist along with a non-null properties.availabilitySet reference.

Minimum api‐version: 2019‐03‐01 + VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` + // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to.

Minimum api-version: 2018-04-01. + ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` + // Priority - Specifies the priority for the virtual machine.

Minimum api-version: 2019-03-01. Possible values include: 'VirtualMachinePriorityTypesRegular', 'VirtualMachinePriorityTypesLow', 'VirtualMachinePriorityTypesSpot' + Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` + // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' + EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` + // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine.

Minimum api-version: 2019-03-01. + BillingProfile *BillingProfile `json:"billingProfile,omitempty"` + // Host - Specifies information about the dedicated host that the virtual machine resides in.

Minimum api-version: 2018-10-01. + Host *SubResource `json:"host,omitempty"` + // HostGroup - Specifies information about the dedicated host group that the virtual machine resides in.

Minimum api-version: 2020-06-01.

NOTE: User cannot specify both host and hostGroup properties. + HostGroup *SubResource `json:"hostGroup,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // InstanceView - READ-ONLY; The virtual machine instance view. + InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` + // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

Possible values for Windows Server operating system are:

Windows_Client

Windows_Server

Possible values for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

[Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

Minimum api-version: 2015-06-15 + LicenseType *string `json:"licenseType,omitempty"` + // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. + VMID *string `json:"vmId,omitempty"` + // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M).

Minimum api-version: 2020-06-01 + ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` + // PlatformFaultDomain - Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains.
  • This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.
  • The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' > 1.
  • This property cannot be updated once the Virtual Machine is created.
  • Fault domain assignment can be viewed in the Virtual Machine Instance View.

    Minimum api‐version: 2020‐12‐01 + PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` + // ScheduledEventsProfile - Specifies Scheduled Event related configurations. + ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` + // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.

    Minimum api-version: 2021-03-01 + UserData *string `json:"userData,omitempty"` + // CapacityReservation - Specifies information about the capacity reservation that is used to allocate virtual machine.

    Minimum api-version: 2021-04-01. + CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` + // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS + ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineProperties. +func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmp.HardwareProfile + } + if vmp.StorageProfile != nil { + objectMap["storageProfile"] = vmp.StorageProfile + } + if vmp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities + } + if vmp.OsProfile != nil { + objectMap["osProfile"] = vmp.OsProfile + } + if vmp.NetworkProfile != nil { + objectMap["networkProfile"] = vmp.NetworkProfile + } + if vmp.SecurityProfile != nil { + objectMap["securityProfile"] = vmp.SecurityProfile + } + if vmp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile + } + if vmp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmp.AvailabilitySet + } + if vmp.VirtualMachineScaleSet != nil { + objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet + } + if vmp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup + } + if vmp.Priority != "" { + objectMap["priority"] = vmp.Priority + } + if vmp.EvictionPolicy != "" { + objectMap["evictionPolicy"] = vmp.EvictionPolicy + } + if vmp.BillingProfile != nil { + objectMap["billingProfile"] = vmp.BillingProfile + } + if vmp.Host != nil { + objectMap["host"] = vmp.Host + } + if vmp.HostGroup != nil { + objectMap["hostGroup"] = vmp.HostGroup + } + if vmp.LicenseType != nil { + objectMap["licenseType"] = vmp.LicenseType + } + if vmp.ExtensionsTimeBudget != nil { + objectMap["extensionsTimeBudget"] = vmp.ExtensionsTimeBudget + } + if vmp.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = vmp.PlatformFaultDomain + } + if vmp.ScheduledEventsProfile != nil { + objectMap["scheduledEventsProfile"] = vmp.ScheduledEventsProfile + } + if vmp.UserData != nil { + objectMap["userData"] = vmp.UserData + } + if vmp.CapacityReservation != nil { + objectMap["capacityReservation"] = vmp.CapacityReservation + } + if vmp.ApplicationProfile != nil { + objectMap["applicationProfile"] = vmp.ApplicationProfile + } + return json.Marshal(objectMap) +} + +// VirtualMachinePublicIPAddressConfiguration describes a virtual machines IP Configuration's +// PublicIPAddress configuration +type VirtualMachinePublicIPAddressConfiguration struct { + // Name - The publicIP address configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachinePublicIPAddressConfigurationProperties `json:"properties,omitempty"` + Sku *PublicIPAddressSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachinePublicIPAddressConfiguration. +func (vmpiac VirtualMachinePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmpiac.Name != nil { + objectMap["name"] = vmpiac.Name + } + if vmpiac.VirtualMachinePublicIPAddressConfigurationProperties != nil { + objectMap["properties"] = vmpiac.VirtualMachinePublicIPAddressConfigurationProperties + } + if vmpiac.Sku != nil { + objectMap["sku"] = vmpiac.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachinePublicIPAddressConfiguration struct. +func (vmpiac *VirtualMachinePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmpiac.Name = &name + } + case "properties": + if v != nil { + var virtualMachinePublicIPAddressConfigurationProperties VirtualMachinePublicIPAddressConfigurationProperties + err = json.Unmarshal(*v, &virtualMachinePublicIPAddressConfigurationProperties) + if err != nil { + return err + } + vmpiac.VirtualMachinePublicIPAddressConfigurationProperties = &virtualMachinePublicIPAddressConfigurationProperties + } + case "sku": + if v != nil { + var sku PublicIPAddressSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmpiac.Sku = &sku + } + } + } + + return nil +} + +// VirtualMachinePublicIPAddressConfigurationProperties describes a virtual machines IP Configuration's +// PublicIPAddress configuration +type VirtualMachinePublicIPAddressConfigurationProperties struct { + // IdleTimeoutInMinutes - The idle timeout of the public IP address. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + // DeleteOption - Specify what happens to the public IP address when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + DeleteOption DeleteOptions `json:"deleteOption,omitempty"` + // DNSSettings - The dns settings to be applied on the publicIP addresses . + DNSSettings *VirtualMachinePublicIPAddressDNSSettingsConfiguration `json:"dnsSettings,omitempty"` + // IPTags - The list of IP tags associated with the public IP address. + IPTags *[]VirtualMachineIPTag `json:"ipTags,omitempty"` + // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. + PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` + // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPVersionsIPv4', 'IPVersionsIPv6' + PublicIPAddressVersion IPVersions `json:"publicIPAddressVersion,omitempty"` + // PublicIPAllocationMethod - Specify the public IP allocation type. Possible values include: 'PublicIPAllocationMethodDynamic', 'PublicIPAllocationMethodStatic' + PublicIPAllocationMethod PublicIPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` +} + +// VirtualMachinePublicIPAddressDNSSettingsConfiguration describes a virtual machines network +// configuration's DNS settings. +type VirtualMachinePublicIPAddressDNSSettingsConfiguration struct { + // DomainNameLabel - The Domain name label prefix of the PublicIPAddress resources that will be created. The generated name label is the concatenation of the domain name label and vm network profile unique ID. + DomainNameLabel *string `json:"domainNameLabel,omitempty"` +} + +// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk +// will always be reimaged +type VirtualMachineReimageParameters struct { + // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + TempDisk *bool `json:"tempDisk,omitempty"` +} + +// VirtualMachineRunCommand describes a Virtual Machine run command. +type VirtualMachineRunCommand struct { + autorest.Response `json:"-"` + *VirtualMachineRunCommandProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineRunCommand. +func (vmrc VirtualMachineRunCommand) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmrc.VirtualMachineRunCommandProperties != nil { + objectMap["properties"] = vmrc.VirtualMachineRunCommandProperties + } + if vmrc.Location != nil { + objectMap["location"] = vmrc.Location + } + if vmrc.Tags != nil { + objectMap["tags"] = vmrc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommand struct. +func (vmrc *VirtualMachineRunCommand) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties + err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) + if err != nil { + return err + } + vmrc.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmrc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmrc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmrc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmrc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmrc.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineRunCommandInstanceView the instance view of a virtual machine run command. +type VirtualMachineRunCommandInstanceView struct { + // ExecutionState - Script execution status. Possible values include: 'ExecutionStateUnknown', 'ExecutionStatePending', 'ExecutionStateRunning', 'ExecutionStateFailed', 'ExecutionStateSucceeded', 'ExecutionStateTimedOut', 'ExecutionStateCanceled' + ExecutionState ExecutionState `json:"executionState,omitempty"` + // ExecutionMessage - Communicate script configuration errors or execution messages. + ExecutionMessage *string `json:"executionMessage,omitempty"` + // ExitCode - Exit code returned from script execution. + ExitCode *int32 `json:"exitCode,omitempty"` + // Output - Script output stream. + Output *string `json:"output,omitempty"` + // Error - Script error stream. + Error *string `json:"error,omitempty"` + // StartTime - Script start time. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Script end time. + EndTime *date.Time `json:"endTime,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// VirtualMachineRunCommandProperties describes the properties of a Virtual Machine run command. +type VirtualMachineRunCommandProperties struct { + // Source - The source of the run command script. + Source *VirtualMachineRunCommandScriptSource `json:"source,omitempty"` + // Parameters - The parameters used by the script. + Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` + // ProtectedParameters - The parameters used by the script. + ProtectedParameters *[]RunCommandInputParameter `json:"protectedParameters,omitempty"` + // AsyncExecution - Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. + AsyncExecution *bool `json:"asyncExecution,omitempty"` + // RunAsUser - Specifies the user account on the VM when executing the run command. + RunAsUser *string `json:"runAsUser,omitempty"` + // RunAsPassword - Specifies the user account password on the VM when executing the run command. + RunAsPassword *string `json:"runAsPassword,omitempty"` + // TimeoutInSeconds - The timeout in seconds to execute the run command. + TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` + // OutputBlobURI - Specifies the Azure storage blob where script output stream will be uploaded. + OutputBlobURI *string `json:"outputBlobUri,omitempty"` + // ErrorBlobURI - Specifies the Azure storage blob where script error stream will be uploaded. + ErrorBlobURI *string `json:"errorBlobUri,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // InstanceView - READ-ONLY; The virtual machine run command instance view. + InstanceView *VirtualMachineRunCommandInstanceView `json:"instanceView,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineRunCommandProperties. +func (vmrcp VirtualMachineRunCommandProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmrcp.Source != nil { + objectMap["source"] = vmrcp.Source + } + if vmrcp.Parameters != nil { + objectMap["parameters"] = vmrcp.Parameters + } + if vmrcp.ProtectedParameters != nil { + objectMap["protectedParameters"] = vmrcp.ProtectedParameters + } + if vmrcp.AsyncExecution != nil { + objectMap["asyncExecution"] = vmrcp.AsyncExecution + } + if vmrcp.RunAsUser != nil { + objectMap["runAsUser"] = vmrcp.RunAsUser + } + if vmrcp.RunAsPassword != nil { + objectMap["runAsPassword"] = vmrcp.RunAsPassword + } + if vmrcp.TimeoutInSeconds != nil { + objectMap["timeoutInSeconds"] = vmrcp.TimeoutInSeconds + } + if vmrcp.OutputBlobURI != nil { + objectMap["outputBlobUri"] = vmrcp.OutputBlobURI + } + if vmrcp.ErrorBlobURI != nil { + objectMap["errorBlobUri"] = vmrcp.ErrorBlobURI + } + return json.Marshal(objectMap) +} + +// VirtualMachineRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineRunCommandsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineRunCommandsCreateOrUpdateFuture.Result. +func (future *VirtualMachineRunCommandsCreateOrUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmrc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineRunCommandScriptSource describes the script sources for run command. +type VirtualMachineRunCommandScriptSource struct { + // Script - Specifies the script content to be executed on the VM. + Script *string `json:"script,omitempty"` + // ScriptURI - Specifies the script download location. + ScriptURI *string `json:"scriptUri,omitempty"` + // CommandID - Specifies a commandId of predefined built-in script. + CommandID *string `json:"commandId,omitempty"` +} + +// VirtualMachineRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineRunCommandsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineRunCommandsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineRunCommandsDeleteFuture.Result. +func (future *VirtualMachineRunCommandsDeleteFuture) result(client VirtualMachineRunCommandsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineRunCommandsListResult the List run command operation response +type VirtualMachineRunCommandsListResult struct { + autorest.Response `json:"-"` + // Value - The list of run commands + Value *[]VirtualMachineRunCommand `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of run commands. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineRunCommandsListResultIterator provides access to a complete listing of +// VirtualMachineRunCommand values. +type VirtualMachineRunCommandsListResultIterator struct { + i int + page VirtualMachineRunCommandsListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineRunCommandsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineRunCommandsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineRunCommandsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineRunCommandsListResultIterator) Response() VirtualMachineRunCommandsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineRunCommandsListResultIterator) Value() VirtualMachineRunCommand { + if !iter.page.NotDone() { + return VirtualMachineRunCommand{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineRunCommandsListResultIterator type. +func NewVirtualMachineRunCommandsListResultIterator(page VirtualMachineRunCommandsListResultPage) VirtualMachineRunCommandsListResultIterator { + return VirtualMachineRunCommandsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmrclr VirtualMachineRunCommandsListResult) IsEmpty() bool { + return vmrclr.Value == nil || len(*vmrclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmrclr VirtualMachineRunCommandsListResult) hasNextLink() bool { + return vmrclr.NextLink != nil && len(*vmrclr.NextLink) != 0 +} + +// virtualMachineRunCommandsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmrclr VirtualMachineRunCommandsListResult) virtualMachineRunCommandsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmrclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmrclr.NextLink))) +} + +// VirtualMachineRunCommandsListResultPage contains a page of VirtualMachineRunCommand values. +type VirtualMachineRunCommandsListResultPage struct { + fn func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error) + vmrclr VirtualMachineRunCommandsListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineRunCommandsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmrclr) + if err != nil { + return err + } + page.vmrclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineRunCommandsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineRunCommandsListResultPage) NotDone() bool { + return !page.vmrclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineRunCommandsListResultPage) Response() VirtualMachineRunCommandsListResult { + return page.vmrclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineRunCommandsListResultPage) Values() []VirtualMachineRunCommand { + if page.vmrclr.IsEmpty() { + return nil + } + return *page.vmrclr.Value +} + +// Creates a new instance of the VirtualMachineRunCommandsListResultPage type. +func NewVirtualMachineRunCommandsListResultPage(cur VirtualMachineRunCommandsListResult, getNextPage func(context.Context, VirtualMachineRunCommandsListResult) (VirtualMachineRunCommandsListResult, error)) VirtualMachineRunCommandsListResultPage { + return VirtualMachineRunCommandsListResultPage{ + fn: getNextPage, + vmrclr: cur, + } +} + +// VirtualMachineRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineRunCommandsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineRunCommandsClient) (VirtualMachineRunCommand, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineRunCommandsUpdateFuture.Result. +func (future *VirtualMachineRunCommandsUpdateFuture) result(client VirtualMachineRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmrc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineRunCommandsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.UpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineRunCommandUpdate describes a Virtual Machine run command. +type VirtualMachineRunCommandUpdate struct { + *VirtualMachineRunCommandProperties `json:"properties,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineRunCommandUpdate. +func (vmrcu VirtualMachineRunCommandUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmrcu.VirtualMachineRunCommandProperties != nil { + objectMap["properties"] = vmrcu.VirtualMachineRunCommandProperties + } + if vmrcu.Tags != nil { + objectMap["tags"] = vmrcu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineRunCommandUpdate struct. +func (vmrcu *VirtualMachineRunCommandUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualMachineRunCommandProperties VirtualMachineRunCommandProperties + err = json.Unmarshal(*v, &virtualMachineRunCommandProperties) + if err != nil { + return err + } + vmrcu.VirtualMachineRunCommandProperties = &virtualMachineRunCommandProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmrcu.Tags = tags + } + } + } + + return nil +} + +// VirtualMachinesAssessPatchesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesAssessPatchesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachineAssessPatchesResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesAssessPatchesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesAssessPatchesFuture.Result. +func (future *VirtualMachinesAssessPatchesFuture) result(client VirtualMachinesClient) (vmapr VirtualMachineAssessPatchesResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmapr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesAssessPatchesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmapr.Response.Response, err = future.GetResult(sender); err == nil && vmapr.Response.Response.StatusCode != http.StatusNoContent { + vmapr, err = client.AssessPatchesResponder(vmapr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesAssessPatchesFuture", "Result", vmapr.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSet describes a Virtual Machine Scale Set. +type VirtualMachineScaleSet struct { + autorest.Response `json:"-"` + // Sku - The virtual machine scale set sku. + Sku *Sku `json:"sku,omitempty"` + // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + Plan *Plan `json:"plan,omitempty"` + *VirtualMachineScaleSetProperties `json:"properties,omitempty"` + // Identity - The identity of the virtual machine scale set, if configured. + Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` + // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set + Zones *[]string `json:"zones,omitempty"` + // ExtendedLocation - The extended location of the Virtual Machine Scale Set. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. +func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmss.Sku != nil { + objectMap["sku"] = vmss.Sku + } + if vmss.Plan != nil { + objectMap["plan"] = vmss.Plan + } + if vmss.VirtualMachineScaleSetProperties != nil { + objectMap["properties"] = vmss.VirtualMachineScaleSetProperties + } + if vmss.Identity != nil { + objectMap["identity"] = vmss.Identity + } + if vmss.Zones != nil { + objectMap["zones"] = vmss.Zones + } + if vmss.ExtendedLocation != nil { + objectMap["extendedLocation"] = vmss.ExtendedLocation + } + if vmss.Location != nil { + objectMap["location"] = vmss.Location + } + if vmss.Tags != nil { + objectMap["tags"] = vmss.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. +func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmss.Sku = &sku + } + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmss.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) + if err != nil { + return err + } + vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties + } + case "identity": + if v != nil { + var identity VirtualMachineScaleSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + vmss.Identity = &identity + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + vmss.Zones = &zones + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + vmss.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmss.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmss.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmss.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. +type VirtualMachineScaleSetDataDisk struct { + // Name - The disk name. + Name *string `json:"name,omitempty"` + // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. + Lun *int32 `json:"lun,omitempty"` + // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` + // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' + CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` + // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // ManagedDisk - The managed disk parameters. + ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` + // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` + // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. + DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` +} + +// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. +type VirtualMachineScaleSetExtension struct { + autorest.Response `json:"-"` + // Name - The name of the extension. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. +func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmsse.Name != nil { + objectMap["name"] = vmsse.Name + } + if vmsse.VirtualMachineScaleSetExtensionProperties != nil { + objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. +func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmsse.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmsse.Type = &typeVar + } + case "properties": + if v != nil { + var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) + if err != nil { + return err + } + vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmsse.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. +type VirtualMachineScaleSetExtensionListResult struct { + autorest.Response `json:"-"` + // Value - The list of VM scale set extensions. + Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of +// VirtualMachineScaleSetExtension values. +type VirtualMachineScaleSetExtensionListResultIterator struct { + i int + page VirtualMachineScaleSetExtensionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { + if !iter.page.NotDone() { + return VirtualMachineScaleSetExtension{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. +func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { + return VirtualMachineScaleSetExtensionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { + return vmsselr.Value == nil || len(*vmsselr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { + return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 +} + +// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmsselr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmsselr.NextLink))) +} + +// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. +type VirtualMachineScaleSetExtensionListResultPage struct { + fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) + vmsselr VirtualMachineScaleSetExtensionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmsselr) + if err != nil { + return err + } + page.vmsselr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { + return !page.vmsselr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { + return page.vmsselr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { + if page.vmsselr.IsEmpty() { + return nil + } + return *page.vmsselr.Value +} + +// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. +func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { + return VirtualMachineScaleSetExtensionListResultPage{ + fn: getNextPage, + vmsselr: cur, + } +} + +// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. +type VirtualMachineScaleSetExtensionProfile struct { + // Extensions - The virtual machine scale set child extension resources. + Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` + // ExtensionsTimeBudget - Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M).

    Minimum api-version: 2020-06-01 + ExtensionsTimeBudget *string `json:"extensionsTimeBudget,omitempty"` +} + +// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set +// Extension. +type VirtualMachineScaleSetExtensionProperties struct { + // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` + // Publisher - The name of the extension handler publisher. + Publisher *string `json:"publisher,omitempty"` + // Type - Specifies the type of the extension; an example is "CustomScriptExtension". + Type *string `json:"type,omitempty"` + // TypeHandlerVersion - Specifies the version of the script handler. + TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` + // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` + // EnableAutomaticUpgrade - Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` + // Settings - Json formatted public settings for the extension. + Settings interface{} `json:"settings,omitempty"` + // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + ProtectedSettings interface{} `json:"protectedSettings,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. + ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` + // SuppressFailures - Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. + SuppressFailures *bool `json:"suppressFailures,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. +func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssep.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag + } + if vmssep.Publisher != nil { + objectMap["publisher"] = vmssep.Publisher + } + if vmssep.Type != nil { + objectMap["type"] = vmssep.Type + } + if vmssep.TypeHandlerVersion != nil { + objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion + } + if vmssep.AutoUpgradeMinorVersion != nil { + objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion + } + if vmssep.EnableAutomaticUpgrade != nil { + objectMap["enableAutomaticUpgrade"] = vmssep.EnableAutomaticUpgrade + } + if vmssep.Settings != nil { + objectMap["settings"] = vmssep.Settings + } + if vmssep.ProtectedSettings != nil { + objectMap["protectedSettings"] = vmssep.ProtectedSettings + } + if vmssep.ProvisionAfterExtensions != nil { + objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions + } + if vmssep.SuppressFailures != nil { + objectMap["suppressFailures"] = vmssep.SuppressFailures + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. +func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmsse.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { + vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type VirtualMachineScaleSetExtensionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. +func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type VirtualMachineScaleSetExtensionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. +func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmsse.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { + vmsse, err = client.UpdateResponder(vmsse.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. +type VirtualMachineScaleSetExtensionUpdate struct { + // Name - READ-ONLY; The name of the extension. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. +func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { + objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. +func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmsseu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmsseu.Type = &typeVar + } + case "properties": + if v != nil { + var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) + if err != nil { + return err + } + vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmsseu.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. +type VirtualMachineScaleSetIdentity struct { + // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. +func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssi.Type != "" { + objectMap["type"] = vmssi.Type + } + if vmssi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... +type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. +func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. +type VirtualMachineScaleSetInstanceView struct { + autorest.Response `json:"-"` + // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. + VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` + // Extensions - READ-ONLY; The extensions information. + Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + // OrchestrationServices - READ-ONLY; The orchestration services information. + OrchestrationServices *[]OrchestrationServiceSummary `json:"orchestrationServices,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. +func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssiv.Statuses != nil { + objectMap["statuses"] = vmssiv.Statuses + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of +// a virtual machine scale set. +type VirtualMachineScaleSetInstanceViewStatusesSummary struct { + // StatusesSummary - READ-ONLY; The extensions information. + StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. +func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP +// configuration. +type VirtualMachineScaleSetIPConfiguration struct { + // Name - The IP configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. +func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssic.Name != nil { + objectMap["name"] = vmssic.Name + } + if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { + objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties + } + if vmssic.ID != nil { + objectMap["id"] = vmssic.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. +func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssic.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) + if err != nil { + return err + } + vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssic.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's +// IP configuration properties. +type VirtualMachineScaleSetIPConfigurationProperties struct { + // Subnet - Specifies the identifier of the subnet. + Subnet *APIEntityReference `json:"subnet,omitempty"` + // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. + Primary *bool `json:"primary,omitempty"` + // PublicIPAddressConfiguration - The publicIPAddressConfiguration. + PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` + // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` + // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. + ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` + // ApplicationSecurityGroups - Specifies an array of references to application security group. + ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` + // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` + // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer. + LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` +} + +// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. +type VirtualMachineScaleSetIPTag struct { + // IPTagType - IP tag type. Example: FirstPartyUsage. + IPTagType *string `json:"ipTagType,omitempty"` + // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. + Tag *string `json:"tag,omitempty"` +} + +// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History +// operation response. +type VirtualMachineScaleSetListOSUpgradeHistory struct { + autorest.Response `json:"-"` + // Value - The list of OS upgrades performed on the virtual machine scale set. + Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of +// UpgradeOperationHistoricalStatusInfo values. +type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { + i int + page VirtualMachineScaleSetListOSUpgradeHistoryPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { + if !iter.page.NotDone() { + return UpgradeOperationHistoricalStatusInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. +func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { + return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { + return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { + return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 +} + +// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { + if !vmsslouh.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmsslouh.NextLink))) +} + +// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo +// values. +type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { + fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) + vmsslouh VirtualMachineScaleSetListOSUpgradeHistory +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmsslouh) + if err != nil { + return err + } + page.vmsslouh = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { + return !page.vmsslouh.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { + return page.vmsslouh +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { + if page.vmsslouh.IsEmpty() { + return nil + } + return *page.vmsslouh.Value +} + +// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. +func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { + return VirtualMachineScaleSetListOSUpgradeHistoryPage{ + fn: getNextPage, + vmsslouh: cur, + } +} + +// VirtualMachineScaleSetListResult the List Virtual Machine operation response. +type VirtualMachineScaleSetListResult struct { + autorest.Response `json:"-"` + // Value - The list of virtual machine scale sets. + Value *[]VirtualMachineScaleSet `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet +// values. +type VirtualMachineScaleSetListResultIterator struct { + i int + page VirtualMachineScaleSetListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineScaleSetListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { + if !iter.page.NotDone() { + return VirtualMachineScaleSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. +func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { + return VirtualMachineScaleSetListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { + return vmsslr.Value == nil || len(*vmsslr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { + return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 +} + +// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmsslr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmsslr.NextLink))) +} + +// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. +type VirtualMachineScaleSetListResultPage struct { + fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) + vmsslr VirtualMachineScaleSetListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmsslr) + if err != nil { + return err + } + page.vmsslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineScaleSetListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineScaleSetListResultPage) NotDone() bool { + return !page.vmsslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { + return page.vmsslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { + if page.vmsslr.IsEmpty() { + return nil + } + return *page.vmsslr.Value +} + +// Creates a new instance of the VirtualMachineScaleSetListResultPage type. +func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { + return VirtualMachineScaleSetListResultPage{ + fn: getNextPage, + vmsslr: cur, + } +} + +// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. +type VirtualMachineScaleSetListSkusResult struct { + autorest.Response `json:"-"` + // Value - The list of skus available for the virtual machine scale set. + Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of +// VirtualMachineScaleSetSku values. +type VirtualMachineScaleSetListSkusResultIterator struct { + i int + page VirtualMachineScaleSetListSkusResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { + if !iter.page.NotDone() { + return VirtualMachineScaleSetSku{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. +func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { + return VirtualMachineScaleSetListSkusResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { + return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { + return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 +} + +// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmsslsr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmsslsr.NextLink))) +} + +// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. +type VirtualMachineScaleSetListSkusResultPage struct { + fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) + vmsslsr VirtualMachineScaleSetListSkusResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmsslsr) + if err != nil { + return err + } + page.vmsslsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { + return !page.vmsslsr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { + return page.vmsslsr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { + if page.vmsslsr.IsEmpty() { + return nil + } + return *page.vmsslsr.Value +} + +// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. +func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { + return VirtualMachineScaleSetListSkusResultPage{ + fn: getNextPage, + vmsslsr: cur, + } +} + +// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. +type VirtualMachineScaleSetListWithLinkResult struct { + autorest.Response `json:"-"` + // Value - The list of virtual machine scale sets. + Value *[]VirtualMachineScaleSet `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of +// VirtualMachineScaleSet values. +type VirtualMachineScaleSetListWithLinkResultIterator struct { + i int + page VirtualMachineScaleSetListWithLinkResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { + if !iter.page.NotDone() { + return VirtualMachineScaleSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. +func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { + return VirtualMachineScaleSetListWithLinkResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { + return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { + return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 +} + +// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmsslwlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) +} + +// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. +type VirtualMachineScaleSetListWithLinkResultPage struct { + fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) + vmsslwlr VirtualMachineScaleSetListWithLinkResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmsslwlr) + if err != nil { + return err + } + page.vmsslwlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { + return !page.vmsslwlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { + return page.vmsslwlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { + if page.vmsslwlr.IsEmpty() { + return nil + } + return *page.vmsslwlr.Value +} + +// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. +func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { + return VirtualMachineScaleSetListWithLinkResultPage{ + fn: getNextPage, + vmsslwlr: cur, + } +} + +// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. +type VirtualMachineScaleSetManagedDiskParameters struct { + // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS', 'StorageAccountTypesPremiumZRS', 'StorageAccountTypesStandardSSDZRS' + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` + // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. + DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` +} + +// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's +// network configurations. +type VirtualMachineScaleSetNetworkConfiguration struct { + // Name - The network configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. +func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssnc.Name != nil { + objectMap["name"] = vmssnc.Name + } + if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { + objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties + } + if vmssnc.ID != nil { + objectMap["id"] = vmssnc.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. +func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssnc.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) + if err != nil { + return err + } + vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssnc.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network +// configuration's DNS settings. +type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { + // DNSServers - List of DNS servers IP addresses + DNSServers *[]string `json:"dnsServers,omitempty"` +} + +// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network +// profile's IP configuration. +type VirtualMachineScaleSetNetworkConfigurationProperties struct { + // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. + Primary *bool `json:"primary,omitempty"` + // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. + EnableFpga *bool `json:"enableFpga,omitempty"` + // NetworkSecurityGroup - The network security group. + NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` + // DNSSettings - The dns settings to be applied on the network interfaces. + DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` + // IPConfigurations - Specifies the IP configurations of the network interface. + IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` + // EnableIPForwarding - Whether IP forwarding enabled on this NIC. + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + DeleteOption DeleteOptions `json:"deleteOption,omitempty"` +} + +// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. +type VirtualMachineScaleSetNetworkProfile struct { + // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` + // NetworkInterfaceConfigurations - The list of network configurations. + NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` + // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible'. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' + NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` +} + +// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. +type VirtualMachineScaleSetOSDisk struct { + // Name - The disk name. + Name *string `json:"name,omitempty"` + // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` + // CreateOption - Specifies how the virtual machines in the scale set should be created.

    The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' + CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` + // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. + DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` + // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

    Possible values are:

    **Windows**

    **Linux**. Possible values include: 'OperatingSystemTypesWindows', 'OperatingSystemTypesLinux' + OsType OperatingSystemTypes `json:"osType,omitempty"` + // Image - Specifies information about the unmanaged user image to base the scale set on. + Image *VirtualHardDisk `json:"image,omitempty"` + // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. + VhdContainers *[]string `json:"vhdContainers,omitempty"` + // ManagedDisk - The managed disk parameters. + ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` +} + +// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. +type VirtualMachineScaleSetOSProfile struct { + // ComputerNamePrefix - Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. + ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` + // AdminUsername - Specifies the name of the administrator account.

    **Windows-only restriction:** Cannot end in "."

    **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 character

    **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 characters + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - Specifies the password of the administrator account.

    **Minimum-length (Windows):** 8 characters

    **Minimum-length (Linux):** 6 characters

    **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 characters

    **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
    Has lower characters
    Has upper characters
    Has a digit
    Has a special character (Regex match [\W_])

    **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp)

    For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + AdminPassword *string `json:"adminPassword,omitempty"` + // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

    For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + CustomData *string `json:"customData,omitempty"` + // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` + // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

    For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` + // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` +} + +// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. +type VirtualMachineScaleSetProperties struct { + // UpgradePolicy - The upgrade policy. + UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` + // VirtualMachineProfile - The virtual machine profile. + VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. + Overprovision *bool `json:"overprovision,omitempty"` + // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` + // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + UniqueID *string `json:"uniqueId,omitempty"` + // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. + SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` + // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + ZoneBalance *bool `json:"zoneBalance,omitempty"` + // PlatformFaultDomainCount - Fault Domain count for each placement group. + PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` + // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

    Minimum api-version: 2018-04-01. + ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` + // HostGroup - Specifies information about the dedicated host group that the virtual machine scale set resides in.

    Minimum api-version: 2020-06-01. + HostGroup *SubResource `json:"hostGroup,omitempty"` + // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. + AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. + ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` + // OrchestrationMode - Specifies the orchestration mode for the virtual machine scale set. Possible values include: 'OrchestrationModeUniform', 'OrchestrationModeFlexible' + OrchestrationMode OrchestrationMode `json:"orchestrationMode,omitempty"` + // SpotRestorePolicy - Specifies the Spot Restore properties for the virtual machine scale set. + SpotRestorePolicy *SpotRestorePolicy `json:"spotRestorePolicy,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. +func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssp.UpgradePolicy != nil { + objectMap["upgradePolicy"] = vmssp.UpgradePolicy + } + if vmssp.AutomaticRepairsPolicy != nil { + objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy + } + if vmssp.VirtualMachineProfile != nil { + objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile + } + if vmssp.Overprovision != nil { + objectMap["overprovision"] = vmssp.Overprovision + } + if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { + objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs + } + if vmssp.SinglePlacementGroup != nil { + objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup + } + if vmssp.ZoneBalance != nil { + objectMap["zoneBalance"] = vmssp.ZoneBalance + } + if vmssp.PlatformFaultDomainCount != nil { + objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount + } + if vmssp.ProximityPlacementGroup != nil { + objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup + } + if vmssp.HostGroup != nil { + objectMap["hostGroup"] = vmssp.HostGroup + } + if vmssp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities + } + if vmssp.ScaleInPolicy != nil { + objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy + } + if vmssp.OrchestrationMode != "" { + objectMap["orchestrationMode"] = vmssp.OrchestrationMode + } + if vmssp.SpotRestorePolicy != nil { + objectMap["spotRestorePolicy"] = vmssp.SpotRestorePolicy + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration +type VirtualMachineScaleSetPublicIPAddressConfiguration struct { + // Name - The publicIP address configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` + Sku *PublicIPAddressSku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. +func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmsspiac.Name != nil { + objectMap["name"] = vmsspiac.Name + } + if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { + objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties + } + if vmsspiac.Sku != nil { + objectMap["sku"] = vmsspiac.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. +func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmsspiac.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) + if err != nil { + return err + } + vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties + } + case "sku": + if v != nil { + var sku PublicIPAddressSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmsspiac.Sku = &sku + } + } + } + + return nil +} + +// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets +// network configuration's DNS settings. +type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { + // DomainNameLabel - The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created + DomainNameLabel *string `json:"domainNameLabel,omitempty"` +} + +// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration +type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { + // IdleTimeoutInMinutes - The idle timeout of the public IP address. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + // DNSSettings - The dns settings to be applied on the publicIP addresses . + DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` + // IPTags - The list of IP tags associated with the public IP address. + IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` + // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. + PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` + // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` + // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + DeleteOption DeleteOptions `json:"deleteOption,omitempty"` +} + +// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. +type VirtualMachineScaleSetReimageParameters struct { + // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + InstanceIds *[]string `json:"instanceIds,omitempty"` + // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + TempDisk *bool `json:"tempDisk,omitempty"` +} + +// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. +func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. +func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. +func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type VirtualMachineScaleSetsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. +func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmss.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { + vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsDeallocateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. +func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. +func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type VirtualMachineScaleSetsDeleteInstancesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. +func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. +type VirtualMachineScaleSetSku struct { + // ResourceType - READ-ONLY; The type of resource the sku applies to. + ResourceType *string `json:"resourceType,omitempty"` + // Sku - READ-ONLY; The Sku. + Sku *Sku `json:"sku,omitempty"` + // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. + Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. +func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. +type VirtualMachineScaleSetSkuCapacity struct { + // Minimum - READ-ONLY; The minimum capacity. + Minimum *int64 `json:"minimum,omitempty"` + // Maximum - READ-ONLY; The maximum capacity that can be set. + Maximum *int64 `json:"maximum,omitempty"` + // DefaultCapacity - READ-ONLY; The default capacity. + DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` + // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' + ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. +func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetsPerformMaintenanceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. +func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsPowerOffFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. +func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsRedeployFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. +func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsReimageAllFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. +func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsReimageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. +func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. +func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsSetOrchestrationServiceStateFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type VirtualMachineScaleSetsSetOrchestrationServiceStateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsSetOrchestrationServiceStateFuture.Result. +func (future *VirtualMachineScaleSetsSetOrchestrationServiceStateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsSetOrchestrationServiceStateFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. +func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. +type VirtualMachineScaleSetStorageProfile struct { + // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. + ImageReference *ImageReference `json:"imageReference,omitempty"` + // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set.

    For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` + // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set.

    For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` +} + +// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. +func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmss.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { + vmss, err = client.UpdateResponder(vmss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type VirtualMachineScaleSetsUpdateInstancesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. +func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. +type VirtualMachineScaleSetUpdate struct { + // Sku - The virtual machine scale set sku. + Sku *Sku `json:"sku,omitempty"` + // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. + Plan *Plan `json:"plan,omitempty"` + *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` + // Identity - The identity of the virtual machine scale set, if configured. + Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. +func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssu.Sku != nil { + objectMap["sku"] = vmssu.Sku + } + if vmssu.Plan != nil { + objectMap["plan"] = vmssu.Plan + } + if vmssu.VirtualMachineScaleSetUpdateProperties != nil { + objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties + } + if vmssu.Identity != nil { + objectMap["identity"] = vmssu.Identity + } + if vmssu.Tags != nil { + objectMap["tags"] = vmssu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. +func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmssu.Sku = &sku + } + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmssu.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) + if err != nil { + return err + } + vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties + } + case "identity": + if v != nil { + var identity VirtualMachineScaleSetIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + vmssu.Identity = &identity + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmssu.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP +// configuration. NOTE: The subnet of a scale set may be modified as long as the original subnet and the +// new subnet are in the same virtual network +type VirtualMachineScaleSetUpdateIPConfiguration struct { + // Name - The IP configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. +func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssuic.Name != nil { + objectMap["name"] = vmssuic.Name + } + if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { + objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties + } + if vmssuic.ID != nil { + objectMap["id"] = vmssuic.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. +func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssuic.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) + if err != nil { + return err + } + vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssuic.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network +// profile's IP configuration properties. +type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { + // Subnet - The subnet. + Subnet *APIEntityReference `json:"subnet,omitempty"` + // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. + Primary *bool `json:"primary,omitempty"` + // PublicIPAddressConfiguration - The publicIPAddressConfiguration. + PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` + // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` + // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. + ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` + // ApplicationSecurityGroups - Specifies an array of references to application security group. + ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` + // LoadBalancerBackendAddressPools - The load balancer backend address pools. + LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` + // LoadBalancerInboundNatPools - The load balancer inbound nat pools. + LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` +} + +// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's +// network configurations. +type VirtualMachineScaleSetUpdateNetworkConfiguration struct { + // Name - The network configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` + // ID - Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. +func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssunc.Name != nil { + objectMap["name"] = vmssunc.Name + } + if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { + objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties + } + if vmssunc.ID != nil { + objectMap["id"] = vmssunc.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. +func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssunc.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) + if err != nil { + return err + } + vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssunc.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set +// updatable network profile's IP configuration.Use this object for updating network profile's IP +// Configuration. +type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { + // Primary - Whether this is a primary NIC on a virtual machine. + Primary *bool `json:"primary,omitempty"` + // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + // EnableFpga - Specifies whether the network interface is FPGA networking-enabled. + EnableFpga *bool `json:"enableFpga,omitempty"` + // NetworkSecurityGroup - The network security group. + NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` + // DNSSettings - The dns settings to be applied on the network interfaces. + DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` + // IPConfigurations - The virtual machine scale set IP Configuration. + IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` + // EnableIPForwarding - Whether IP forwarding enabled on this NIC. + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + // DeleteOption - Specify what happens to the network interface when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + DeleteOption DeleteOptions `json:"deleteOption,omitempty"` +} + +// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. +type VirtualMachineScaleSetUpdateNetworkProfile struct { + // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` + // NetworkInterfaceConfigurations - The list of network configurations. + NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` + // NetworkAPIVersion - specifies the Microsoft.Network API version used when creating networking resources in the Network Interface Configurations for Virtual Machine Scale Set with orchestration mode 'Flexible'. Possible values include: 'NetworkAPIVersionTwoZeroTwoZeroHyphenMinusOneOneHyphenMinusZeroOne' + NetworkAPIVersion NetworkAPIVersion `json:"networkApiVersion,omitempty"` +} + +// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update +// Object. This should be used for Updating VMSS OS Disk. +type VirtualMachineScaleSetUpdateOSDisk struct { + // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' + Caching CachingTypes `json:"caching,omitempty"` + // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. + WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` + // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + // Image - The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. + Image *VirtualHardDisk `json:"image,omitempty"` + // VhdContainers - The list of virtual hard disk container uris. + VhdContainers *[]string `json:"vhdContainers,omitempty"` + // ManagedDisk - The managed disk parameters. + ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` +} + +// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. +type VirtualMachineScaleSetUpdateOSProfile struct { + // CustomData - A base-64 encoded string of custom data. + CustomData *string `json:"customData,omitempty"` + // WindowsConfiguration - The Windows Configuration of the OS profile. + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` + // LinuxConfiguration - The Linux Configuration of the OS profile. + LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` + // Secrets - The List of certificates for addition to the VM. + Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` +} + +// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. +type VirtualMachineScaleSetUpdateProperties struct { + // UpgradePolicy - The upgrade policy. + UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + // AutomaticRepairsPolicy - Policy for automatic repairs. + AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` + // VirtualMachineProfile - The virtual machine profile. + VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` + // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. + Overprovision *bool `json:"overprovision,omitempty"` + // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` + // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. + SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` + // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. + AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // ScaleInPolicy - Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. + ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` + // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

    Minimum api-version: 2018-04-01. + ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` +} + +// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration +type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { + // Name - The publicIP address configuration name. + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. +func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssupiac.Name != nil { + objectMap["name"] = vmssupiac.Name + } + if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { + objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. +func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssupiac.Name = &name + } + case "properties": + if v != nil { + var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) + if err != nil { + return err + } + vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties + } + } + } + + return nil +} + +// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale +// set IP Configuration's PublicIPAddress configuration +type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { + // IdleTimeoutInMinutes - The idle timeout of the public IP address. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + // DNSSettings - The dns settings to be applied on the publicIP addresses . + DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` + // DeleteOption - Specify what happens to the public IP when the VM is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + DeleteOption DeleteOptions `json:"deleteOption,omitempty"` +} + +// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. +type VirtualMachineScaleSetUpdateStorageProfile struct { + // ImageReference - The image reference. + ImageReference *ImageReference `json:"imageReference,omitempty"` + // OsDisk - The OS disk. + OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` + // DataDisks - The data disks. + DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` +} + +// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. +type VirtualMachineScaleSetUpdateVMProfile struct { + // OsProfile - The virtual machine scale set OS profile. + OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` + // StorageProfile - The virtual machine scale set storage profile. + StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` + // NetworkProfile - The virtual machine scale set network profile. + NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` + // SecurityProfile - The virtual machine scale set Security profile + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // DiagnosticsProfile - The virtual machine scale set diagnostics profile. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + // ExtensionProfile - The virtual machine scale set extension profile. + ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` + // LicenseType - The license type, which is for bring your own license scenario. + LicenseType *string `json:"licenseType,omitempty"` + // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

    Minimum api-version: 2019-03-01. + BillingProfile *BillingProfile `json:"billingProfile,omitempty"` + // ScheduledEventsProfile - Specifies Scheduled Event related configurations. + ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` + // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.

    Minimum api-version: 2021-03-01 + UserData *string `json:"userData,omitempty"` +} + +// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. +type VirtualMachineScaleSetVM struct { + autorest.Response `json:"-"` + // InstanceID - READ-ONLY; The virtual machine instance ID. + InstanceID *string `json:"instanceId,omitempty"` + // Sku - READ-ONLY; The virtual machine SKU. + Sku *Sku `json:"sku,omitempty"` + *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` + // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + Plan *Plan `json:"plan,omitempty"` + // Resources - READ-ONLY; The virtual machine child extension resources. + Resources *[]VirtualMachineExtension `json:"resources,omitempty"` + // Zones - READ-ONLY; The virtual machine zones. + Zones *[]string `json:"zones,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. +func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssv.VirtualMachineScaleSetVMProperties != nil { + objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties + } + if vmssv.Plan != nil { + objectMap["plan"] = vmssv.Plan + } + if vmssv.Location != nil { + objectMap["location"] = vmssv.Location + } + if vmssv.Tags != nil { + objectMap["tags"] = vmssv.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. +func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "instanceId": + if v != nil { + var instanceID string + err = json.Unmarshal(*v, &instanceID) + if err != nil { + return err + } + vmssv.InstanceID = &instanceID + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + vmssv.Sku = &sku + } + case "properties": + if v != nil { + var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties + err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) + if err != nil { + return err + } + vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties + } + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmssv.Plan = &plan + } + case "resources": + if v != nil { + var resources []VirtualMachineExtension + err = json.Unmarshal(*v, &resources) + if err != nil { + return err + } + vmssv.Resources = &resources + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + vmssv.Zones = &zones + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssv.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssv.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmssv.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vmssv.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmssv.Tags = tags + } + } + } + + return nil +} + +// VirtualMachineScaleSetVMExtension describes a VMSS VM Extension. +type VirtualMachineScaleSetVMExtension struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; The name of the extension. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *VirtualMachineExtensionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtension. +func (vmssve VirtualMachineScaleSetVMExtension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssve.VirtualMachineExtensionProperties != nil { + objectMap["properties"] = vmssve.VirtualMachineExtensionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtension struct. +func (vmssve *VirtualMachineScaleSetVMExtension) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssve.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmssve.Type = &typeVar + } + case "properties": + if v != nil { + var virtualMachineExtensionProperties VirtualMachineExtensionProperties + err = json.Unmarshal(*v, &virtualMachineExtensionProperties) + if err != nil { + return err + } + vmssve.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssve.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmssve.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { + vmssve, err = client.CreateOrUpdateResponder(vmssve.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. +func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMExtensionsListResult the List VMSS VM Extension operation response +type VirtualMachineScaleSetVMExtensionsListResult struct { + autorest.Response `json:"-"` + // Value - The list of VMSS VM extensions + Value *[]VirtualMachineScaleSetVMExtension `json:"value,omitempty"` +} + +// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine +// scale set. +type VirtualMachineScaleSetVMExtensionsSummary struct { + // Name - READ-ONLY; The extension name. + Name *string `json:"name,omitempty"` + // StatusesSummary - READ-ONLY; The extensions information. + StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. +func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineScaleSetVMExtension, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vmssve VirtualMachineScaleSetVMExtension, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmssve.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmssve.Response.Response, err = future.GetResult(sender); err == nil && vmssve.Response.Response.StatusCode != http.StatusNoContent { + vmssve, err = client.UpdateResponder(vmssve.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vmssve.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetVMExtensionUpdate describes a VMSS VM Extension. +type VirtualMachineScaleSetVMExtensionUpdate struct { + // Name - READ-ONLY; The name of the extension. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionUpdate. +func (vmssveu VirtualMachineScaleSetVMExtensionUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssveu.VirtualMachineExtensionUpdateProperties != nil { + objectMap["properties"] = vmssveu.VirtualMachineExtensionUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVMExtensionUpdate struct. +func (vmssveu *VirtualMachineScaleSetVMExtensionUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vmssveu.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vmssveu.Type = &typeVar + } + case "properties": + if v != nil { + var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties + err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) + if err != nil { + return err + } + vmssveu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vmssveu.ID = &ID + } + } + } + + return nil +} + +// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale +// set. +type VirtualMachineScaleSetVMInstanceIDs struct { + // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + InstanceIds *[]string `json:"instanceIds,omitempty"` +} + +// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM +// scale set. +type VirtualMachineScaleSetVMInstanceRequiredIDs struct { + // InstanceIds - The virtual machine scale set instance ids. + InstanceIds *[]string `json:"instanceIds,omitempty"` +} + +// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. +type VirtualMachineScaleSetVMInstanceView struct { + autorest.Response `json:"-"` + // PlatformUpdateDomain - The Update Domain count. + PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` + // PlatformFaultDomain - The Fault Domain count. + PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` + // RdpThumbPrint - The Remote desktop certificate thumbprint. + RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` + // VMAgent - The VM Agent running on the virtual machine. + VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` + // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. + MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` + // Disks - The disks information. + Disks *[]DiskInstanceView `json:"disks,omitempty"` + // Extensions - The extensions information. + Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` + // VMHealth - READ-ONLY; The health status for the VM. + VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` + // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor. + BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` + // Statuses - The resource status information. + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + // AssignedHost - READ-ONLY; Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled.

    Minimum api-version: 2020-06-01. + AssignedHost *string `json:"assignedHost,omitempty"` + // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. + PlacementGroupID *string `json:"placementGroupId,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. +func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssviv.PlatformUpdateDomain != nil { + objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain + } + if vmssviv.PlatformFaultDomain != nil { + objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain + } + if vmssviv.RdpThumbPrint != nil { + objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint + } + if vmssviv.VMAgent != nil { + objectMap["vmAgent"] = vmssviv.VMAgent + } + if vmssviv.MaintenanceRedeployStatus != nil { + objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus + } + if vmssviv.Disks != nil { + objectMap["disks"] = vmssviv.Disks + } + if vmssviv.Extensions != nil { + objectMap["extensions"] = vmssviv.Extensions + } + if vmssviv.BootDiagnostics != nil { + objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics + } + if vmssviv.Statuses != nil { + objectMap["statuses"] = vmssviv.Statuses + } + if vmssviv.PlacementGroupID != nil { + objectMap["placementGroupId"] = vmssviv.PlacementGroupID + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. +type VirtualMachineScaleSetVMListResult struct { + autorest.Response `json:"-"` + // Value - The list of virtual machine scale sets VMs. + Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` + // NextLink - The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of +// VirtualMachineScaleSetVM values. +type VirtualMachineScaleSetVMListResultIterator struct { + i int + page VirtualMachineScaleSetVMListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { + if !iter.page.NotDone() { + return VirtualMachineScaleSetVM{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. +func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { + return VirtualMachineScaleSetVMListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { + return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { + return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 +} + +// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vmssvlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vmssvlr.NextLink))) +} + +// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. +type VirtualMachineScaleSetVMListResultPage struct { + fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) + vmssvlr VirtualMachineScaleSetVMListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vmssvlr) + if err != nil { + return err + } + page.vmssvlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualMachineScaleSetVMListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { + return !page.vmssvlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { + return page.vmssvlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { + if page.vmssvlr.IsEmpty() { + return nil + } + return *page.vmssvlr.Value +} + +// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. +func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { + return VirtualMachineScaleSetVMListResultPage{ + fn: getNextPage, + vmssvlr: cur, + } +} + +// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network +// profile. +type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { + // NetworkInterfaceConfigurations - The list of network configurations. + NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` +} + +// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. +type VirtualMachineScaleSetVMProfile struct { + // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. + OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` + // StorageProfile - Specifies the storage settings for the virtual machine disks. + StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` + // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. + NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` + // SecurityProfile - Specifies the Security related profile settings for the virtual machines in the scale set. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. + ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` + // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

    Possible values for Windows Server operating system are:

    Windows_Client

    Windows_Server

    Possible values for Linux Server operating system are:

    RHEL_BYOS (for RHEL)

    SLES_BYOS (for SUSE)

    For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

    [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

    Minimum api-version: 2015-06-15 + LicenseType *string `json:"licenseType,omitempty"` + // Priority - Specifies the priority for the virtual machines in the scale set.

    Minimum api-version: 2017-10-30-preview. Possible values include: 'VirtualMachinePriorityTypesRegular', 'VirtualMachinePriorityTypesLow', 'VirtualMachinePriorityTypesSpot' + Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` + // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'VirtualMachineEvictionPolicyTypesDeallocate', 'VirtualMachineEvictionPolicyTypesDelete' + EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` + // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

    Minimum api-version: 2019-03-01. + BillingProfile *BillingProfile `json:"billingProfile,omitempty"` + // ScheduledEventsProfile - Specifies Scheduled Event related configurations. + ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` + // UserData - UserData for the virtual machines in the scale set, which must be base-64 encoded. Customer should not pass any secrets in here.

    Minimum api-version: 2021-03-01 + UserData *string `json:"userData,omitempty"` + // CapacityReservation - Specifies the capacity reservation related details of a scale set.

    Minimum api-version: 2021-04-01. + CapacityReservation *CapacityReservationProfile `json:"capacityReservation,omitempty"` + // ApplicationProfile - Specifies the gallery applications that should be made available to the VM/VMSS + ApplicationProfile *ApplicationProfile `json:"applicationProfile,omitempty"` +} + +// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual +// machine. +type VirtualMachineScaleSetVMProperties struct { + // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. + LatestModelApplied *bool `json:"latestModelApplied,omitempty"` + // VMID - READ-ONLY; Azure VM unique ID. + VMID *string `json:"vmId,omitempty"` + // InstanceView - READ-ONLY; The virtual machine instance view. + InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` + // HardwareProfile - Specifies the hardware settings for the virtual machine. + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + // StorageProfile - Specifies the storage settings for the virtual machine disks. + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` + // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. + AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // OsProfile - Specifies the operating system settings for the virtual machine. + OsProfile *OSProfile `json:"osProfile,omitempty"` + // SecurityProfile - Specifies the Security related profile settings for the virtual machine. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // NetworkProfile - Specifies the network interfaces of the virtual machine. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. + NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` + // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).

    For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)

    Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // LicenseType - Specifies that the image or disk that is being used was licensed on-premises.

    Possible values for Windows Server operating system are:

    Windows_Client

    Windows_Server

    Possible values for Linux Server operating system are:

    RHEL_BYOS (for RHEL)

    SLES_BYOS (for SUSE)

    For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)

    [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)

    Minimum api-version: 2015-06-15 + LicenseType *string `json:"licenseType,omitempty"` + // ModelDefinitionApplied - READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. + ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` + // ProtectionPolicy - Specifies the protection policy of the virtual machine. + ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` + // UserData - UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here.

    Minimum api-version: 2021-03-01 + UserData *string `json:"userData,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. +func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmssvp.HardwareProfile != nil { + objectMap["hardwareProfile"] = vmssvp.HardwareProfile + } + if vmssvp.StorageProfile != nil { + objectMap["storageProfile"] = vmssvp.StorageProfile + } + if vmssvp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities + } + if vmssvp.OsProfile != nil { + objectMap["osProfile"] = vmssvp.OsProfile + } + if vmssvp.SecurityProfile != nil { + objectMap["securityProfile"] = vmssvp.SecurityProfile + } + if vmssvp.NetworkProfile != nil { + objectMap["networkProfile"] = vmssvp.NetworkProfile + } + if vmssvp.NetworkProfileConfiguration != nil { + objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration + } + if vmssvp.DiagnosticsProfile != nil { + objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile + } + if vmssvp.AvailabilitySet != nil { + objectMap["availabilitySet"] = vmssvp.AvailabilitySet + } + if vmssvp.LicenseType != nil { + objectMap["licenseType"] = vmssvp.LicenseType + } + if vmssvp.ProtectionPolicy != nil { + objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy + } + if vmssvp.UserData != nil { + objectMap["userData"] = vmssvp.UserData + } + return json.Marshal(objectMap) +} + +// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. +type VirtualMachineScaleSetVMProtectionPolicy struct { + // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. + ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` + // ProtectFromScaleSetActions - Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. + ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` +} + +// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. +type VirtualMachineScaleSetVMReimageParameters struct { + // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. + TempDisk *bool `json:"tempDisk,omitempty"` +} + +// VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmrc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.CreateOrUpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetVMRunCommandsDeleteFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMRunCommandsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMRunCommandsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMRunCommandsDeleteFuture.Result. +func (future *VirtualMachineScaleSetVMRunCommandsDeleteFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMRunCommandsUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualMachineScaleSetVMRunCommandsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMRunCommandsClient) (VirtualMachineRunCommand, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMRunCommandsUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMRunCommandsUpdateFuture) result(client VirtualMachineScaleSetVMRunCommandsClient) (vmrc VirtualMachineRunCommand, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmrc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmrc.Response.Response, err = future.GetResult(sender); err == nil && vmrc.Response.Response.StatusCode != http.StatusNoContent { + vmrc, err = client.UpdateResponder(vmrc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsUpdateFuture", "Result", vmrc.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsDeallocateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. +func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. +func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. +func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsPowerOffFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. +func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsRedeployFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. +func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsReimageAllFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. +func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsReimageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. +func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. +func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsRunCommandFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. +func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rcr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { + rcr, err = client.RunCommandResponder(rcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. +func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineScaleSetVMsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. +func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmssv.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { + vmssv, err = client.UpdateResponder(vmssv.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesCaptureFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesCaptureFuture.Result. +func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmcr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { + vmcr, err = client.CaptureResponder(vmcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesConvertToManagedDisksFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. +func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachine, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. +func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + VM.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { + VM, err = client.CreateOrUpdateResponder(VM.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesDeallocateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesDeallocateFuture.Result. +func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesDeleteFuture.Result. +func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesInstallPatchesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesInstallPatchesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachineInstallPatchesResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesInstallPatchesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesInstallPatchesFuture.Result. +func (future *VirtualMachinesInstallPatchesFuture) result(client VirtualMachinesClient) (vmipr VirtualMachineInstallPatchesResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vmipr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesInstallPatchesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vmipr.Response.Response, err = future.GetResult(sender); err == nil && vmipr.Response.Response.StatusCode != http.StatusNoContent { + vmipr, err = client.InstallPatchesResponder(vmipr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesInstallPatchesFuture", "Result", vmipr.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineSize describes the properties of a VM size. +type VirtualMachineSize struct { + // Name - The name of the virtual machine size. + Name *string `json:"name,omitempty"` + // NumberOfCores - The number of cores supported by the virtual machine size. For Constrained vCPU capable VM sizes, this number represents the total vCPUs of quota that the VM uses. For accurate vCPU count, please refer to https://docs.microsoft.com/azure/virtual-machines/constrained-vcpu or https://docs.microsoft.com/rest/api/compute/resourceskus/list + NumberOfCores *int32 `json:"numberOfCores,omitempty"` + // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. + OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` + // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. + ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` + // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. + MemoryInMB *int32 `json:"memoryInMB,omitempty"` + // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. + MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` +} + +// VirtualMachineSizeListResult the List Virtual Machine operation response. +type VirtualMachineSizeListResult struct { + autorest.Response `json:"-"` + // Value - The list of virtual machine sizes. + Value *[]VirtualMachineSize `json:"value,omitempty"` +} + +// VirtualMachineSoftwarePatchProperties describes the properties of a Virtual Machine software patch. +type VirtualMachineSoftwarePatchProperties struct { + // PatchID - READ-ONLY; A unique identifier for the patch. + PatchID *string `json:"patchId,omitempty"` + // Name - READ-ONLY; The friendly name of the patch. + Name *string `json:"name,omitempty"` + // Version - READ-ONLY; The version number of the patch. This property applies only to Linux patches. + Version *string `json:"version,omitempty"` + // KbID - READ-ONLY; The KBID of the patch. Only applies to Windows patches. + KbID *string `json:"kbId,omitempty"` + // Classifications - READ-ONLY; The classification(s) of the patch as provided by the patch publisher. + Classifications *[]string `json:"classifications,omitempty"` + // RebootBehavior - READ-ONLY; Describes the reboot requirements of the patch. Possible values include: 'VMGuestPatchRebootBehaviorUnknown', 'VMGuestPatchRebootBehaviorNeverReboots', 'VMGuestPatchRebootBehaviorAlwaysRequiresReboot', 'VMGuestPatchRebootBehaviorCanRequestReboot' + RebootBehavior VMGuestPatchRebootBehavior `json:"rebootBehavior,omitempty"` + // ActivityID - READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs. + ActivityID *string `json:"activityId,omitempty"` + // PublishedDate - READ-ONLY; The UTC timestamp when the repository published this patch. + PublishedDate *date.Time `json:"publishedDate,omitempty"` + // LastModifiedDateTime - READ-ONLY; The UTC timestamp of the last update to this patch record. + LastModifiedDateTime *date.Time `json:"lastModifiedDateTime,omitempty"` + // AssessmentState - READ-ONLY; Describes the availability of a given patch. Possible values include: 'PatchAssessmentStateUnknown', 'PatchAssessmentStateAvailable' + AssessmentState PatchAssessmentState `json:"assessmentState,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineSoftwarePatchProperties. +func (vmspp VirtualMachineSoftwarePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesPerformMaintenanceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. +func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesPowerOffFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesPowerOffFuture.Result. +func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesReapplyFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesReapplyFuture.Result. +func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesRedeployFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesRedeployFuture.Result. +func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesReimageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesReimageFuture.Result. +func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesRestartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesRestartFuture.Result. +func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesRunCommandFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (RunCommandResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesRunCommandFuture.Result. +func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rcr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { + rcr, err = client.RunCommandResponder(rcr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesStartFuture.Result. +func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view +// status summary. +type VirtualMachineStatusCodeCount struct { + // Code - READ-ONLY; The instance view status code. + Code *string `json:"code,omitempty"` + // Count - READ-ONLY; The number of instances having a particular status code. + Count *int32 `json:"count,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. +func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (VirtualMachine, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesUpdateFuture.Result. +func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + VM.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { + VM, err = client.UpdateResponder(VM.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachineUpdate describes a Virtual Machine Update. +type VirtualMachineUpdate struct { + // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + Plan *Plan `json:"plan,omitempty"` + *VirtualMachineProperties `json:"properties,omitempty"` + // Identity - The identity of the virtual machine, if configured. + Identity *VirtualMachineIdentity `json:"identity,omitempty"` + // Zones - The virtual machine zones. + Zones *[]string `json:"zones,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineUpdate. +func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmu.Plan != nil { + objectMap["plan"] = vmu.Plan + } + if vmu.VirtualMachineProperties != nil { + objectMap["properties"] = vmu.VirtualMachineProperties + } + if vmu.Identity != nil { + objectMap["identity"] = vmu.Identity + } + if vmu.Zones != nil { + objectMap["zones"] = vmu.Zones + } + if vmu.Tags != nil { + objectMap["tags"] = vmu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. +func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "plan": + if v != nil { + var plan Plan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + vmu.Plan = &plan + } + case "properties": + if v != nil { + var virtualMachineProperties VirtualMachineProperties + err = json.Unmarshal(*v, &virtualMachineProperties) + if err != nil { + return err + } + vmu.VirtualMachineProperties = &virtualMachineProperties + } + case "identity": + if v != nil { + var identity VirtualMachineIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + vmu.Identity = &identity + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + vmu.Zones = &zones + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + vmu.Tags = tags + } + } + } + + return nil +} + +// VMGalleryApplication specifies the required information to reference a compute gallery application +// version +type VMGalleryApplication struct { + // Tags - Optional, Specifies a passthrough value for more generic context. + Tags *string `json:"tags,omitempty"` + // Order - Optional, Specifies the order in which the packages have to be installed + Order *int32 `json:"order,omitempty"` + // PackageReferenceID - Specifies the GalleryApplicationVersion resource id on the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + PackageReferenceID *string `json:"packageReferenceId,omitempty"` + // ConfigurationReference - Optional, Specifies the uri to an azure blob that will replace the default configuration for the package if provided + ConfigurationReference *string `json:"configurationReference,omitempty"` +} + +// VMScaleSetConvertToSinglePlacementGroupInput ... +type VMScaleSetConvertToSinglePlacementGroupInput struct { + // ActivePlacementGroupID - Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. + ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` +} + +// VMSizeProperties specifies VM Size Property settings on the virtual machine. +type VMSizeProperties struct { + // VCPUsAvailable - Specifies the number of vCPUs available for the VM.

    When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list) . + VCPUsAvailable *int32 `json:"vCPUsAvailable,omitempty"` + // VCPUsPerCore - Specifies the vCPU to physical core ratio.

    When this property is not specified in the request body the default behavior is set to the value of vCPUsPerCore for the VM Size exposed in api response of [List all available virtual machine sizes in a region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list)

    Setting this property to 1 also means that hyper-threading is disabled. + VCPUsPerCore *int32 `json:"vCPUsPerCore,omitempty"` +} + +// WindowsConfiguration specifies Windows operating system settings on the virtual machine. +type WindowsConfiguration struct { + // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine.

    When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` + // EnableAutomaticUpdates - Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true.

    For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. + EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` + // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time".

    Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + TimeZone *string `json:"timeZone,omitempty"` + // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. + AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` + // PatchSettings - [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + PatchSettings *PatchSettings `json:"patchSettings,omitempty"` + // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. + WinRM *WinRMConfiguration `json:"winRM,omitempty"` +} + +// WindowsParameters input for InstallPatches on a Windows VM, as directly received by the API +type WindowsParameters struct { + // ClassificationsToInclude - The update classifications to select when installing patches for Windows. + ClassificationsToInclude *[]VMGuestPatchClassificationWindows `json:"classificationsToInclude,omitempty"` + // KbNumbersToInclude - Kbs to include in the patch operation + KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` + // KbNumbersToExclude - Kbs to exclude in the patch operation + KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` + // ExcludeKbsRequiringReboot - Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. + ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` + // MaxPatchPublishDate - This is used to install patches that were published on or before this given max published date. + MaxPatchPublishDate *date.Time `json:"maxPatchPublishDate,omitempty"` +} + +// WinRMConfiguration describes Windows Remote Management configuration of the VM +type WinRMConfiguration struct { + // Listeners - The list of Windows Remote Management listeners + Listeners *[]WinRMListener `json:"listeners,omitempty"` +} + +// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener +type WinRMListener struct { + // Protocol - Specifies the protocol of WinRM listener.

    Possible values are:
    **http**

    **https**. Possible values include: 'ProtocolTypesHTTP', 'ProtocolTypesHTTPS' + Protocol ProtocolTypes `json:"protocol,omitempty"` + // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

    {
    "data":"",
    "dataType":"pfx",
    "password":""
    }
    To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + CertificateURL *string `json:"certificateUrl,omitempty"` +} diff --git a/services/compute/mgmt/2021-08-01/compute/operations.go b/services/compute/mgmt/2021-08-01/compute/operations.go new file mode 100644 index 000000000000..b76ee91bfdf0 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/operations.go @@ -0,0 +1,98 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the compute Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of compute operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Compute/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/proximityplacementgroups.go b/services/compute/mgmt/2021-08-01/compute/proximityplacementgroups.go new file mode 100644 index 000000000000..8144933b91db --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/proximityplacementgroups.go @@ -0,0 +1,575 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ProximityPlacementGroupsClient is the compute Client +type ProximityPlacementGroupsClient struct { + BaseClient +} + +// NewProximityPlacementGroupsClient creates an instance of the ProximityPlacementGroupsClient client. +func NewProximityPlacementGroupsClient(subscriptionID string) ProximityPlacementGroupsClient { + return NewProximityPlacementGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProximityPlacementGroupsClientWithBaseURI creates an instance of the ProximityPlacementGroupsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewProximityPlacementGroupsClientWithBaseURI(baseURI string, subscriptionID string) ProximityPlacementGroupsClient { + return ProximityPlacementGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a proximity placement group. +// Parameters: +// resourceGroupName - the name of the resource group. +// proximityPlacementGroupName - the name of the proximity placement group. +// parameters - parameters supplied to the Create Proximity Placement Group operation. +func (client ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (result ProximityPlacementGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProximityPlacementGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a proximity placement group. +// Parameters: +// resourceGroupName - the name of the resource group. +// proximityPlacementGroupName - the name of the proximity placement group. +func (client ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, proximityPlacementGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProximityPlacementGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about a proximity placement group . +// Parameters: +// resourceGroupName - the name of the resource group. +// proximityPlacementGroupName - the name of the proximity placement group. +// includeColocationStatus - includeColocationStatus=true enables fetching the colocation status of all the +// resources in the proximity placement group. +func (client ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (result ProximityPlacementGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, proximityPlacementGroupName, includeColocationStatus) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProximityPlacementGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(includeColocationStatus) > 0 { + queryParameters["includeColocationStatus"] = autorest.Encode("query", includeColocationStatus) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all proximity placement groups in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ppglr.Response.Response != nil { + sc = result.ppglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ppglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ppglr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ProximityPlacementGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ProximityPlacementGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { + req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProximityPlacementGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription lists all proximity placement groups in a subscription. +func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Context) (result ProximityPlacementGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.ppglr.Response.Response != nil { + sc = result.ppglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.ppglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.ppglr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ProximityPlacementGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ProximityPlacementGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { + req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProximityPlacementGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result ProximityPlacementGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update update a proximity placement group. +// Parameters: +// resourceGroupName - the name of the resource group. +// proximityPlacementGroupName - the name of the proximity placement group. +// parameters - parameters supplied to the Update Proximity Placement Group operation. +func (client ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (result ProximityPlacementGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ProximityPlacementGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/resourceskus.go b/services/compute/mgmt/2021-08-01/compute/resourceskus.go new file mode 100644 index 000000000000..35266973811b --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/resourceskus.go @@ -0,0 +1,153 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceSkusClient is the compute Client +type ResourceSkusClient struct { + BaseClient +} + +// NewResourceSkusClient creates an instance of the ResourceSkusClient client. +func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { + return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { + return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets the list of Microsoft.Compute SKUs available for your Subscription. +// Parameters: +// filter - the filter to apply on the operation. Only **location** filter is supported currently. +// includeExtendedLocations - to Include Extended Locations information or not in the response. +func (client ResourceSkusClient) List(ctx context.Context, filter string, includeExtendedLocations string) (result ResourceSkusResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") + defer func() { + sc := -1 + if result.rsr.Response.Response != nil { + sc = result.rsr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter, includeExtendedLocations) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rsr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request") + return + } + + result.rsr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") + return + } + if result.rsr.hasNextLink() && result.rsr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ResourceSkusClient) ListPreparer(ctx context.Context, filter string, includeExtendedLocations string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(includeExtendedLocations) > 0 { + queryParameters["includeExtendedLocations"] = autorest.Encode("query", includeExtendedLocations) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) { + req, err := lastResults.resourceSkusResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceSkusClient) ListComplete(ctx context.Context, filter string, includeExtendedLocations string) (result ResourceSkusResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter, includeExtendedLocations) + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/restorepointcollections.go b/services/compute/mgmt/2021-08-01/compute/restorepointcollections.go new file mode 100644 index 000000000000..ea9d27484cef --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/restorepointcollections.go @@ -0,0 +1,582 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorePointCollectionsClient is the compute Client +type RestorePointCollectionsClient struct { + BaseClient +} + +// NewRestorePointCollectionsClient creates an instance of the RestorePointCollectionsClient client. +func NewRestorePointCollectionsClient(subscriptionID string) RestorePointCollectionsClient { + return NewRestorePointCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorePointCollectionsClientWithBaseURI creates an instance of the RestorePointCollectionsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewRestorePointCollectionsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointCollectionsClient { + return RestorePointCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update the restore point collection. Please refer to +// https://aka.ms/RestorePoints for more details. When updating a restore point collection, only tags may be modified. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection. +// parameters - parameters supplied to the Create or Update restore point collection operation. +func (client RestorePointCollectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection) (result RestorePointCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, restorePointCollectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RestorePointCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RestorePointCollectionsClient) CreateOrUpdateResponder(resp *http.Response) (result RestorePointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the restore point collection. This operation will also delete all the contained +// restore points. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the Restore Point Collection. +func (client RestorePointCollectionsClient) Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string) (result RestorePointCollectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, restorePointCollectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RestorePointCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointCollectionsClient) DeleteSender(req *http.Request) (future RestorePointCollectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RestorePointCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation to get the restore point collection. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection. +// expand - the expand expression to apply on the operation. If expand=restorePoints, server will return all +// contained restore points in the restorePointCollection. +func (client RestorePointCollectionsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, expand RestorePointCollectionExpandOptions) (result RestorePointCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RestorePointCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, expand RestorePointCollectionExpandOptions) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointCollectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RestorePointCollectionsClient) GetResponder(resp *http.Response) (result RestorePointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of restore point collections in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client RestorePointCollectionsClient) List(ctx context.Context, resourceGroupName string) (result RestorePointCollectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.List") + defer func() { + sc := -1 + if result.rpclr.Response.Response != nil { + sc = result.rpclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rpclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", resp, "Failure sending request") + return + } + + result.rpclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "List", resp, "Failure responding to request") + return + } + if result.rpclr.hasNextLink() && result.rpclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RestorePointCollectionsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointCollectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RestorePointCollectionsClient) ListResponder(resp *http.Response) (result RestorePointCollectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client RestorePointCollectionsClient) listNextResults(ctx context.Context, lastResults RestorePointCollectionListResult) (result RestorePointCollectionListResult, err error) { + req, err := lastResults.restorePointCollectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RestorePointCollectionsClient) ListComplete(ctx context.Context, resourceGroupName string) (result RestorePointCollectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListAll gets the list of restore point collections in the subscription. Use nextLink property in the response to get +// the next page of restore point collections. Do this till nextLink is not null to fetch all the restore point +// collections. +func (client RestorePointCollectionsClient) ListAll(ctx context.Context) (result RestorePointCollectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.ListAll") + defer func() { + sc := -1 + if result.rpclr.Response.Response != nil { + sc = result.rpclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.rpclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", resp, "Failure sending request") + return + } + + result.rpclr, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.rpclr.hasNextLink() && result.rpclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client RestorePointCollectionsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/restorePointCollections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointCollectionsClient) ListAllSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client RestorePointCollectionsClient) ListAllResponder(resp *http.Response) (result RestorePointCollectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client RestorePointCollectionsClient) listAllNextResults(ctx context.Context, lastResults RestorePointCollectionListResult) (result RestorePointCollectionListResult, err error) { + req, err := lastResults.restorePointCollectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client RestorePointCollectionsClient) ListAllComplete(ctx context.Context) (result RestorePointCollectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.ListAll") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAll(ctx) + return +} + +// Update the operation to update the restore point collection. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection. +// parameters - parameters supplied to the Update restore point collection operation. +func (client RestorePointCollectionsClient) Update(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate) (result RestorePointCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointCollectionsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, restorePointCollectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointCollectionsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RestorePointCollectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, parameters RestorePointCollectionUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointCollectionsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RestorePointCollectionsClient) UpdateResponder(resp *http.Response) (result RestorePointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/restorepoints.go b/services/compute/mgmt/2021-08-01/compute/restorepoints.go new file mode 100644 index 000000000000..ad79c4b0eec5 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/restorepoints.go @@ -0,0 +1,297 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RestorePointsClient is the compute Client +type RestorePointsClient struct { + BaseClient +} + +// NewRestorePointsClient creates an instance of the RestorePointsClient client. +func NewRestorePointsClient(subscriptionID string) RestorePointsClient { + return NewRestorePointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRestorePointsClientWithBaseURI creates an instance of the RestorePointsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRestorePointsClientWithBaseURI(baseURI string, subscriptionID string) RestorePointsClient { + return RestorePointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create the operation to create the restore point. Updating properties of an existing restore point is not allowed +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection. +// restorePointName - the name of the restore point. +// parameters - parameters supplied to the Create restore point operation. +func (client RestorePointsClient) Create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint) (result RestorePointsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.RestorePointProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RestorePointProperties.SourceMetadata.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("compute.RestorePointsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client RestorePointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "restorePointName": autorest.Encode("path", restorePointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointsClient) CreateSender(req *http.Request) (future RestorePointsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client RestorePointsClient) CreateResponder(resp *http.Response) (result RestorePoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the restore point. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the Restore Point Collection. +// restorePointName - the name of the restore point. +func (client RestorePointsClient) Delete(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (result RestorePointsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RestorePointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "restorePointName": autorest.Encode("path", restorePointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointsClient) DeleteSender(req *http.Request) (future RestorePointsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RestorePointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation to get the restore point. +// Parameters: +// resourceGroupName - the name of the resource group. +// restorePointCollectionName - the name of the restore point collection. +// restorePointName - the name of the restore point. +func (client RestorePointsClient) Get(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (result RestorePoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RestorePointsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, restorePointCollectionName, restorePointName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.RestorePointsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RestorePointsClient) GetPreparer(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "restorePointCollectionName": autorest.Encode("path", restorePointCollectionName), + "restorePointName": autorest.Encode("path", restorePointName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RestorePointsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RestorePointsClient) GetResponder(resp *http.Response) (result RestorePoint, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/sharedgalleries.go b/services/compute/mgmt/2021-08-01/compute/sharedgalleries.go new file mode 100644 index 000000000000..261ed0770ac0 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/sharedgalleries.go @@ -0,0 +1,227 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SharedGalleriesClient is the compute Client +type SharedGalleriesClient struct { + BaseClient +} + +// NewSharedGalleriesClient creates an instance of the SharedGalleriesClient client. +func NewSharedGalleriesClient(subscriptionID string) SharedGalleriesClient { + return NewSharedGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSharedGalleriesClientWithBaseURI creates an instance of the SharedGalleriesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSharedGalleriesClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleriesClient { + return SharedGalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a shared gallery by subscription id or tenant id. +// Parameters: +// location - resource location. +// galleryUniqueName - the unique name of the Shared Gallery. +func (client SharedGalleriesClient) Get(ctx context.Context, location string, galleryUniqueName string) (result SharedGallery, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, galleryUniqueName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SharedGalleriesClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryUniqueName": autorest.Encode("path", galleryUniqueName), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SharedGalleriesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SharedGalleriesClient) GetResponder(resp *http.Response) (result SharedGallery, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list shared galleries by subscription id or tenant id. +// Parameters: +// location - resource location. +// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. +func (client SharedGalleriesClient) List(ctx context.Context, location string, sharedTo SharedToValues) (result SharedGalleryListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.List") + defer func() { + sc := -1 + if result.sgl.Response.Response != nil { + sc = result.sgl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location, sharedTo) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sgl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", resp, "Failure sending request") + return + } + + result.sgl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "List", resp, "Failure responding to request") + return + } + if result.sgl.hasNextLink() && result.sgl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SharedGalleriesClient) ListPreparer(ctx context.Context, location string, sharedTo SharedToValues) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(sharedTo)) > 0 { + queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SharedGalleriesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SharedGalleriesClient) ListResponder(resp *http.Response) (result SharedGalleryList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SharedGalleriesClient) listNextResults(ctx context.Context, lastResults SharedGalleryList) (result SharedGalleryList, err error) { + req, err := lastResults.sharedGalleryListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharedGalleriesClient) ListComplete(ctx context.Context, location string, sharedTo SharedToValues) (result SharedGalleryListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleriesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location, sharedTo) + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/sharedgalleryimages.go b/services/compute/mgmt/2021-08-01/compute/sharedgalleryimages.go new file mode 100644 index 000000000000..5378b4f89811 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/sharedgalleryimages.go @@ -0,0 +1,233 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SharedGalleryImagesClient is the compute Client +type SharedGalleryImagesClient struct { + BaseClient +} + +// NewSharedGalleryImagesClient creates an instance of the SharedGalleryImagesClient client. +func NewSharedGalleryImagesClient(subscriptionID string) SharedGalleryImagesClient { + return NewSharedGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSharedGalleryImagesClientWithBaseURI creates an instance of the SharedGalleryImagesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewSharedGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleryImagesClient { + return SharedGalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a shared gallery image by subscription id or tenant id. +// Parameters: +// location - resource location. +// galleryUniqueName - the unique name of the Shared Gallery. +// galleryImageName - the name of the Shared Gallery Image Definition from which the Image Versions are to be +// listed. +func (client SharedGalleryImagesClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string) (result SharedGalleryImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, galleryUniqueName, galleryImageName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SharedGalleryImagesClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryUniqueName": autorest.Encode("path", galleryUniqueName), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SharedGalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SharedGalleryImagesClient) GetResponder(resp *http.Response) (result SharedGalleryImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list shared gallery images by subscription id or tenant id. +// Parameters: +// location - resource location. +// galleryUniqueName - the unique name of the Shared Gallery. +// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. +func (client SharedGalleryImagesClient) List(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (result SharedGalleryImageListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.List") + defer func() { + sc := -1 + if result.sgil.Response.Response != nil { + sc = result.sgil.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location, galleryUniqueName, sharedTo) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sgil.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", resp, "Failure sending request") + return + } + + result.sgil, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "List", resp, "Failure responding to request") + return + } + if result.sgil.hasNextLink() && result.sgil.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SharedGalleryImagesClient) ListPreparer(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryUniqueName": autorest.Encode("path", galleryUniqueName), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(sharedTo)) > 0 { + queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SharedGalleryImagesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SharedGalleryImagesClient) ListResponder(resp *http.Response) (result SharedGalleryImageList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SharedGalleryImagesClient) listNextResults(ctx context.Context, lastResults SharedGalleryImageList) (result SharedGalleryImageList, err error) { + req, err := lastResults.sharedGalleryImageListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImagesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharedGalleryImagesClient) ListComplete(ctx context.Context, location string, galleryUniqueName string, sharedTo SharedToValues) (result SharedGalleryImageListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImagesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location, galleryUniqueName, sharedTo) + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/sharedgalleryimageversions.go b/services/compute/mgmt/2021-08-01/compute/sharedgalleryimageversions.go new file mode 100644 index 000000000000..325d3f48b3e9 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/sharedgalleryimageversions.go @@ -0,0 +1,240 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SharedGalleryImageVersionsClient is the compute Client +type SharedGalleryImageVersionsClient struct { + BaseClient +} + +// NewSharedGalleryImageVersionsClient creates an instance of the SharedGalleryImageVersionsClient client. +func NewSharedGalleryImageVersionsClient(subscriptionID string) SharedGalleryImageVersionsClient { + return NewSharedGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSharedGalleryImageVersionsClientWithBaseURI creates an instance of the SharedGalleryImageVersionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSharedGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) SharedGalleryImageVersionsClient { + return SharedGalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a shared gallery image version by subscription id or tenant id. +// Parameters: +// location - resource location. +// galleryUniqueName - the unique name of the Shared Gallery. +// galleryImageName - the name of the Shared Gallery Image Definition from which the Image Versions are to be +// listed. +// galleryImageVersionName - the name of the gallery image version to be created. Needs to follow semantic +// version name pattern: The allowed characters are digit and period. Digits must be within the range of a +// 32-bit integer. Format: .. +func (client SharedGalleryImageVersionsClient) Get(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string) (result SharedGalleryImageVersion, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, galleryUniqueName, galleryImageName, galleryImageVersionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SharedGalleryImageVersionsClient) GetPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), + "galleryUniqueName": autorest.Encode("path", galleryUniqueName), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SharedGalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SharedGalleryImageVersionsClient) GetResponder(resp *http.Response) (result SharedGalleryImageVersion, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list shared gallery image versions by subscription id or tenant id. +// Parameters: +// location - resource location. +// galleryUniqueName - the unique name of the Shared Gallery. +// galleryImageName - the name of the Shared Gallery Image Definition from which the Image Versions are to be +// listed. +// sharedTo - the query parameter to decide what shared galleries to fetch when doing listing operations. +func (client SharedGalleryImageVersionsClient) List(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (result SharedGalleryImageVersionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.List") + defer func() { + sc := -1 + if result.sgivl.Response.Response != nil { + sc = result.sgivl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location, galleryUniqueName, galleryImageName, sharedTo) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sgivl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", resp, "Failure sending request") + return + } + + result.sgivl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "List", resp, "Failure responding to request") + return + } + if result.sgivl.hasNextLink() && result.sgivl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SharedGalleryImageVersionsClient) ListPreparer(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "galleryImageName": autorest.Encode("path", galleryImageName), + "galleryUniqueName": autorest.Encode("path", galleryUniqueName), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(sharedTo)) > 0 { + queryParameters["sharedTo"] = autorest.Encode("query", sharedTo) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/sharedGalleries/{galleryUniqueName}/images/{galleryImageName}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SharedGalleryImageVersionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SharedGalleryImageVersionsClient) ListResponder(resp *http.Response) (result SharedGalleryImageVersionList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SharedGalleryImageVersionsClient) listNextResults(ctx context.Context, lastResults SharedGalleryImageVersionList) (result SharedGalleryImageVersionList, err error) { + req, err := lastResults.sharedGalleryImageVersionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SharedGalleryImageVersionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharedGalleryImageVersionsClient) ListComplete(ctx context.Context, location string, galleryUniqueName string, galleryImageName string, sharedTo SharedToValues) (result SharedGalleryImageVersionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedGalleryImageVersionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location, galleryUniqueName, galleryImageName, sharedTo) + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/snapshots.go b/services/compute/mgmt/2021-08-01/compute/snapshots.go new file mode 100644 index 000000000000..1dc49461accb --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/snapshots.go @@ -0,0 +1,778 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SnapshotsClient is the compute Client +type SnapshotsClient struct { + BaseClient +} + +// NewSnapshotsClient creates an instance of the SnapshotsClient client. +func NewSnapshotsClient(subscriptionID string) SnapshotsClient { + return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { + return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a snapshot. +// Parameters: +// resourceGroupName - the name of the resource group. +// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot +// is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 +// characters. +// snapshot - snapshot object supplied in the body of the Put disk operation. +func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: snapshot, + Constraints: []validation.Constraint{{Target: "snapshot.SnapshotProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.PurchasePlan", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.PurchasePlan.Publisher", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "snapshot.SnapshotProperties.PurchasePlan.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "snapshot.SnapshotProperties.PurchasePlan.Product", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "snapshot.SnapshotProperties.CreationData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "snapshot.SnapshotProperties.CreationData.GalleryImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.GalleryImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + snapshot.ManagedBy = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(snapshot), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a snapshot. +// Parameters: +// resourceGroupName - the name of the resource group. +// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot +// is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 +// characters. +func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets information about a snapshot. +// Parameters: +// resourceGroupName - the name of the resource group. +// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot +// is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 +// characters. +func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GrantAccess grants access to a snapshot. +// Parameters: +// resourceGroupName - the name of the resource group. +// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot +// is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 +// characters. +// grantAccessData - access data object supplied in the body of the get snapshot access operation. +func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: grantAccessData, + Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.SnapshotsClient", "GrantAccess", err.Error()) + } + + req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request") + return + } + + result, err = client.GrantAccessSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request") + return + } + + return +} + +// GrantAccessPreparer prepares the GrantAccess request. +func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), + autorest.WithJSON(grantAccessData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GrantAccessSender sends the GrantAccess request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GrantAccessResponder handles the response to the GrantAccess request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists snapshots under a subscription. +func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request") + return + } + + result.sl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { + req, err := lastResults.snapshotListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists snapshots under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.sl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { + req, err := lastResults.snapshotListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// RevokeAccess revokes access to a snapshot. +// Parameters: +// resourceGroupName - the name of the resource group. +// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot +// is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 +// characters. +func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request") + return + } + + result, err = client.RevokeAccessSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request") + return + } + + return +} + +// RevokeAccessPreparer prepares the RevokeAccess request. +func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevokeAccessSender sends the RevokeAccess request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RevokeAccessResponder handles the response to the RevokeAccess request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates (patches) a snapshot. +// Parameters: +// resourceGroupName - the name of the resource group. +// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot +// is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The max name length is 80 +// characters. +// snapshot - snapshot object supplied in the body of the Patch snapshot operation. +func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(snapshot), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/sshpublickeys.go b/services/compute/mgmt/2021-08-01/compute/sshpublickeys.go new file mode 100644 index 000000000000..896ec1f1edbf --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/sshpublickeys.go @@ -0,0 +1,649 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SSHPublicKeysClient is the compute Client +type SSHPublicKeysClient struct { + BaseClient +} + +// NewSSHPublicKeysClient creates an instance of the SSHPublicKeysClient client. +func NewSSHPublicKeysClient(subscriptionID string) SSHPublicKeysClient { + return NewSSHPublicKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSSHPublicKeysClientWithBaseURI creates an instance of the SSHPublicKeysClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSSHPublicKeysClientWithBaseURI(baseURI string, subscriptionID string) SSHPublicKeysClient { + return SSHPublicKeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a new SSH public key resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// SSHPublicKeyName - the name of the SSH public key. +// parameters - parameters supplied to create the SSH public key. +func (client SSHPublicKeysClient) Create(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (result SSHPublicKeyResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SSHPublicKeysClient) CreatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SSHPublicKeysClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SSHPublicKeysClient) CreateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an SSH public key. +// Parameters: +// resourceGroupName - the name of the resource group. +// SSHPublicKeyName - the name of the SSH public key. +func (client SSHPublicKeysClient) Delete(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, SSHPublicKeyName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SSHPublicKeysClient) DeletePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SSHPublicKeysClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SSHPublicKeysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateKeyPair generates and returns a public/private key pair and populates the SSH public key resource with the +// public key. The length of the key will be 3072 bits. This operation can only be performed once per SSH public key +// resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// SSHPublicKeyName - the name of the SSH public key. +func (client SSHPublicKeysClient) GenerateKeyPair(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyGenerateKeyPairResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.GenerateKeyPair") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GenerateKeyPairPreparer(ctx, resourceGroupName, SSHPublicKeyName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateKeyPairSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure sending request") + return + } + + result, err = client.GenerateKeyPairResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "GenerateKeyPair", resp, "Failure responding to request") + return + } + + return +} + +// GenerateKeyPairPreparer prepares the GenerateKeyPair request. +func (client SSHPublicKeysClient) GenerateKeyPairPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}/generateKeyPair", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateKeyPairSender sends the GenerateKeyPair request. The method will close the +// http.Response Body if it receives an error. +func (client SSHPublicKeysClient) GenerateKeyPairSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateKeyPairResponder handles the response to the GenerateKeyPair request. The method always +// closes the http.Response Body. +func (client SSHPublicKeysClient) GenerateKeyPairResponder(resp *http.Response) (result SSHPublicKeyGenerateKeyPairResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieves information about an SSH public key. +// Parameters: +// resourceGroupName - the name of the resource group. +// SSHPublicKeyName - the name of the SSH public key. +func (client SSHPublicKeysClient) Get(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (result SSHPublicKeyResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, SSHPublicKeyName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SSHPublicKeysClient) GetPreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SSHPublicKeysClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SSHPublicKeysClient) GetResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all of the SSH public keys in the specified resource group. Use the nextLink property in +// the response to get the next page of SSH public keys. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client SSHPublicKeysClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.spkglr.Response.Response != nil { + sc = result.spkglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.spkglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.spkglr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SSHPublicKeysClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SSHPublicKeysClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client SSHPublicKeysClient) ListByResourceGroupResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client SSHPublicKeysClient) listByResourceGroupNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { + req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SSHPublicKeysClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SSHPublicKeysGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription lists all of the SSH public keys in the subscription. Use the nextLink property in the response +// to get the next page of SSH public keys. +func (client SSHPublicKeysClient) ListBySubscription(ctx context.Context) (result SSHPublicKeysGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") + defer func() { + sc := -1 + if result.spkglr.Response.Response != nil { + sc = result.spkglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.spkglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.spkglr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.spkglr.hasNextLink() && result.spkglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client SSHPublicKeysClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/sshPublicKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client SSHPublicKeysClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client SSHPublicKeysClient) ListBySubscriptionResponder(resp *http.Response) (result SSHPublicKeysGroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client SSHPublicKeysClient) listBySubscriptionNextResults(ctx context.Context, lastResults SSHPublicKeysGroupListResult) (result SSHPublicKeysGroupListResult, err error) { + req, err := lastResults.sSHPublicKeysGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client SSHPublicKeysClient) ListBySubscriptionComplete(ctx context.Context) (result SSHPublicKeysGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update updates a new SSH public key resource. +// Parameters: +// resourceGroupName - the name of the resource group. +// SSHPublicKeyName - the name of the SSH public key. +// parameters - parameters supplied to update the SSH public key. +func (client SSHPublicKeysClient) Update(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (result SSHPublicKeyResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SSHPublicKeysClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, SSHPublicKeyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SSHPublicKeysClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SSHPublicKeysClient) UpdatePreparer(ctx context.Context, resourceGroupName string, SSHPublicKeyName string, parameters SSHPublicKeyUpdateResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sshPublicKeyName": autorest.Encode("path", SSHPublicKeyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SSHPublicKeysClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SSHPublicKeysClient) UpdateResponder(resp *http.Response) (result SSHPublicKeyResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/usage.go b/services/compute/mgmt/2021-08-01/compute/usage.go new file mode 100644 index 000000000000..ab20765aebf9 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/usage.go @@ -0,0 +1,155 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UsageClient is the compute Client +type UsageClient struct { + BaseClient +} + +// NewUsageClient creates an instance of the UsageClient client. +func NewUsageClient(subscriptionID string) UsageClient { + return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient { + return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets, for the specified location, the current compute resource usage information as well as the limits for +// compute resources under the subscription. +// Parameters: +// location - the location for which resource usage is queried. +func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") + defer func() { + sc := -1 + if result.lur.Response.Response != nil { + sc = result.lur.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.UsageClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lur.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request") + return + } + + result.lur, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") + return + } + if result.lur.hasNextLink() && result.lur.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { + req, err := lastResults.listUsagesResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location) + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/version.go b/services/compute/mgmt/2021-08-01/compute/version.go new file mode 100644 index 000000000000..b70229606e64 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/version.go @@ -0,0 +1,19 @@ +package compute + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " compute/2021-08-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachineextensionimages.go b/services/compute/mgmt/2021-08-01/compute/virtualmachineextensionimages.go new file mode 100644 index 000000000000..e359238e21cb --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachineextensionimages.go @@ -0,0 +1,270 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineExtensionImagesClient is the compute Client +type VirtualMachineExtensionImagesClient struct { + BaseClient +} + +// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client. +func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { + return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { + return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a virtual machine extension image. +// Parameters: +// location - the name of a supported Azure region. +func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "publisherName": autorest.Encode("path", publisherName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "type": autorest.Encode("path", typeParameter), + "version": autorest.Encode("path", version), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListTypes gets a list of virtual machine extension image types. +// Parameters: +// location - the name of a supported Azure region. +func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListTypes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListTypesPreparer(ctx, location, publisherName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request") + return + } + + resp, err := client.ListTypesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request") + return + } + + result, err = client.ListTypesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request") + return + } + + return +} + +// ListTypesPreparer prepares the ListTypes request. +func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "publisherName": autorest.Encode("path", publisherName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTypesSender sends the ListTypes request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTypesResponder handles the response to the ListTypes request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListVersions gets a list of virtual machine extension image versions. +// Parameters: +// location - the name of a supported Azure region. +// filter - the filter to apply on the operation. +func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListVersions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request") + return + } + + resp, err := client.ListVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request") + return + } + + result, err = client.ListVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request") + return + } + + return +} + +// ListVersionsPreparer prepares the ListVersions request. +func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "publisherName": autorest.Encode("path", publisherName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "type": autorest.Encode("path", typeParameter), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListVersionsSender sends the ListVersions request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListVersionsResponder handles the response to the ListVersions request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachineextensions.go b/services/compute/mgmt/2021-08-01/compute/virtualmachineextensions.go new file mode 100644 index 000000000000..a73c28d02725 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachineextensions.go @@ -0,0 +1,442 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineExtensionsClient is the compute Client +type VirtualMachineExtensionsClient struct { + BaseClient +} + +// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client. +func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { + return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { + return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update the extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the extension should be created or updated. +// VMExtensionName - the name of the virtual machine extension. +// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. +func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the extension should be deleted. +// VMExtensionName - the name of the virtual machine extension. +func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation to get the extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine containing the extension. +// VMExtensionName - the name of the virtual machine extension. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List the operation to get all extensions of a Virtual Machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine containing the extension. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, VMName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the extension should be updated. +// VMExtensionName - the name of the virtual machine extension. +// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. +func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachineimages.go b/services/compute/mgmt/2021-08-01/compute/virtualmachineimages.go new file mode 100644 index 000000000000..95b6c52e34af --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachineimages.go @@ -0,0 +1,432 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineImagesClient is the compute Client +type VirtualMachineImagesClient struct { + BaseClient +} + +// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client. +func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { + return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { + return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a virtual machine image. +// Parameters: +// location - the name of a supported Azure region. +// publisherName - a valid image publisher. +// offer - a valid image publisher offer. +// skus - a valid image SKU. +// version - a valid image SKU version. +func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "offer": autorest.Encode("path", offer), + "publisherName": autorest.Encode("path", publisherName), + "skus": autorest.Encode("path", skus), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "version": autorest.Encode("path", version), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. +// Parameters: +// location - the name of a supported Azure region. +// publisherName - a valid image publisher. +// offer - a valid image publisher offer. +// skus - a valid image SKU. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, expand, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "offer": autorest.Encode("path", offer), + "publisherName": autorest.Encode("path", publisherName), + "skus": autorest.Encode("path", skus), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOffers gets a list of virtual machine image offers for the specified location and publisher. +// Parameters: +// location - the name of a supported Azure region. +// publisherName - a valid image publisher. +func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListOffers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOffersPreparer(ctx, location, publisherName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request") + return + } + + resp, err := client.ListOffersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request") + return + } + + result, err = client.ListOffersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request") + return + } + + return +} + +// ListOffersPreparer prepares the ListOffers request. +func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "publisherName": autorest.Encode("path", publisherName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOffersSender sends the ListOffers request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOffersResponder handles the response to the ListOffers request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPublishers gets a list of virtual machine image publishers for the specified Azure location. +// Parameters: +// location - the name of a supported Azure region. +func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListPublishers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPublishersPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request") + return + } + + resp, err := client.ListPublishersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request") + return + } + + result, err = client.ListPublishersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request") + return + } + + return +} + +// ListPublishersPreparer prepares the ListPublishers request. +func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublishersSender sends the ListPublishers request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPublishersResponder handles the response to the ListPublishers request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. +// Parameters: +// location - the name of a supported Azure region. +// publisherName - a valid image publisher. +// offer - a valid image publisher offer. +func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListSkus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSkusPreparer(ctx, location, publisherName, offer) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request") + return + } + + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request") + return + } + + return +} + +// ListSkusPreparer prepares the ListSkus request. +func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "offer": autorest.Encode("path", offer), + "publisherName": autorest.Encode("path", publisherName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusSender sends the ListSkus request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSkusResponder handles the response to the ListSkus request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachineimagesedgezone.go b/services/compute/mgmt/2021-08-01/compute/virtualmachineimagesedgezone.go new file mode 100644 index 000000000000..8fb48bf680d2 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachineimagesedgezone.go @@ -0,0 +1,445 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineImagesEdgeZoneClient is the compute Client +type VirtualMachineImagesEdgeZoneClient struct { + BaseClient +} + +// NewVirtualMachineImagesEdgeZoneClient creates an instance of the VirtualMachineImagesEdgeZoneClient client. +func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string) VirtualMachineImagesEdgeZoneClient { + return NewVirtualMachineImagesEdgeZoneClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineImagesEdgeZoneClientWithBaseURI creates an instance of the VirtualMachineImagesEdgeZoneClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewVirtualMachineImagesEdgeZoneClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesEdgeZoneClient { + return VirtualMachineImagesEdgeZoneClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a virtual machine image in an edge zone. +// Parameters: +// location - the name of a supported Azure region. +// edgeZone - the name of the edge zone. +// publisherName - a valid image publisher. +// offer - a valid image publisher offer. +// skus - a valid image SKU. +// version - a valid image SKU version. +func (client VirtualMachineImagesEdgeZoneClient) Get(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, edgeZone, publisherName, offer, skus, version) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineImagesEdgeZoneClient) GetPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, version string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "edgeZone": autorest.Encode("path", edgeZone), + "location": autorest.Encode("path", location), + "offer": autorest.Encode("path", offer), + "publisherName": autorest.Encode("path", publisherName), + "skus": autorest.Encode("path", skus), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "version": autorest.Encode("path", version), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesEdgeZoneClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesEdgeZoneClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and +// SKU. +// Parameters: +// location - the name of a supported Azure region. +// edgeZone - the name of the edge zone. +// publisherName - a valid image publisher. +// offer - a valid image publisher offer. +// skus - a valid image SKU. +// expand - the expand expression to apply on the operation. +// top - an integer value specifying the number of images to return that matches supplied values. +// orderby - specifies the order of the results returned. Formatted as an OData query. +func (client VirtualMachineImagesEdgeZoneClient) List(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, location, edgeZone, publisherName, offer, skus, expand, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineImagesEdgeZoneClient) ListPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "edgeZone": autorest.Encode("path", edgeZone), + "location": autorest.Encode("path", location), + "offer": autorest.Encode("path", offer), + "publisherName": autorest.Encode("path", publisherName), + "skus": autorest.Encode("path", skus), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesEdgeZoneClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesEdgeZoneClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListOffers gets a list of virtual machine image offers for the specified location, edge zone and publisher. +// Parameters: +// location - the name of a supported Azure region. +// edgeZone - the name of the edge zone. +// publisherName - a valid image publisher. +func (client VirtualMachineImagesEdgeZoneClient) ListOffers(ctx context.Context, location string, edgeZone string, publisherName string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListOffers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOffersPreparer(ctx, location, edgeZone, publisherName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", nil, "Failure preparing request") + return + } + + resp, err := client.ListOffersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", resp, "Failure sending request") + return + } + + result, err = client.ListOffersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListOffers", resp, "Failure responding to request") + return + } + + return +} + +// ListOffersPreparer prepares the ListOffers request. +func (client VirtualMachineImagesEdgeZoneClient) ListOffersPreparer(ctx context.Context, location string, edgeZone string, publisherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "edgeZone": autorest.Encode("path", edgeZone), + "location": autorest.Encode("path", location), + "publisherName": autorest.Encode("path", publisherName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOffersSender sends the ListOffers request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesEdgeZoneClient) ListOffersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOffersResponder handles the response to the ListOffers request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesEdgeZoneClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPublishers gets a list of virtual machine image publishers for the specified Azure location and edge zone. +// Parameters: +// location - the name of a supported Azure region. +// edgeZone - the name of the edge zone. +func (client VirtualMachineImagesEdgeZoneClient) ListPublishers(ctx context.Context, location string, edgeZone string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListPublishers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPublishersPreparer(ctx, location, edgeZone) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", nil, "Failure preparing request") + return + } + + resp, err := client.ListPublishersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", resp, "Failure sending request") + return + } + + result, err = client.ListPublishersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListPublishers", resp, "Failure responding to request") + return + } + + return +} + +// ListPublishersPreparer prepares the ListPublishers request. +func (client VirtualMachineImagesEdgeZoneClient) ListPublishersPreparer(ctx context.Context, location string, edgeZone string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "edgeZone": autorest.Encode("path", edgeZone), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublishersSender sends the ListPublishers request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesEdgeZoneClient) ListPublishersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPublishersResponder handles the response to the ListPublishers request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesEdgeZoneClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSkus gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. +// Parameters: +// location - the name of a supported Azure region. +// edgeZone - the name of the edge zone. +// publisherName - a valid image publisher. +// offer - a valid image publisher offer. +func (client VirtualMachineImagesEdgeZoneClient) ListSkus(ctx context.Context, location string, edgeZone string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesEdgeZoneClient.ListSkus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSkusPreparer(ctx, location, edgeZone, publisherName, offer) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", resp, "Failure sending request") + return + } + + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesEdgeZoneClient", "ListSkus", resp, "Failure responding to request") + return + } + + return +} + +// ListSkusPreparer prepares the ListSkus request. +func (client VirtualMachineImagesEdgeZoneClient) ListSkusPreparer(ctx context.Context, location string, edgeZone string, publisherName string, offer string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "edgeZone": autorest.Encode("path", edgeZone), + "location": autorest.Encode("path", location), + "offer": autorest.Encode("path", offer), + "publisherName": autorest.Encode("path", publisherName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/edgeZones/{edgeZone}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusSender sends the ListSkus request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineImagesEdgeZoneClient) ListSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSkusResponder handles the response to the ListSkus request. The method always +// closes the http.Response Body. +func (client VirtualMachineImagesEdgeZoneClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachineruncommands.go b/services/compute/mgmt/2021-08-01/compute/virtualmachineruncommands.go new file mode 100644 index 000000000000..5a2f07fafb75 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachineruncommands.go @@ -0,0 +1,689 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineRunCommandsClient is the compute Client +type VirtualMachineRunCommandsClient struct { + BaseClient +} + +// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client. +func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient { + return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient { + return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the run command should be created or updated. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Create Virtual Machine RunCommand operation. +func (client VirtualMachineRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineRunCommandsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the run command should be deleted. +// runCommandName - the name of the virtual machine run command. +func (client VirtualMachineRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (result VirtualMachineRunCommandsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, runCommandName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineRunCommandsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets specific run command for a subscription in a location. +// Parameters: +// location - the location upon which run commands is queried. +// commandID - the command id. +func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, location, commandID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "commandId": autorest.Encode("path", commandID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByVirtualMachine the operation to get the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine containing the run command. +// runCommandName - the name of the virtual machine run command. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.GetByVirtualMachine") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByVirtualMachinePreparer(ctx, resourceGroupName, VMName, runCommandName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", nil, "Failure preparing request") + return + } + + resp, err := client.GetByVirtualMachineSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure sending request") + return + } + + result, err = client.GetByVirtualMachineResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "GetByVirtualMachine", resp, "Failure responding to request") + return + } + + return +} + +// GetByVirtualMachinePreparer prepares the GetByVirtualMachine request. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByVirtualMachineSender sends the GetByVirtualMachine request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachineSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByVirtualMachineResponder handles the response to the GetByVirtualMachine request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) GetByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all available run commands for a subscription in a location. +// Parameters: +// location - the location upon which run commands is queried. +func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") + defer func() { + sc := -1 + if result.rclr.Response.Response != nil { + sc = result.rclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request") + return + } + + result.rclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") + return + } + if result.rclr.hasNextLink() && result.rclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualMachineRunCommandsClient) listNextResults(ctx context.Context, lastResults RunCommandListResult) (result RunCommandListResult, err error) { + req, err := lastResults.runCommandListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, location) + return +} + +// ListByVirtualMachine the operation to get all run commands of a Virtual Machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine containing the run command. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") + defer func() { + sc := -1 + if result.vmrclr.Response.Response != nil { + sc = result.vmrclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByVirtualMachineNextResults + req, err := client.ListByVirtualMachinePreparer(ctx, resourceGroupName, VMName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", nil, "Failure preparing request") + return + } + + resp, err := client.ListByVirtualMachineSender(req) + if err != nil { + result.vmrclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure sending request") + return + } + + result.vmrclr, err = client.ListByVirtualMachineResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "ListByVirtualMachine", resp, "Failure responding to request") + return + } + if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByVirtualMachinePreparer prepares the ListByVirtualMachine request. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachinePreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByVirtualMachineSender sends the ListByVirtualMachine request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachineSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByVirtualMachineResponder handles the response to the ListByVirtualMachine request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachineResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByVirtualMachineNextResults retrieves the next set of results, if any. +func (client VirtualMachineRunCommandsClient) listByVirtualMachineNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { + req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByVirtualMachineSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByVirtualMachineResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listByVirtualMachineNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByVirtualMachineComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineRunCommandsClient) ListByVirtualMachineComplete(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.ListByVirtualMachine") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByVirtualMachine(ctx, resourceGroupName, VMName, expand) + return +} + +// Update the operation to update the run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine where the run command should be updated. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Update Virtual Machine RunCommand operation. +func (client VirtualMachineRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineRunCommandsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineRunCommandsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachines.go b/services/compute/mgmt/2021-08-01/compute/virtualmachines.go new file mode 100644 index 000000000000..d1d62c748fc3 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachines.go @@ -0,0 +1,2193 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachinesClient is the compute Client +type VirtualMachinesClient struct { + BaseClient +} + +// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. +func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { + return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { + return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AssessPatches assess patches on the VM. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) AssessPatches(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesAssessPatchesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.AssessPatches") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AssessPatchesPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "AssessPatches", nil, "Failure preparing request") + return + } + + result, err = client.AssessPatchesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "AssessPatches", result.Response(), "Failure sending request") + return + } + + return +} + +// AssessPatchesPreparer prepares the AssessPatches request. +func (client VirtualMachinesClient) AssessPatchesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/assessPatches", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AssessPatchesSender sends the AssessPatches request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) AssessPatchesSender(req *http.Request) (future VirtualMachinesAssessPatchesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// AssessPatchesResponder handles the response to the AssessPatches request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) AssessPatchesResponder(resp *http.Response) (result VirtualMachineAssessPatchesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create +// similar VMs. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// parameters - parameters supplied to the Capture Virtual Machine operation. +func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (result VirtualMachinesCaptureFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Capture") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VhdPrefix", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DestinationContainerName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OverwriteVhds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachinesClient", "Capture", err.Error()) + } + + req, err := client.CapturePreparer(ctx, resourceGroupName, VMName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request") + return + } + + result, err = client.CaptureSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", result.Response(), "Failure sending request") + return + } + + return +} + +// CapturePreparer prepares the Capture request. +func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CaptureSender sends the Capture request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future VirtualMachinesCaptureFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CaptureResponder handles the response to the Capture request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be +// stop-deallocated before invoking this operation. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesConvertToManagedDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ConvertToManagedDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ConvertToManagedDisksPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure preparing request") + return + } + + result, err = client.ConvertToManagedDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", result.Response(), "Failure sending request") + return + } + + return +} + +// ConvertToManagedDisksPreparer prepares the ConvertToManagedDisks request. +func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ConvertToManagedDisksSender sends the ConvertToManagedDisks request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Request) (future VirtualMachinesConvertToManagedDisksFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ConvertToManagedDisksResponder handles the response to the ConvertToManagedDisks request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate the operation to create or update a virtual machine. Please note some properties can be set only +// during virtual machine creation. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// parameters - parameters supplied to the Create Virtual Machine operation. +func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachinesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Resources = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute +// resources that this virtual machine uses. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// hibernate - optional parameter to hibernate a virtual machine. (Feature in Preview) +func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGroupName string, VMName string, hibernate *bool) (result VirtualMachinesDeallocateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Deallocate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMName, hibernate) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request") + return + } + + result, err = client.DeallocateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", result.Response(), "Failure sending request") + return + } + + return +} + +// DeallocatePreparer prepares the Deallocate request. +func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMName string, hibernate *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if hibernate != nil { + queryParameters["hibernate"] = autorest.Encode("query", *hibernate) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeallocateSender sends the Deallocate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future VirtualMachinesDeallocateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeallocateResponder handles the response to the Deallocate request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete the operation to delete a virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// forceDeletion - optional parameter to force delete virtual machines. +func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (result VirtualMachinesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, forceDeletion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, forceDeletion *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDeletion != nil { + queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Generalize sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine +// before performing this operation.
    For Windows, please refer to [Create a managed image of a generalized VM in +// Azure](https://docs.microsoft.com/azure/virtual-machines/windows/capture-image-resource).
    For Linux, please refer +// to [How to create an image of a virtual machine or +// VHD](https://docs.microsoft.com/azure/virtual-machines/linux/capture-image). +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Generalize") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GeneralizePreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", nil, "Failure preparing request") + return + } + + resp, err := client.GeneralizeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure sending request") + return + } + + result, err = client.GeneralizeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request") + return + } + + return +} + +// GeneralizePreparer prepares the Generalize request. +func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GeneralizeSender sends the Generalize request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GeneralizeResponder handles the response to the Generalize request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves information about the model view or the instance view of a virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// expand - the expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime +// properties of the virtual machine that is managed by the platform and can change outside of control plane +// operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the +// user during the VM Create/Update operation. +func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// InstallPatches installs patches on the VM. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// installPatchesInput - input for InstallPatches as directly received by the API +func (client VirtualMachinesClient) InstallPatches(ctx context.Context, resourceGroupName string, VMName string, installPatchesInput VirtualMachineInstallPatchesParameters) (result VirtualMachinesInstallPatchesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstallPatches") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.InstallPatchesPreparer(ctx, resourceGroupName, VMName, installPatchesInput) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstallPatches", nil, "Failure preparing request") + return + } + + result, err = client.InstallPatchesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstallPatches", result.Response(), "Failure sending request") + return + } + + return +} + +// InstallPatchesPreparer prepares the InstallPatches request. +func (client VirtualMachinesClient) InstallPatchesPreparer(ctx context.Context, resourceGroupName string, VMName string, installPatchesInput VirtualMachineInstallPatchesParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/installPatches", pathParameters), + autorest.WithJSON(installPatchesInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstallPatchesSender sends the InstallPatches request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) InstallPatchesSender(req *http.Request) (future VirtualMachinesInstallPatchesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// InstallPatchesResponder handles the response to the InstallPatches request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) InstallPatchesResponder(resp *http.Response) (result VirtualMachineInstallPatchesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// InstanceView retrieves information about the run-time state of a virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstanceView") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.InstanceViewPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request") + return + } + + resp, err := client.InstanceViewSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure sending request") + return + } + + result, err = client.InstanceViewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request") + return + } + + return +} + +// InstanceViewPreparer prepares the InstanceView request. +func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstanceViewSender sends the InstanceView request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// InstanceViewResponder handles the response to the InstanceView request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to +// get the next page of virtual machines. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") + defer func() { + sc := -1 + if result.vmlr.Response.Response != nil { + sc = result.vmlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vmlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending request") + return + } + + result.vmlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") + return + } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualMachinesClient) listNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { + req, err := lastResults.virtualMachineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListAll lists all of the virtual machines in the specified subscription. Use the nextLink property in the response +// to get the next page of virtual machines. +// Parameters: +// statusOnly - statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. +func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly string) (result VirtualMachineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") + defer func() { + sc := -1 + if result.vmlr.Response.Response != nil { + sc = result.vmlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx, statusOnly) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.vmlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending request") + return + } + + result.vmlr, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") + return + } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context, statusOnly string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(statusOnly) > 0 { + queryParameters["statusOnly"] = autorest.Encode("query", statusOnly) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client VirtualMachinesClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { + req, err := lastResults.virtualMachineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachinesClient) ListAllComplete(ctx context.Context, statusOnly string) (result VirtualMachineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAll(ctx, statusOnly) + return +} + +// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAvailableSizes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request") + return + } + + resp, err := client.ListAvailableSizesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending request") + return + } + + result, err = client.ListAvailableSizesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request") + return + } + + return +} + +// ListAvailableSizesPreparer prepares the ListAvailableSizes request. +func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByLocation gets all the virtual machines under the specified subscription for the specified location. +// Parameters: +// location - the location for which virtual machines under the subscription are queried. +func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") + defer func() { + sc := -1 + if result.vmlr.Response.Response != nil { + sc = result.vmlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachinesClient", "ListByLocation", err.Error()) + } + + result.fn = client.listByLocationNextResults + req, err := client.ListByLocationPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLocationSender(req) + if err != nil { + result.vmlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure sending request") + return + } + + result.vmlr, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") + return + } + if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLocationPreparer prepares the ListByLocation request. +func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLocationSender sends the ListByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLocationResponder handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLocationNextResults retrieves the next set of results, if any. +func (client VirtualMachinesClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { + req, err := lastResults.virtualMachineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLocation(ctx, location) + return +} + +// PerformMaintenance the operation to perform maintenance on a virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPerformMaintenanceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PerformMaintenance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request") + return + } + + result, err = client.PerformMaintenanceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", result.Response(), "Failure sending request") + return + } + + return +} + +// PerformMaintenancePreparer prepares the PerformMaintenance request. +func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachinesPerformMaintenanceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// PowerOff the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same +// provisioned resources. You are still charged for this virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates +// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not +// specified +func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result VirtualMachinesPowerOffFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PowerOff") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName, skipShutdown) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request") + return + } + + result, err = client.PowerOffSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", result.Response(), "Failure sending request") + return + } + + return +} + +// PowerOffPreparer prepares the PowerOff request. +func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if skipShutdown != nil { + queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) + } else { + queryParameters["skipShutdown"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PowerOffSender sends the PowerOff request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future VirtualMachinesPowerOffFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PowerOffResponder handles the response to the PowerOff request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Reapply the operation to reapply a virtual machine's state. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesReapplyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reapply") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReapplyPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", nil, "Failure preparing request") + return + } + + result, err = client.ReapplySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", result.Response(), "Failure sending request") + return + } + + return +} + +// ReapplyPreparer prepares the Reapply request. +func (client VirtualMachinesClient) ReapplyPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReapplySender sends the Reapply request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future VirtualMachinesReapplyFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReapplyResponder handles the response to the Reapply request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ReapplyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Redeploy shuts down the virtual machine, moves it to a new node, and powers it back on. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRedeployFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RedeployPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") + return + } + + result, err = client.RedeploySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request") + return + } + + return +} + +// RedeployPreparer prepares the Redeploy request. +func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RedeploySender sends the Redeploy request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RedeployResponder handles the response to the Redeploy request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Reimage reimages the virtual machine which has an ephemeral OS disk back to its initial state. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// parameters - parameters supplied to the Reimage Virtual Machine operation. +func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (result VirtualMachinesReimageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reimage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReimagePreparer(ctx, resourceGroupName, VMName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = client.ReimageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimagePreparer prepares the Reimage request. +func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageSender sends the Reimage request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future VirtualMachinesReimageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageResponder handles the response to the Reimage request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restart the operation to restart a virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RetrieveBootDiagnosticsData the operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// sasURIExpirationTimeInMinutes - expiration duration in minutes for the SAS URIs with a value between 1 to +// 1440 minutes.

    NOTE: If not specified, SAS URIs will be generated with a default expiration duration +// of 120 minutes. +func (client VirtualMachinesClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMName string, sasURIExpirationTimeInMinutes *int32) (result RetrieveBootDiagnosticsDataResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RetrieveBootDiagnosticsData") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RetrieveBootDiagnosticsDataPreparer(ctx, resourceGroupName, VMName, sasURIExpirationTimeInMinutes) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", nil, "Failure preparing request") + return + } + + resp, err := client.RetrieveBootDiagnosticsDataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", resp, "Failure sending request") + return + } + + result, err = client.RetrieveBootDiagnosticsDataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RetrieveBootDiagnosticsData", resp, "Failure responding to request") + return + } + + return +} + +// RetrieveBootDiagnosticsDataPreparer prepares the RetrieveBootDiagnosticsData request. +func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataPreparer(ctx context.Context, resourceGroupName string, VMName string, sasURIExpirationTimeInMinutes *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if sasURIExpirationTimeInMinutes != nil { + queryParameters["sasUriExpirationTimeInMinutes"] = autorest.Encode("query", *sasURIExpirationTimeInMinutes) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/retrieveBootDiagnosticsData", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RetrieveBootDiagnosticsDataSender sends the RetrieveBootDiagnosticsData request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RetrieveBootDiagnosticsDataResponder handles the response to the RetrieveBootDiagnosticsData request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RetrieveBootDiagnosticsDataResponder(resp *http.Response) (result RetrieveBootDiagnosticsDataResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RunCommand run command on the VM. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// parameters - parameters supplied to the Run command operation. +func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (result VirtualMachinesRunCommandFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RunCommand") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachinesClient", "RunCommand", err.Error()) + } + + req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request") + return + } + + result, err = client.RunCommandSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", result.Response(), "Failure sending request") + return + } + + return +} + +// RunCommandPreparer prepares the RunCommand request. +func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RunCommandSender sends the RunCommand request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future VirtualMachinesRunCommandFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RunCommandResponder handles the response to the RunCommand request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SimulateEviction the operation to simulate the eviction of spot virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.SimulateEviction") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", nil, "Failure preparing request") + return + } + + resp, err := client.SimulateEvictionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure sending request") + return + } + + result, err = client.SimulateEvictionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "SimulateEviction", resp, "Failure responding to request") + return + } + + return +} + +// SimulateEvictionPreparer prepares the SimulateEviction request. +func (client VirtualMachinesClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/simulateEviction", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SimulateEvictionSender sends the SimulateEviction request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start the operation to start a virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update the operation to update a virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// parameters - parameters supplied to the Update Virtual Machine operation. +func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (result VirtualMachinesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future VirtualMachinesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetextensions.go b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetextensions.go new file mode 100644 index 000000000000..9e71f3ba9100 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetextensions.go @@ -0,0 +1,483 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineScaleSetExtensionsClient is the compute Client +type VirtualMachineScaleSetExtensionsClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client. +func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient { + return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetExtensionsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient { + return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update an extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. +// vmssExtensionName - the name of the VM scale set extension. +// extensionParameters - parameters supplied to the Create VM scale set Extension operation. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + "vmssExtensionName": autorest.Encode("path", vmssExtensionName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extensionParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set where the extension should be deleted. +// vmssExtensionName - the name of the VM scale set extension. +func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + "vmssExtensionName": autorest.Encode("path", vmssExtensionName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation to get the extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set containing the extension. +// vmssExtensionName - the name of the VM scale set extension. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + "vmssExtensionName": autorest.Encode("path", vmssExtensionName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all extensions in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set containing the extension. +func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") + defer func() { + sc := -1 + if result.vmsselr.Response.Response != nil { + sc = result.vmsselr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vmsselr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request") + return + } + + result.vmsselr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") + return + } + if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetExtensionsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) { + req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName) + return +} + +// Update the operation to update an extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set where the extension should be updated. +// vmssExtensionName - the name of the VM scale set extension. +// extensionParameters - parameters supplied to the Update VM scale set Extension operation. +func (client VirtualMachineScaleSetExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (result VirtualMachineScaleSetExtensionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + "vmssExtensionName": autorest.Encode("path", vmssExtensionName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extensionParameters.Name = nil + extensionParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetrollingupgrades.go b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetrollingupgrades.go new file mode 100644 index 000000000000..be9de5194bb5 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetrollingupgrades.go @@ -0,0 +1,346 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineScaleSetRollingUpgradesClient is the compute Client +type VirtualMachineScaleSetRollingUpgradesClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the +// VirtualMachineScaleSetRollingUpgradesClient client. +func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { + return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetRollingUpgradesClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { + return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Cancel cancels the current virtual machine scale set rolling upgrade. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetLatest gets the status of the latest virtual machine scale set rolling upgrade. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.GetLatest") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request") + return + } + + resp, err := client.GetLatestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request") + return + } + + result, err = client.GetLatestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request") + return + } + + return +} + +// GetLatestPreparer prepares the GetLatest request. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetLatestSender sends the GetLatest request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetLatestResponder handles the response to the GetLatest request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartExtensionUpgrade starts a rolling upgrade to move all extensions for all virtual machine scale set instances to +// the latest available extension version. Instances which are already running the latest extension versions are not +// affected. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartExtensionUpgrade") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartExtensionUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", nil, "Failure preparing request") + return + } + + result, err = client.StartExtensionUpgradeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", result.Response(), "Failure sending request") + return + } + + return +} + +// StartExtensionUpgradePreparer prepares the StartExtensionUpgrade request. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartExtensionUpgradeSender sends the StartExtensionUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartExtensionUpgradeResponder handles the response to the StartExtensionUpgrade request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available +// Platform Image OS version. Instances which are already running the latest available OS version are not affected. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request") + return + } + + result, err = client.StartOSUpgradeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request") + return + } + + return +} + +// StartOSUpgradePreparer prepares the StartOSUpgrade request. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesets.go b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesets.go new file mode 100644 index 000000000000..28523a860773 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesets.go @@ -0,0 +1,2154 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineScaleSetsClient is the compute Client +type VirtualMachineScaleSetsClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client. +func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { + return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { + return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to false for a existing virtual machine scale +// set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the virtual machine scale set to create or update. +// parameters - the input object for ConvertToSinglePlacementGroup API. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ConvertToSinglePlacementGroupPreparer(ctx, resourceGroupName, VMScaleSetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ConvertToSinglePlacementGroupSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure sending request") + return + } + + result, err = client.ConvertToSinglePlacementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure responding to request") + return + } + + return +} + +// ConvertToSinglePlacementGroupPreparer prepares the ConvertToSinglePlacementGroup request. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ConvertToSinglePlacementGroupSender sends the ConvertToSinglePlacementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ConvertToSinglePlacementGroupResponder handles the response to the ConvertToSinglePlacementGroup request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateOrUpdate create or update a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set to create or update. +// parameters - the scale set object. +func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, + }}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, + }}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Deallocate deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the +// compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsDeallocateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request") + return + } + + result, err = client.DeallocateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request") + return + } + + return +} + +// DeallocatePreparer prepares the Deallocate request. +func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeallocateSender sends the Deallocate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeallocateResponder handles the response to the Deallocate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete deletes a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// forceDeletion - optional parameter to force delete a VM scale set. (Feature in Preview) +func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, forceDeletion *bool) (result VirtualMachineScaleSetsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, forceDeletion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, forceDeletion *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDeletion != nil { + queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteInstances deletes virtual machines in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +// forceDeletion - optional parameter to force delete virtual machines from the VM scale set. (Feature in +// Preview) +func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, forceDeletion *bool) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: VMInstanceIDs, + Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error()) + } + + req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, forceDeletion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request") + return + } + + result, err = client.DeleteInstancesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteInstancesPreparer prepares the DeleteInstances request. +func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, forceDeletion *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDeletion != nil { + queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters), + autorest.WithJSON(VMInstanceIDs), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteInstancesSender sends the DeleteInstances request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in +// a service fabric virtual machine scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// platformUpdateDomain - the platform update domain for which a manual recovery walk is requested +func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (result RecoveryWalkResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", nil, "Failure preparing request") + return + } + + resp, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure sending request") + return + } + + result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request") + return + } + + return +} + +// ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer prepares the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. +func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender sends the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder handles the response to the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get display information about a virtual machine scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// expand - the expand expression to apply on the operation. 'UserData' retrieves the UserData property of the +// VM scale set that was provided by the user during the VM scale set Create/Update operation +func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, expand ExpandTypesForGetVMScaleSets) (result VirtualMachineScaleSet, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, expand ExpandTypesForGetVMScaleSets) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceView gets the status of a VM scale set instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetInstanceView") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceViewSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceViewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceViewPreparer prepares the GetInstanceView request. +func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceViewSender sends the GetInstanceView request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") + defer func() { + sc := -1 + if result.vmsslouh.Response.Response != nil { + sc = result.vmsslouh.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getOSUpgradeHistoryNextResults + req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request") + return + } + + resp, err := client.GetOSUpgradeHistorySender(req) + if err != nil { + result.vmsslouh.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request") + return + } + + result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") + return + } + if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request. +func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getOSUpgradeHistoryNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { + req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetOSUpgradeHistorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request") + } + result, err = client.GetOSUpgradeHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName) + return +} + +// List gets a list of all VM scale sets under a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") + defer func() { + sc := -1 + if result.vmsslr.Response.Response != nil { + sc = result.vmsslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vmsslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request") + return + } + + result.vmsslr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") + return + } + if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { + req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName) + return +} + +// ListAll gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use +// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all +// the VM Scale Sets. +func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") + defer func() { + sc := -1 + if result.vmsslwlr.Response.Response != nil { + sc = result.vmsslwlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAllNextResults + req, err := client.ListAllPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.vmsslwlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request") + return + } + + result.vmsslwlr, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") + return + } + if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAllNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetsClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) { + req, err := lastResults.virtualMachineScaleSetListWithLinkResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAllComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAll(ctx) + return +} + +// ListByLocation gets all the VM scale sets under the specified subscription for the specified location. +// Parameters: +// location - the location for which VM scale sets under the subscription are queried. +func (client VirtualMachineScaleSetsClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineScaleSetListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListByLocation") + defer func() { + sc := -1 + if result.vmsslr.Response.Response != nil { + sc = result.vmsslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "ListByLocation", err.Error()) + } + + result.fn = client.listByLocationNextResults + req, err := client.ListByLocationPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLocationSender(req) + if err != nil { + result.vmsslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", resp, "Failure sending request") + return + } + + result.vmsslr, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListByLocation", resp, "Failure responding to request") + return + } + if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLocationPreparer prepares the ListByLocation request. +func (client VirtualMachineScaleSetsClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachineScaleSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLocationSender sends the ListByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ListByLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLocationResponder handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLocationNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetsClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { + req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listByLocationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetsClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineScaleSetListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListByLocation") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLocation(ctx, location) + return +} + +// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed +// for each SKU. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") + defer func() { + sc := -1 + if result.vmsslsr.Response.Response != nil { + sc = result.vmsslsr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSkusNextResults + req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.vmsslsr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request") + return + } + + result.vmsslsr, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") + return + } + if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSkusPreparer prepares the ListSkus request. +func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusSender sends the ListSkus request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSkusResponder handles the response to the ListSkus request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSkusNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetsClient) listSkusNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) { + req, err := lastResults.virtualMachineScaleSetListSkusResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSkusComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSkus(ctx, resourceGroupName, VMScaleSetName) + return +} + +// PerformMaintenance perform maintenance on one or more virtual machines in a VM scale set. Operation on instances +// which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: +// https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure preparing request") + return + } + + result, err = client.PerformMaintenanceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request") + return + } + + return +} + +// PerformMaintenancePreparer prepares the PerformMaintenance request. +func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// PowerOff power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and +// you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates +// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not +// specified +func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (result VirtualMachineScaleSetsPowerOffFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, skipShutdown) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request") + return + } + + result, err = client.PowerOffSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request") + return + } + + return +} + +// PowerOffPreparer prepares the PowerOff request. +func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if skipShutdown != nil { + queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) + } else { + queryParameters["skipShutdown"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PowerOffSender sends the PowerOff request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PowerOffResponder handles the response to the PowerOff request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Redeploy shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers +// them back on. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure preparing request") + return + } + + result, err = client.RedeploySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request") + return + } + + return +} + +// RedeployPreparer prepares the Redeploy request. +func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RedeploySender sends the Redeploy request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RedeployResponder handles the response to the Redeploy request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a +// ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMScaleSetReimageInput - parameters for Reimaging VM ScaleSet. +func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (result VirtualMachineScaleSetsReimageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMScaleSetReimageInput) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = client.ReimageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimagePreparer prepares the Reimage request. +func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMScaleSetReimageInput != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMScaleSetReimageInput)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageSender sends the Reimage request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageResponder handles the response to the Reimage request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReimageAll reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation +// is only supported for managed disks. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageAllFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request") + return + } + + result, err = client.ReimageAllSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimageAllPreparer prepares the ReimageAll request. +func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageAllSender sends the ReimageAll request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageAllResponder handles the response to the ReimageAll request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restart restarts one or more virtual machines in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// SetOrchestrationServiceState changes ServiceState property for a given service +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the virtual machine scale set to create or update. +// parameters - the input object for SetOrchestrationServiceState API. +func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceState(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (result VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.SetOrchestrationServiceState") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SetOrchestrationServiceStatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", nil, "Failure preparing request") + return + } + + result, err = client.SetOrchestrationServiceStateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "SetOrchestrationServiceState", result.Response(), "Failure sending request") + return + } + + return +} + +// SetOrchestrationServiceStatePreparer prepares the SetOrchestrationServiceState request. +func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters OrchestrationServiceStateInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetOrchestrationServiceStateSender sends the SetOrchestrationServiceState request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateSender(req *http.Request) (future VirtualMachineScaleSetsSetOrchestrationServiceStateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SetOrchestrationServiceStateResponder handles the response to the SetOrchestrationServiceState request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) SetOrchestrationServiceStateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts one or more virtual machines in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set to create or update. +// parameters - the scale set object. +func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsUpdateInstancesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: VMInstanceIDs, + Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error()) + } + + req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request") + return + } + + result, err = client.UpdateInstancesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateInstancesPreparer prepares the UpdateInstances request. +func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters), + autorest.WithJSON(VMInstanceIDs), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateInstancesSender sends the UpdateInstances request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateInstancesResponder handles the response to the UpdateInstances request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmextensions.go b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmextensions.go new file mode 100644 index 000000000000..9713046e25d8 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmextensions.go @@ -0,0 +1,457 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineScaleSetVMExtensionsClient is the compute Client +type VirtualMachineScaleSetVMExtensionsClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetVMExtensionsClient creates an instance of the VirtualMachineScaleSetVMExtensionsClient +// client. +func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetVMExtensionsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { + return VirtualMachineScaleSetVMExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extensionParameters.Name = nil + extensionParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation to get the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineScaleSetVMExtension, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List the operation to get all extensions of an instance in Virtual Machine Scaleset. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtensionsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update the operation to update the VMSS VM extension. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMExtensionName - the name of the virtual machine extension. +// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. +func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmExtensionName": autorest.Encode("path", VMExtensionName), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + extensionParameters.Name = nil + extensionParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVMExtension, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmruncommands.go b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmruncommands.go new file mode 100644 index 000000000000..4fbb0c104507 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvmruncommands.go @@ -0,0 +1,495 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineScaleSetVMRunCommandsClient is the compute Client +type VirtualMachineScaleSetVMRunCommandsClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetVMRunCommandsClient creates an instance of the VirtualMachineScaleSetVMRunCommandsClient +// client. +func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { + return NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetVMRunCommandsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVirtualMachineScaleSetVMRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMRunCommandsClient { + return VirtualMachineScaleSetVMRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Create Virtual Machine RunCommand operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (result VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +func (client VirtualMachineScaleSetVMRunCommandsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (result VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetVMRunCommandsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get the operation to get the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (result VirtualMachineRunCommand, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetVMRunCommandsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) GetResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List the operation to get all run commands of an instance in Virtual Machine Scaleset. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// expand - the expand expression to apply on the operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") + defer func() { + sc := -1 + if result.vmrclr.Response.Response != nil { + sc = result.vmrclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vmrclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure sending request") + return + } + + result.vmrclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "List", resp, "Failure responding to request") + return + } + if result.vmrclr.hasNextLink() && result.vmrclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListResponder(resp *http.Response) (result VirtualMachineRunCommandsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetVMRunCommandsClient) listNextResults(ctx context.Context, lastResults VirtualMachineRunCommandsListResult) (result VirtualMachineRunCommandsListResult, err error) { + req, err := lastResults.virtualMachineRunCommandsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetVMRunCommandsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineRunCommandsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) + return +} + +// Update the operation to update the VMSS VM run command. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// runCommandName - the name of the virtual machine run command. +// runCommand - parameters supplied to the Update Virtual Machine RunCommand operation. +func (client VirtualMachineScaleSetVMRunCommandsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (result VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMRunCommandsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, runCommandName, runCommand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMRunCommandsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetVMRunCommandsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runCommandName": autorest.Encode("path", runCommandName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/runCommands/{runCommandName}", pathParameters), + autorest.WithJSON(runCommand), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMRunCommandsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMRunCommandsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMRunCommandsClient) UpdateResponder(resp *http.Response) (result VirtualMachineRunCommand, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvms.go b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvms.go new file mode 100644 index 000000000000..f46f6c4f52f1 --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachinescalesetvms.go @@ -0,0 +1,1430 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineScaleSetVMsClient is the compute Client +type VirtualMachineScaleSetVMsClient struct { + BaseClient +} + +// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client. +func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { + return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient { + return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the +// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is +// deallocated. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request") + return + } + + result, err = client.DeallocateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request") + return + } + + return +} + +// DeallocatePreparer prepares the Deallocate request. +func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeallocateSender sends the Deallocate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeallocateResponder handles the response to the Deallocate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Delete deletes a virtual machine from a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// forceDeletion - optional parameter to force delete a virtual machine from a VM scale set. (Feature in +// Preview) +func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, forceDeletion *bool) (result VirtualMachineScaleSetVMsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, forceDeletion) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, forceDeletion *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDeletion != nil { + queryParameters["forceDeletion"] = autorest.Encode("query", *forceDeletion) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a virtual machine from a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// expand - the expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of +// the virtual machine. 'UserData' will retrieve the UserData of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (result VirtualMachineScaleSetVM, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceView gets the status of a virtual machine from a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.GetInstanceView") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceViewSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceViewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceViewPreparer prepares the GetInstanceView request. +func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceViewSender sends the GetInstanceView request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all virtual machines in a VM scale sets. +// Parameters: +// resourceGroupName - the name of the resource group. +// virtualMachineScaleSetName - the name of the VM scale set. +// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, +// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. +// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. +// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. +func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") + defer func() { + sc := -1 + if result.vmssvlr.Response.Response != nil { + sc = result.vmssvlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.vmssvlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request") + return + } + + result.vmssvlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") + return + } + if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(selectParameter) > 0 { + queryParameters["$select"] = autorest.Encode("query", selectParameter) + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetVMsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) { + req, err := lastResults.virtualMachineScaleSetVMListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) + return +} + +// PerformMaintenance performs maintenance on a virtual machine in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PerformMaintenance") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", nil, "Failure preparing request") + return + } + + result, err = client.PerformMaintenanceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", result.Response(), "Failure sending request") + return + } + + return +} + +// PerformMaintenancePreparer prepares the PerformMaintenance request. +func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// PowerOff power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are +// getting charged for the resources. Instead, use deallocate to release resources and avoid charges. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates +// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not +// specified +func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, skipShutdown) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request") + return + } + + result, err = client.PowerOffSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request") + return + } + + return +} + +// PowerOffPreparer prepares the PowerOff request. +func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if skipShutdown != nil { + queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) + } else { + queryParameters["skipShutdown"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PowerOffSender sends the PowerOff request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PowerOffResponder handles the response to the PowerOff request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Redeploy shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back +// on. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRedeployFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Redeploy") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", nil, "Failure preparing request") + return + } + + result, err = client.RedeploySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", result.Response(), "Failure sending request") + return + } + + return +} + +// RedeployPreparer prepares the Redeploy request. +func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RedeploySender sends the Redeploy request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetVMsRedeployFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RedeployResponder handles the response to the Redeploy request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// VMScaleSetVMReimageInput - parameters for the Reimaging Virtual machine in ScaleSet. +func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (result VirtualMachineScaleSetVMsReimageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMScaleSetVMReimageInput) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = client.ReimageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimagePreparer prepares the Reimage request. +func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if VMScaleSetVMReimageInput != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMScaleSetVMReimageInput)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageSender sends the Reimage request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageResponder handles the response to the Reimage request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReimageAll allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This +// operation is only supported for managed disks. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure preparing request") + return + } + + result, err = client.ReimageAllSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimageAllPreparer prepares the ReimageAll request. +func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageAllSender sends the ReimageAll request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageAllResponder handles the response to the ReimageAll request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restart restarts a virtual machine in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RetrieveBootDiagnosticsData the operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM +// scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// sasURIExpirationTimeInMinutes - expiration duration in minutes for the SAS URIs with a value between 1 to +// 1440 minutes.

    NOTE: If not specified, SAS URIs will be generated with a default expiration duration +// of 120 minutes. +func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsData(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, sasURIExpirationTimeInMinutes *int32) (result RetrieveBootDiagnosticsDataResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RetrieveBootDiagnosticsDataPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, sasURIExpirationTimeInMinutes) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", nil, "Failure preparing request") + return + } + + resp, err := client.RetrieveBootDiagnosticsDataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", resp, "Failure sending request") + return + } + + result, err = client.RetrieveBootDiagnosticsDataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RetrieveBootDiagnosticsData", resp, "Failure responding to request") + return + } + + return +} + +// RetrieveBootDiagnosticsDataPreparer prepares the RetrieveBootDiagnosticsData request. +func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, sasURIExpirationTimeInMinutes *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if sasURIExpirationTimeInMinutes != nil { + queryParameters["sasUriExpirationTimeInMinutes"] = autorest.Encode("query", *sasURIExpirationTimeInMinutes) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RetrieveBootDiagnosticsDataSender sends the RetrieveBootDiagnosticsData request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RetrieveBootDiagnosticsDataResponder handles the response to the RetrieveBootDiagnosticsData request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) RetrieveBootDiagnosticsDataResponder(resp *http.Response) (result RetrieveBootDiagnosticsDataResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RunCommand run command on a virtual machine in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +// parameters - parameters supplied to the Run command operation. +func (client VirtualMachineScaleSetVMsClient) RunCommand(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (result VirtualMachineScaleSetVMsRunCommandFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RunCommand") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "RunCommand", err.Error()) + } + + req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", nil, "Failure preparing request") + return + } + + result, err = client.RunCommandSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", result.Response(), "Failure sending request") + return + } + + return +} + +// RunCommandPreparer prepares the RunCommand request. +func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RunCommandSender sends the RunCommand request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request) (future VirtualMachineScaleSetVMsRunCommandFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RunCommandResponder handles the response to the RunCommand request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SimulateEviction the operation to simulate the eviction of spot virtual machine in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) SimulateEviction(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.SimulateEviction") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SimulateEvictionPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", nil, "Failure preparing request") + return + } + + resp, err := client.SimulateEvictionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure sending request") + return + } + + result, err = client.SimulateEvictionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "SimulateEviction", resp, "Failure responding to request") + return + } + + return +} + +// SimulateEvictionPreparer prepares the SimulateEviction request. +func (client VirtualMachineScaleSetVMsClient) SimulateEvictionPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SimulateEvictionSender sends the SimulateEviction request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) SimulateEvictionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SimulateEvictionResponder handles the response to the SimulateEviction request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) SimulateEvictionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts a virtual machine in a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set. +// instanceID - the instance ID of the virtual machine. +func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates a virtual machine of a VM scale set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. +// instanceID - the instance ID of the virtual machine. +// parameters - parameters supplied to the Update Virtual Machine Scale Sets VM operation. +func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (result VirtualMachineScaleSetVMsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.InstanceID = nil + parameters.Sku = nil + parameters.Resources = nil + parameters.Zones = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/compute/mgmt/2021-08-01/compute/virtualmachinesizes.go b/services/compute/mgmt/2021-08-01/compute/virtualmachinesizes.go new file mode 100644 index 000000000000..394d659c218c --- /dev/null +++ b/services/compute/mgmt/2021-08-01/compute/virtualmachinesizes.go @@ -0,0 +1,113 @@ +package compute + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachineSizesClient is the compute Client +type VirtualMachineSizesClient struct { + BaseClient +} + +// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. +func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { + return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { + return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List this API is deprecated. Use [Resources Skus](https://docs.microsoft.com/rest/api/compute/resourceskus/list) +// Parameters: +// location - the location upon which virtual-machine-sizes is queried. +func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/CHANGELOG.md b/services/preview/automation/mgmt/2020-01-13-preview/automation/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/_meta.json b/services/preview/automation/mgmt/2020-01-13-preview/automation/_meta.json new file mode 100644 index 000000000000..c322164f9265 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3b9b0a930e29cbead33df69ae46c7080408e4c0f", + "readme": "/_/azure-rest-api-specs/specification/automation/resource-manager/readme.md", + "tag": "package-2020-01-13-preview", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2020-01-13-preview --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/automation/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + } +} \ No newline at end of file diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/account.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/account.go new file mode 100644 index 000000000000..fbf9b942083e --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/account.go @@ -0,0 +1,610 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AccountClient is the automation Client +type AccountClient struct { + BaseClient +} + +// NewAccountClient creates an instance of the AccountClient client. +func NewAccountClient(subscriptionID string) AccountClient { + return NewAccountClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountClientWithBaseURI creates an instance of the AccountClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAccountClientWithBaseURI(baseURI string, subscriptionID string) AccountClient { + return AccountClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the create or update automation account. +func (client AccountClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AccountClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AccountClient) CreateOrUpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AccountClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AccountClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get information about an Automation Account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AccountClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AccountClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List retrieve a list of accounts within a given subscription. +func (client AccountClient) List(ctx context.Context) (result AccountListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.List") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "List", resp, "Failure responding to request") + return + } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AccountClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AccountClient) ListResponder(resp *http.Response) (result AccountListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AccountClient) listNextResults(ctx context.Context, lastResults AccountListResult) (result AccountListResult, err error) { + req, err := lastResults.accountListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountClient) ListComplete(ctx context.Context) (result AccountListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup retrieve a list of accounts within a given resource group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +func (client AccountClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AccountClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AccountClient) ListByResourceGroupResponder(resp *http.Response) (result AccountListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AccountClient) listByResourceGroupNextResults(ctx context.Context, lastResults AccountListResult) (result AccountListResult, err error) { + req, err := lastResults.accountListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AccountListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update update an automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - parameters supplied to the update automation account. +func (client AccountClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AccountClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AccountClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AccountUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AccountClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AccountClient) UpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/activity.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/activity.go new file mode 100644 index 000000000000..6a568bcedc90 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/activity.go @@ -0,0 +1,248 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ActivityClient is the automation Client +type ActivityClient struct { + BaseClient +} + +// NewActivityClient creates an instance of the ActivityClient client. +func NewActivityClient(subscriptionID string) ActivityClient { + return NewActivityClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewActivityClientWithBaseURI creates an instance of the ActivityClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewActivityClientWithBaseURI(baseURI string, subscriptionID string) ActivityClient { + return ActivityClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the activity in the module identified by module name and activity name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// activityName - the name of activity. +func (client ActivityClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (result Activity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActivityClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName, activityName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ActivityClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "activityName": autorest.Encode("path", activityName), + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ActivityClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ActivityClient) GetResponder(resp *http.Response) (result Activity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByModule retrieve a list of activities in the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +func (client ActivityClient) ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActivityClient.ListByModule") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ActivityClient", "ListByModule", err.Error()) + } + + result.fn = client.listByModuleNextResults + req, err := client.ListByModulePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", nil, "Failure preparing request") + return + } + + resp, err := client.ListByModuleSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "ListByModule", resp, "Failure responding to request") + return + } + if result.alr.hasNextLink() && result.alr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByModulePreparer prepares the ListByModule request. +func (client ActivityClient) ListByModulePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByModuleSender sends the ListByModule request. The method will close the +// http.Response Body if it receives an error. +func (client ActivityClient) ListByModuleSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByModuleResponder handles the response to the ListByModule request. The method always +// closes the http.Response Body. +func (client ActivityClient) ListByModuleResponder(resp *http.Response) (result ActivityListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByModuleNextResults retrieves the next set of results, if any. +func (client ActivityClient) listByModuleNextResults(ctx context.Context, lastResults ActivityListResult) (result ActivityListResult, err error) { + req, err := lastResults.activityListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByModuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ActivityClient", "listByModuleNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByModuleComplete enumerates all values, automatically crossing page boundaries as required. +func (client ActivityClient) ListByModuleComplete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result ActivityListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActivityClient.ListByModule") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByModule(ctx, resourceGroupName, automationAccountName, moduleName) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/agentregistrationinformation.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/agentregistrationinformation.go new file mode 100644 index 000000000000..32c83b556e76 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/agentregistrationinformation.go @@ -0,0 +1,204 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AgentRegistrationInformationClient is the automation Client +type AgentRegistrationInformationClient struct { + BaseClient +} + +// NewAgentRegistrationInformationClient creates an instance of the AgentRegistrationInformationClient client. +func NewAgentRegistrationInformationClient(subscriptionID string) AgentRegistrationInformationClient { + return NewAgentRegistrationInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAgentRegistrationInformationClientWithBaseURI creates an instance of the AgentRegistrationInformationClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewAgentRegistrationInformationClientWithBaseURI(baseURI string, subscriptionID string) AgentRegistrationInformationClient { + return AgentRegistrationInformationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the automation agent registration information. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client AgentRegistrationInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result AgentRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentRegistrationInformationClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentRegistrationInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AgentRegistrationInformationClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AgentRegistrationInformationClient) GetResponder(resp *http.Response) (result AgentRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKey regenerate a primary or secondary agent registration key +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// parameters - the name of the agent registration key to be regenerated +func (client AgentRegistrationInformationClient) RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (result AgentRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentRegistrationInformationClient.RegenerateKey") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.AgentRegistrationInformationClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, automationAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.AgentRegistrationInformationClient", "RegenerateKey", resp, "Failure responding to request") + return + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client AgentRegistrationInformationClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, parameters AgentRegistrationRegenerateKeyParameter) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client AgentRegistrationInformationClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client AgentRegistrationInformationClient) RegenerateKeyResponder(resp *http.Response) (result AgentRegistration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/automationapi/interfaces.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/automationapi/interfaces.go new file mode 100644 index 000000000000..cc302a137413 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/automationapi/interfaces.go @@ -0,0 +1,452 @@ +package automationapi + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + "github.com/Azure/go-autorest/autorest" + "github.com/gofrs/uuid" + "io" +) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string, parameters automation.PrivateEndpointConnection) (result automation.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (result automation.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (result automation.PrivateEndpointConnection, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.PrivateEndpointConnectionListResult, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*automation.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Method(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*automation.PrivateLinkResourcesClient)(nil) + +// Python2PackageClientAPI contains the set of methods on the Python2PackageClient type. +type Python2PackageClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters automation.PythonPackageCreateParameters) (result automation.Module, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (result automation.Module, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ModuleListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ModuleListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters automation.PythonPackageUpdateParameters) (result automation.Module, err error) +} + +var _ Python2PackageClientAPI = (*automation.Python2PackageClient)(nil) + +// AgentRegistrationInformationClientAPI contains the set of methods on the AgentRegistrationInformationClient type. +type AgentRegistrationInformationClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.AgentRegistration, err error) + RegenerateKey(ctx context.Context, resourceGroupName string, automationAccountName string, parameters automation.AgentRegistrationRegenerateKeyParameter) (result automation.AgentRegistration, err error) +} + +var _ AgentRegistrationInformationClientAPI = (*automation.AgentRegistrationInformationClient)(nil) + +// DscNodeClientAPI contains the set of methods on the DscNodeClient type. +type DscNodeClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result automation.DscNode, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result automation.DscNodeListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result automation.DscNodeListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, dscNodeUpdateParameters automation.DscNodeUpdateParameters) (result automation.DscNode, err error) +} + +var _ DscNodeClientAPI = (*automation.DscNodeClient)(nil) + +// NodeReportsClientAPI contains the set of methods on the NodeReportsClient type. +type NodeReportsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result automation.DscNodeReport, err error) + GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result automation.SetObject, err error) + ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result automation.DscNodeReportListResultPage, err error) + ListByNodeComplete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result automation.DscNodeReportListResultIterator, err error) +} + +var _ NodeReportsClientAPI = (*automation.NodeReportsClient)(nil) + +// DscNodeConfigurationClientAPI contains the set of methods on the DscNodeConfigurationClient type. +type DscNodeConfigurationClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters automation.DscNodeConfigurationCreateOrUpdateParameters) (result automation.DscNodeConfigurationCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result automation.DscNodeConfiguration, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result automation.DscNodeConfigurationListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result automation.DscNodeConfigurationListResultIterator, err error) +} + +var _ DscNodeConfigurationClientAPI = (*automation.DscNodeConfigurationClient)(nil) + +// DscCompilationJobClientAPI contains the set of methods on the DscCompilationJobClient type. +type DscCompilationJobClientAPI interface { + Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters automation.DscCompilationJobCreateParameters) (result automation.DscCompilationJobCreateFuture, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (result automation.DscCompilationJob, err error) + GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result automation.JobStream, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.DscCompilationJobListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.DscCompilationJobListResultIterator, err error) +} + +var _ DscCompilationJobClientAPI = (*automation.DscCompilationJobClient)(nil) + +// DscCompilationJobStreamClientAPI contains the set of methods on the DscCompilationJobStreamClient type. +type DscCompilationJobStreamClientAPI interface { + ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result automation.JobStreamListResult, err error) +} + +var _ DscCompilationJobStreamClientAPI = (*automation.DscCompilationJobStreamClient)(nil) + +// NodeCountInformationClientAPI contains the set of methods on the NodeCountInformationClient type. +type NodeCountInformationClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string, countType automation.CountType) (result automation.NodeCounts, err error) +} + +var _ NodeCountInformationClientAPI = (*automation.NodeCountInformationClient)(nil) + +// SourceControlClientAPI contains the set of methods on the SourceControlClient type. +type SourceControlClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters automation.SourceControlCreateOrUpdateParameters) (result automation.SourceControl, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result automation.SourceControl, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.SourceControlListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.SourceControlListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters automation.SourceControlUpdateParameters) (result automation.SourceControl, err error) +} + +var _ SourceControlClientAPI = (*automation.SourceControlClient)(nil) + +// SourceControlSyncJobClientAPI contains the set of methods on the SourceControlSyncJobClient type. +type SourceControlSyncJobClientAPI interface { + Create(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters automation.SourceControlSyncJobCreateParameters) (result automation.SourceControlSyncJob, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (result automation.SourceControlSyncJobByID, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result automation.SourceControlSyncJobListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result automation.SourceControlSyncJobListResultIterator, err error) +} + +var _ SourceControlSyncJobClientAPI = (*automation.SourceControlSyncJobClient)(nil) + +// SourceControlSyncJobStreamsClientAPI contains the set of methods on the SourceControlSyncJobStreamsClient type. +type SourceControlSyncJobStreamsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (result automation.SourceControlSyncJobStreamByID, err error) + ListBySyncJob(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result automation.SourceControlSyncJobStreamsListBySyncJobPage, err error) + ListBySyncJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result automation.SourceControlSyncJobStreamsListBySyncJobIterator, err error) +} + +var _ SourceControlSyncJobStreamsClientAPI = (*automation.SourceControlSyncJobStreamsClient)(nil) + +// AccountClientAPI contains the set of methods on the AccountClient type. +type AccountClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, parameters automation.AccountCreateOrUpdateParameters) (result automation.Account, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.Account, err error) + List(ctx context.Context) (result automation.AccountListResultPage, err error) + ListComplete(ctx context.Context) (result automation.AccountListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result automation.AccountListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result automation.AccountListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, parameters automation.AccountUpdateParameters) (result automation.Account, err error) +} + +var _ AccountClientAPI = (*automation.AccountClient)(nil) + +// StatisticsClientAPI contains the set of methods on the StatisticsClient type. +type StatisticsClientAPI interface { + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.StatisticsListResult, err error) +} + +var _ StatisticsClientAPI = (*automation.StatisticsClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.UsageListResult, err error) +} + +var _ UsagesClientAPI = (*automation.UsagesClient)(nil) + +// KeysClientAPI contains the set of methods on the KeysClient type. +type KeysClientAPI interface { + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.KeyListResult, err error) +} + +var _ KeysClientAPI = (*automation.KeysClient)(nil) + +// CertificateClientAPI contains the set of methods on the CertificateClient type. +type CertificateClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters automation.CertificateCreateOrUpdateParameters) (result automation.Certificate, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result automation.Certificate, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.CertificateListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.CertificateListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters automation.CertificateUpdateParameters) (result automation.Certificate, err error) +} + +var _ CertificateClientAPI = (*automation.CertificateClient)(nil) + +// ConnectionClientAPI contains the set of methods on the ConnectionClient type. +type ConnectionClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters automation.ConnectionCreateOrUpdateParameters) (result automation.Connection, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result automation.Connection, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ConnectionListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ConnectionListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters automation.ConnectionUpdateParameters) (result automation.Connection, err error) +} + +var _ ConnectionClientAPI = (*automation.ConnectionClient)(nil) + +// ConnectionTypeClientAPI contains the set of methods on the ConnectionTypeClient type. +type ConnectionTypeClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters automation.ConnectionTypeCreateOrUpdateParameters) (result automation.ConnectionType, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result automation.ConnectionType, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ConnectionTypeListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ConnectionTypeListResultIterator, err error) +} + +var _ ConnectionTypeClientAPI = (*automation.ConnectionTypeClient)(nil) + +// CredentialClientAPI contains the set of methods on the CredentialClient type. +type CredentialClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters automation.CredentialCreateOrUpdateParameters) (result automation.Credential, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result automation.Credential, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.CredentialListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.CredentialListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters automation.CredentialUpdateParameters) (result automation.Credential, err error) +} + +var _ CredentialClientAPI = (*automation.CredentialClient)(nil) + +// HybridRunbookWorkerGroupClientAPI contains the set of methods on the HybridRunbookWorkerGroupClient type. +type HybridRunbookWorkerGroupClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result automation.HybridRunbookWorkerGroup, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.HybridRunbookWorkerGroupsListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.HybridRunbookWorkerGroupsListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters automation.HybridRunbookWorkerGroupUpdateParameters) (result automation.HybridRunbookWorkerGroup, err error) +} + +var _ HybridRunbookWorkerGroupClientAPI = (*automation.HybridRunbookWorkerGroupClient)(nil) + +// JobScheduleClientAPI contains the set of methods on the JobScheduleClient type. +type JobScheduleClientAPI interface { + Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters automation.JobScheduleCreateParameters) (result automation.JobSchedule, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result automation.JobSchedule, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.JobScheduleListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.JobScheduleListResultIterator, err error) +} + +var _ JobScheduleClientAPI = (*automation.JobScheduleClient)(nil) + +// LinkedWorkspaceClientAPI contains the set of methods on the LinkedWorkspaceClient type. +type LinkedWorkspaceClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.LinkedWorkspace, err error) +} + +var _ LinkedWorkspaceClientAPI = (*automation.LinkedWorkspaceClient)(nil) + +// ActivityClientAPI contains the set of methods on the ActivityClient type. +type ActivityClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, activityName string) (result automation.Activity, err error) + ListByModule(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result automation.ActivityListResultPage, err error) + ListByModuleComplete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result automation.ActivityListResultIterator, err error) +} + +var _ ActivityClientAPI = (*automation.ActivityClient)(nil) + +// ModuleClientAPI contains the set of methods on the ModuleClient type. +type ModuleClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters automation.ModuleCreateOrUpdateParameters) (result automation.Module, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result automation.Module, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ModuleListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ModuleListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters automation.ModuleUpdateParameters) (result automation.Module, err error) +} + +var _ ModuleClientAPI = (*automation.ModuleClient)(nil) + +// ObjectDataTypesClientAPI contains the set of methods on the ObjectDataTypesClient type. +type ObjectDataTypesClientAPI interface { + ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result automation.TypeFieldListResult, err error) + ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result automation.TypeFieldListResult, err error) +} + +var _ ObjectDataTypesClientAPI = (*automation.ObjectDataTypesClient)(nil) + +// FieldsClientAPI contains the set of methods on the FieldsClient type. +type FieldsClientAPI interface { + ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result automation.TypeFieldListResult, err error) +} + +var _ FieldsClientAPI = (*automation.FieldsClient)(nil) + +// ScheduleClientAPI contains the set of methods on the ScheduleClient type. +type ScheduleClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters automation.ScheduleCreateOrUpdateParameters) (result automation.Schedule, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result automation.Schedule, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ScheduleListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.ScheduleListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters automation.ScheduleUpdateParameters) (result automation.Schedule, err error) +} + +var _ ScheduleClientAPI = (*automation.ScheduleClient)(nil) + +// VariableClientAPI contains the set of methods on the VariableClient type. +type VariableClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters automation.VariableCreateOrUpdateParameters) (result automation.Variable, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result automation.Variable, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.VariableListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.VariableListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters automation.VariableUpdateParameters) (result automation.Variable, err error) +} + +var _ VariableClientAPI = (*automation.VariableClient)(nil) + +// WatcherClientAPI contains the set of methods on the WatcherClient type. +type WatcherClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters automation.Watcher) (result automation.Watcher, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result automation.Watcher, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.WatcherListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.WatcherListResultIterator, err error) + Start(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) + Stop(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters automation.WatcherUpdateParameters) (result automation.Watcher, err error) +} + +var _ WatcherClientAPI = (*automation.WatcherClient)(nil) + +// DscConfigurationClientAPI contains the set of methods on the DscConfigurationClient type. +type DscConfigurationClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters automation.DscConfigurationCreateOrUpdateParameters) (result automation.DscConfiguration, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result automation.DscConfiguration, err error) + GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result automation.String, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result automation.DscConfigurationListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result automation.DscConfigurationListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *automation.DscConfigurationUpdateParameters) (result automation.DscConfiguration, err error) +} + +var _ DscConfigurationClientAPI = (*automation.DscConfigurationClient)(nil) + +// JobClientAPI contains the set of methods on the JobClient type. +type JobClientAPI interface { + Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters automation.JobCreateParameters, clientRequestID string) (result automation.Job, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result automation.Job, err error) + GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result automation.String, err error) + GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result automation.String, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result automation.JobListResultV2Page, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result automation.JobListResultV2Iterator, err error) + Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) + Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) + Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) +} + +var _ JobClientAPI = (*automation.JobClient)(nil) + +// JobStreamClientAPI contains the set of methods on the JobStreamClient type. +type JobStreamClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (result automation.JobStream, err error) + ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result automation.JobStreamListResultPage, err error) + ListByJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result automation.JobStreamListResultIterator, err error) +} + +var _ JobStreamClientAPI = (*automation.JobStreamClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result automation.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*automation.OperationsClient)(nil) + +// SoftwareUpdateConfigurationsClientAPI contains the set of methods on the SoftwareUpdateConfigurationsClient type. +type SoftwareUpdateConfigurationsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters automation.SoftwareUpdateConfiguration, clientRequestID string) (result automation.SoftwareUpdateConfiguration, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result autorest.Response, err error) + GetByName(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result automation.SoftwareUpdateConfiguration, err error) + List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (result automation.SoftwareUpdateConfigurationListResult, err error) +} + +var _ SoftwareUpdateConfigurationsClientAPI = (*automation.SoftwareUpdateConfigurationsClient)(nil) + +// SoftwareUpdateConfigurationRunsClientAPI contains the set of methods on the SoftwareUpdateConfigurationRunsClient type. +type SoftwareUpdateConfigurationRunsClientAPI interface { + GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (result automation.SoftwareUpdateConfigurationRun, err error) + List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result automation.SoftwareUpdateConfigurationRunListResult, err error) +} + +var _ SoftwareUpdateConfigurationRunsClientAPI = (*automation.SoftwareUpdateConfigurationRunsClient)(nil) + +// SoftwareUpdateConfigurationMachineRunsClientAPI contains the set of methods on the SoftwareUpdateConfigurationMachineRunsClient type. +type SoftwareUpdateConfigurationMachineRunsClientAPI interface { + GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (result automation.SoftwareUpdateConfigurationMachineRun, err error) + List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result automation.SoftwareUpdateConfigurationMachineRunListResult, err error) +} + +var _ SoftwareUpdateConfigurationMachineRunsClientAPI = (*automation.SoftwareUpdateConfigurationMachineRunsClient)(nil) + +// RunbookDraftClientAPI contains the set of methods on the RunbookDraftClient type. +type RunbookDraftClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result automation.RunbookDraft, err error) + GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result automation.ReadCloser, err error) + ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (result automation.RunbookDraftReplaceContentFuture, err error) + UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result automation.RunbookDraftUndoEditResult, err error) +} + +var _ RunbookDraftClientAPI = (*automation.RunbookDraftClient)(nil) + +// RunbookClientAPI contains the set of methods on the RunbookClient type. +type RunbookClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters automation.RunbookCreateOrUpdateParameters) (result automation.Runbook, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result automation.Runbook, err error) + GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result automation.ReadCloser, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.RunbookListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.RunbookListResultIterator, err error) + Publish(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result automation.RunbookPublishFuture, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters automation.RunbookUpdateParameters) (result automation.Runbook, err error) +} + +var _ RunbookClientAPI = (*automation.RunbookClient)(nil) + +// TestJobStreamsClientAPI contains the set of methods on the TestJobStreamsClient type. +type TestJobStreamsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (result automation.JobStream, err error) + ListByTestJob(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result automation.JobStreamListResultPage, err error) + ListByTestJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result automation.JobStreamListResultIterator, err error) +} + +var _ TestJobStreamsClientAPI = (*automation.TestJobStreamsClient)(nil) + +// TestJobClientAPI contains the set of methods on the TestJobClient type. +type TestJobClientAPI interface { + Create(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters automation.TestJobCreateParameters) (result automation.TestJob, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result automation.TestJob, err error) + Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) + Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) + Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) +} + +var _ TestJobClientAPI = (*automation.TestJobClient)(nil) + +// WebhookClientAPI contains the set of methods on the WebhookClient type. +type WebhookClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters automation.WebhookCreateOrUpdateParameters) (result automation.Webhook, err error) + Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result autorest.Response, err error) + GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result automation.String, err error) + Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result automation.Webhook, err error) + ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.WebhookListResultPage, err error) + ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result automation.WebhookListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters automation.WebhookUpdateParameters) (result automation.Webhook, err error) +} + +var _ WebhookClientAPI = (*automation.WebhookClient)(nil) diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/certificate.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/certificate.go new file mode 100644 index 000000000000..3310dcbc156d --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/certificate.go @@ -0,0 +1,511 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CertificateClient is the automation Client +type CertificateClient struct { + BaseClient +} + +// NewCertificateClient creates an instance of the CertificateClient client. +func NewCertificateClient(subscriptionID string) CertificateClient { + return NewCertificateClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCertificateClientWithBaseURI creates an instance of the CertificateClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCertificateClientWithBaseURI(baseURI string, subscriptionID string) CertificateClient { + return CertificateClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the create or update certificate operation. +// parameters - the parameters supplied to the create or update certificate operation. +func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (result Certificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Base64Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CertificateClient) CreateOrUpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. +func (client CertificateClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CertificateClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the certificate identified by certificate name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the name of certificate. +func (client CertificateClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (result Certificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CertificateClient) GetResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of certificates. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client CertificateClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.clr.hasNextLink() && result.clr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client CertificateClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client CertificateClient) ListByAutomationAccountResponder(resp *http.Response) (result CertificateListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client CertificateClient) listByAutomationAccountNextResults(ctx context.Context, lastResults CertificateListResult) (result CertificateListResult, err error) { + req, err := lastResults.certificateListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificateClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CertificateListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a certificate. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// certificateName - the parameters supplied to the update certificate operation. +// parameters - the parameters supplied to the update certificate operation. +func (client CertificateClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (result Certificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CertificateClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, certificateName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CertificateClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CertificateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, certificateName string, parameters CertificateUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CertificateClient) UpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/client.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/client.go new file mode 100644 index 000000000000..e729ae544fd6 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/client.go @@ -0,0 +1,41 @@ +// Package automation implements the Azure ARM Automation service API version . +// +// Automation Client +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Automation + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Automation. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/connection.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/connection.go new file mode 100644 index 000000000000..b6707c71e05e --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/connection.go @@ -0,0 +1,511 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ConnectionClient is the automation Client +type ConnectionClient struct { + BaseClient +} + +// NewConnectionClient creates an instance of the ConnectionClient client. +func NewConnectionClient(subscriptionID string) ConnectionClient { + return NewConnectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectionClientWithBaseURI creates an instance of the ConnectionClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewConnectionClientWithBaseURI(baseURI string, subscriptionID string) ConnectionClient { + return ConnectionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the create or update connection operation. +// parameters - the parameters supplied to the create or update connection operation. +func (client ConnectionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (result Connection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ConnectionCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ConnectionCreateOrUpdateProperties.ConnectionType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectionClient) CreateOrUpdateResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. +func (client ConnectionClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectionClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConnectionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the connection identified by connection name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the name of connection. +func (client ConnectionClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (result Connection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectionClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConnectionClient) GetResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of connections. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ConnectionClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.clr.hasNextLink() && result.clr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ConnectionClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ConnectionClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ConnectionClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ConnectionListResult) (result ConnectionListResult, err error) { + req, err := lastResults.connectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectionClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionName - the parameters supplied to the update a connection operation. +// parameters - the parameters supplied to the update a connection operation. +func (client ConnectionClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (result Connection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ConnectionClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionName string, parameters ConnectionUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionName": autorest.Encode("path", connectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ConnectionClient) UpdateResponder(resp *http.Response) (result Connection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/connectiontype.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/connectiontype.go new file mode 100644 index 000000000000..a0b63baf7321 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/connectiontype.go @@ -0,0 +1,422 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ConnectionTypeClient is the automation Client +type ConnectionTypeClient struct { + BaseClient +} + +// NewConnectionTypeClient creates an instance of the ConnectionTypeClient client. +func NewConnectionTypeClient(subscriptionID string) ConnectionTypeClient { + return NewConnectionTypeClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectionTypeClientWithBaseURI creates an instance of the ConnectionTypeClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewConnectionTypeClientWithBaseURI(baseURI string, subscriptionID string) ConnectionTypeClient { + return ConnectionTypeClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a connection type. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the parameters supplied to the create or update connection type operation. +// parameters - the parameters supplied to the create or update connection type operation. +func (client ConnectionTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (result ConnectionType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ConnectionTypeCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ConnectionTypeCreateOrUpdateProperties.FieldDefinitions", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectionTypeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string, parameters ConnectionTypeCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectionType, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the connection type. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connection type. +func (client ConnectionTypeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectionTypeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the connection type identified by connection type name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// connectionTypeName - the name of connection type. +func (client ConnectionTypeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (result ConnectionType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, connectionTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectionTypeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, connectionTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "connectionTypeName": autorest.Encode("path", connectionTypeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) GetResponder(resp *http.Response) (result ConnectionType, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of connection types. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ConnectionTypeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.ctlr.Response.Response != nil { + sc = result.ctlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ConnectionTypeClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.ctlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.ctlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.ctlr.hasNextLink() && result.ctlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ConnectionTypeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectionTypeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ConnectionTypeClient) ListByAutomationAccountResponder(resp *http.Response) (result ConnectionTypeListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ConnectionTypeClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ConnectionTypeListResult) (result ConnectionTypeListResult, err error) { + req, err := lastResults.connectionTypeListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ConnectionTypeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectionTypeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ConnectionTypeListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/credential.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/credential.go new file mode 100644 index 000000000000..876567b18c17 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/credential.go @@ -0,0 +1,513 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CredentialClient is the automation Client +type CredentialClient struct { + BaseClient +} + +// NewCredentialClient creates an instance of the CredentialClient client. +func NewCredentialClient(subscriptionID string) CredentialClient { + return NewCredentialClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCredentialClientWithBaseURI creates an instance of the CredentialClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCredentialClientWithBaseURI(baseURI string, subscriptionID string) CredentialClient { + return CredentialClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the create or update credential operation. +// parameters - the parameters supplied to the create or update credential operation. +func (client CredentialClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (result Credential, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CredentialCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CredentialCreateOrUpdateProperties.UserName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.CredentialCreateOrUpdateProperties.Password", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CredentialClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CredentialClient) CreateOrUpdateResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. +func (client CredentialClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, credentialName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CredentialClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CredentialClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the credential identified by credential name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the name of credential. +func (client CredentialClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (result Credential, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, credentialName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CredentialClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CredentialClient) GetResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of credentials. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client CredentialClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.clr.hasNextLink() && result.clr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client CredentialClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client CredentialClient) ListByAutomationAccountResponder(resp *http.Response) (result CredentialListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client CredentialClient) listByAutomationAccountNextResults(ctx context.Context, lastResults CredentialListResult) (result CredentialListResult, err error) { + req, err := lastResults.credentialListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CredentialClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result CredentialListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a credential. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// credentialName - the parameters supplied to the Update credential operation. +// parameters - the parameters supplied to the Update credential operation. +func (client CredentialClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (result Credential, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.CredentialClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, credentialName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.CredentialClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CredentialClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, credentialName string, parameters CredentialUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "credentialName": autorest.Encode("path", credentialName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CredentialClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CredentialClient) UpdateResponder(resp *http.Response) (result Credential, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjob.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjob.go new file mode 100644 index 000000000000..c767e72429da --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjob.go @@ -0,0 +1,433 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// DscCompilationJobClient is the automation Client +type DscCompilationJobClient struct { + BaseClient +} + +// NewDscCompilationJobClient creates an instance of the DscCompilationJobClient client. +func NewDscCompilationJobClient(subscriptionID string) DscCompilationJobClient { + return NewDscCompilationJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscCompilationJobClientWithBaseURI creates an instance of the DscCompilationJobClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDscCompilationJobClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobClient { + return DscCompilationJobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates the Dsc compilation job of the configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobName - the DSC configuration Id. +// parameters - the parameters supplied to the create compilation job operation. +func (client DscCompilationJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (result DscCompilationJobCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscCompilationJobCreateProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, compilationJobName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DscCompilationJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string, parameters DscCompilationJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "compilationJobName": autorest.Encode("path", compilationJobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) CreateSender(req *http.Request) (future DscCompilationJobCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) CreateResponder(resp *http.Response) (result DscCompilationJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the Dsc configuration compilation job identified by job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// compilationJobName - the DSC configuration Id. +func (client DscCompilationJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (result DscCompilationJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, compilationJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscCompilationJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, compilationJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "compilationJobName": autorest.Encode("path", compilationJobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) GetResponder(resp *http.Response) (result DscCompilationJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStream retrieve the job stream identified by job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +// jobStreamID - the job stream id. +func (client DscCompilationJobClient) GetStream(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (result JobStream, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.GetStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "GetStream", err.Error()) + } + + req, err := client.GetStreamPreparer(ctx, resourceGroupName, automationAccountName, jobID, jobStreamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", nil, "Failure preparing request") + return + } + + resp, err := client.GetStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure sending request") + return + } + + result, err = client.GetStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "GetStream", resp, "Failure responding to request") + return + } + + return +} + +// GetStreamPreparer prepares the GetStream request. +func (client DscCompilationJobClient) GetStreamPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID, jobStreamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobId": autorest.Encode("path", jobID), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStreamSender sends the GetStream request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) GetStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStreamResponder handles the response to the GetStream request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) GetStreamResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc compilation jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client DscCompilationJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.dcjlr.Response.Response != nil { + sc = result.dcjlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dcjlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dcjlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.dcjlr.hasNextLink() && result.dcjlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscCompilationJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscCompilationJobClient) ListByAutomationAccountResponder(resp *http.Response) (result DscCompilationJobListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscCompilationJobClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscCompilationJobListResult) (result DscCompilationJobListResult, err error) { + req, err := lastResults.dscCompilationJobListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscCompilationJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result DscCompilationJobListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjobstream.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjobstream.go new file mode 100644 index 000000000000..89f0ce06c66f --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/dsccompilationjobstream.go @@ -0,0 +1,120 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// DscCompilationJobStreamClient is the automation Client +type DscCompilationJobStreamClient struct { + BaseClient +} + +// NewDscCompilationJobStreamClient creates an instance of the DscCompilationJobStreamClient client. +func NewDscCompilationJobStreamClient(subscriptionID string) DscCompilationJobStreamClient { + return NewDscCompilationJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscCompilationJobStreamClientWithBaseURI creates an instance of the DscCompilationJobStreamClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewDscCompilationJobStreamClientWithBaseURI(baseURI string, subscriptionID string) DscCompilationJobStreamClient { + return DscCompilationJobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByJob retrieve all the job streams for the compilation Job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobID - the job id. +func (client DscCompilationJobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (result JobStreamListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobStreamClient.ListByJob") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscCompilationJobStreamClient", "ListByJob", err.Error()) + } + + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure sending request") + return + } + + result, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobStreamClient", "ListByJob", resp, "Failure responding to request") + return + } + + return +} + +// ListByJobPreparer prepares the ListByJob request. +func (client DscCompilationJobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobId": autorest.Encode("path", jobID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByJobSender sends the ListByJob request. The method will close the +// http.Response Body if it receives an error. +func (client DscCompilationJobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByJobResponder handles the response to the ListByJob request. The method always +// closes the http.Response Body. +func (client DscCompilationJobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go new file mode 100644 index 000000000000..52e6d6ba9094 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/dscconfiguration.go @@ -0,0 +1,622 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DscConfigurationClient is the automation Client +type DscConfigurationClient struct { + BaseClient +} + +// NewDscConfigurationClient creates an instance of the DscConfigurationClient client. +func NewDscConfigurationClient(subscriptionID string) DscConfigurationClient { + return NewDscConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscConfigurationClientWithBaseURI creates an instance of the DscConfigurationClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDscConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscConfigurationClient { + return DscConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. +func (client DscConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (result DscConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DscConfigurationCreateOrUpdateProperties.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DscConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the dsc configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result DscConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) GetResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the configuration script identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the configuration name. +func (client DscConfigurationClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.GetContent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "GetContent", resp, "Failure responding to request") + return + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client DscConfigurationClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) GetContentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) GetContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of configurations. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the number of rows to take. +// inlinecount - return total rows. +func (client DscConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.dclr.Response.Response != nil { + sc = result.dclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.dclr.hasNextLink() && result.dclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscConfigurationClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscConfigurationListResult) (result DscConfigurationListResult, err error) { + req, err := lastResults.dscConfigurationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscConfigurationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + return +} + +// Update create the configuration identified by configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// configurationName - the create or update parameters for configuration. +// parameters - the create or update parameters for configuration. +func (client DscConfigurationClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (result DscConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscConfigurationClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, configurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscConfigurationClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DscConfigurationClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters *DscConfigurationUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "configurationName": autorest.Encode("path", configurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DscConfigurationClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DscConfigurationClient) UpdateResponder(resp *http.Response) (result DscConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnode.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnode.go new file mode 100644 index 000000000000..51c8d790f327 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnode.go @@ -0,0 +1,434 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DscNodeClient is the automation Client +type DscNodeClient struct { + BaseClient +} + +// NewDscNodeClient creates an instance of the DscNodeClient client. +func NewDscNodeClient(subscriptionID string) DscNodeClient { + return NewDscNodeClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscNodeClientWithBaseURI creates an instance of the DscNodeClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDscNodeClientWithBaseURI(baseURI string, subscriptionID string) DscNodeClient { + return DscNodeClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete the dsc node identified by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. +func (client DscNodeClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscNodeClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscNodeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the dsc node identified by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the node id. +func (client DscNodeClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (result DscNode, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscNodeClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscNodeClient) GetResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc nodes. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the number of rows to take. +// inlinecount - return total rows. +func (client DscNodeClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.dnlr.Response.Response != nil { + sc = result.dnlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dnlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dnlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.dnlr.hasNextLink() && result.dnlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscNodeClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscNodeClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscNodeClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscNodeListResult) (result DscNodeListResult, err error) { + req, err := lastResults.dscNodeListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscNodeClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + return +} + +// Update update the dsc node. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - parameters supplied to the update dsc node. +// dscNodeUpdateParameters - parameters supplied to the update dsc node. +func (client DscNodeClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, dscNodeUpdateParameters DscNodeUpdateParameters) (result DscNode, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeID, dscNodeUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DscNodeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, dscNodeUpdateParameters DscNodeUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}", pathParameters), + autorest.WithJSON(dscNodeUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DscNodeClient) UpdateResponder(resp *http.Response) (result DscNode, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnodeconfiguration.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnodeconfiguration.go new file mode 100644 index 000000000000..3a92f43e7f47 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/dscnodeconfiguration.go @@ -0,0 +1,448 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DscNodeConfigurationClient is the automation Client +type DscNodeConfigurationClient struct { + BaseClient +} + +// NewDscNodeConfigurationClient creates an instance of the DscNodeConfigurationClient client. +func NewDscNodeConfigurationClient(subscriptionID string) DscNodeConfigurationClient { + return NewDscNodeConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDscNodeConfigurationClientWithBaseURI creates an instance of the DscNodeConfigurationClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewDscNodeConfigurationClientWithBaseURI(baseURI string, subscriptionID string) DscNodeConfigurationClient { + return DscNodeConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the node configuration identified by node configuration name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +// parameters - the create or update parameters for configuration. +func (client DscNodeConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (result DscNodeConfigurationCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Source.Hash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.DscNodeConfigurationCreateOrUpdateParametersProperties.Configuration", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DscNodeConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string, parameters DscNodeConfigurationCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) CreateOrUpdateSender(req *http.Request) (future DscNodeConfigurationCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result DscNodeConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the Dsc node configurations by node configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +func (client DscNodeConfigurationClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DscNodeConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the Dsc node configurations by node configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeConfigurationName - the Dsc node configuration name. +func (client DscNodeConfigurationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (result DscNodeConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DscNodeConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeConfigurationName": autorest.Encode("path", nodeConfigurationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) GetResponder(resp *http.Response) (result DscNodeConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of dsc node configurations. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// skip - the number of rows to skip. +// top - the number of rows to take. +// inlinecount - return total rows. +func (client DscNodeConfigurationClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.dnclr.Response.Response != nil { + sc = result.dnclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.DscNodeConfigurationClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.dnclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.dnclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.dnclr.hasNextLink() && result.dnclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client DscNodeConfigurationClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(inlinecount) > 0 { + queryParameters["$inlinecount"] = autorest.Encode("query", inlinecount) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client DscNodeConfigurationClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client DscNodeConfigurationClient) ListByAutomationAccountResponder(resp *http.Response) (result DscNodeConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client DscNodeConfigurationClient) listByAutomationAccountNextResults(ctx context.Context, lastResults DscNodeConfigurationListResult) (result DscNodeConfigurationListResult, err error) { + req, err := lastResults.dscNodeConfigurationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client DscNodeConfigurationClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, skip *int32, top *int32, inlinecount string) (result DscNodeConfigurationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, skip, top, inlinecount) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/enums.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/enums.go new file mode 100644 index 000000000000..80726695a21d --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/enums.go @@ -0,0 +1,680 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// AccountState enumerates the values for account state. +type AccountState string + +const ( + // AccountStateOk ... + AccountStateOk AccountState = "Ok" + // AccountStateSuspended ... + AccountStateSuspended AccountState = "Suspended" + // AccountStateUnavailable ... + AccountStateUnavailable AccountState = "Unavailable" +) + +// PossibleAccountStateValues returns an array of possible values for the AccountState const type. +func PossibleAccountStateValues() []AccountState { + return []AccountState{AccountStateOk, AccountStateSuspended, AccountStateUnavailable} +} + +// AgentRegistrationKeyName enumerates the values for agent registration key name. +type AgentRegistrationKeyName string + +const ( + // AgentRegistrationKeyNamePrimary ... + AgentRegistrationKeyNamePrimary AgentRegistrationKeyName = "primary" + // AgentRegistrationKeyNameSecondary ... + AgentRegistrationKeyNameSecondary AgentRegistrationKeyName = "secondary" +) + +// PossibleAgentRegistrationKeyNameValues returns an array of possible values for the AgentRegistrationKeyName const type. +func PossibleAgentRegistrationKeyNameValues() []AgentRegistrationKeyName { + return []AgentRegistrationKeyName{AgentRegistrationKeyNamePrimary, AgentRegistrationKeyNameSecondary} +} + +// ContentSourceType enumerates the values for content source type. +type ContentSourceType string + +const ( + // ContentSourceTypeEmbeddedContent ... + ContentSourceTypeEmbeddedContent ContentSourceType = "embeddedContent" + // ContentSourceTypeURI ... + ContentSourceTypeURI ContentSourceType = "uri" +) + +// PossibleContentSourceTypeValues returns an array of possible values for the ContentSourceType const type. +func PossibleContentSourceTypeValues() []ContentSourceType { + return []ContentSourceType{ContentSourceTypeEmbeddedContent, ContentSourceTypeURI} +} + +// CountType enumerates the values for count type. +type CountType string + +const ( + // CountTypeNodeconfiguration ... + CountTypeNodeconfiguration CountType = "nodeconfiguration" + // CountTypeStatus ... + CountTypeStatus CountType = "status" +) + +// PossibleCountTypeValues returns an array of possible values for the CountType const type. +func PossibleCountTypeValues() []CountType { + return []CountType{CountTypeNodeconfiguration, CountTypeStatus} +} + +// DscConfigurationProvisioningState enumerates the values for dsc configuration provisioning state. +type DscConfigurationProvisioningState string + +const ( + // DscConfigurationProvisioningStateSucceeded ... + DscConfigurationProvisioningStateSucceeded DscConfigurationProvisioningState = "Succeeded" +) + +// PossibleDscConfigurationProvisioningStateValues returns an array of possible values for the DscConfigurationProvisioningState const type. +func PossibleDscConfigurationProvisioningStateValues() []DscConfigurationProvisioningState { + return []DscConfigurationProvisioningState{DscConfigurationProvisioningStateSucceeded} +} + +// DscConfigurationState enumerates the values for dsc configuration state. +type DscConfigurationState string + +const ( + // DscConfigurationStateEdit ... + DscConfigurationStateEdit DscConfigurationState = "Edit" + // DscConfigurationStateNew ... + DscConfigurationStateNew DscConfigurationState = "New" + // DscConfigurationStatePublished ... + DscConfigurationStatePublished DscConfigurationState = "Published" +) + +// PossibleDscConfigurationStateValues returns an array of possible values for the DscConfigurationState const type. +func PossibleDscConfigurationStateValues() []DscConfigurationState { + return []DscConfigurationState{DscConfigurationStateEdit, DscConfigurationStateNew, DscConfigurationStatePublished} +} + +// EncryptionKeySourceType enumerates the values for encryption key source type. +type EncryptionKeySourceType string + +const ( + // EncryptionKeySourceTypeMicrosoftAutomation ... + EncryptionKeySourceTypeMicrosoftAutomation EncryptionKeySourceType = "Microsoft.Automation" + // EncryptionKeySourceTypeMicrosoftKeyvault ... + EncryptionKeySourceTypeMicrosoftKeyvault EncryptionKeySourceType = "Microsoft.Keyvault" +) + +// PossibleEncryptionKeySourceTypeValues returns an array of possible values for the EncryptionKeySourceType const type. +func PossibleEncryptionKeySourceTypeValues() []EncryptionKeySourceType { + return []EncryptionKeySourceType{EncryptionKeySourceTypeMicrosoftAutomation, EncryptionKeySourceTypeMicrosoftKeyvault} +} + +// GroupTypeEnum enumerates the values for group type enum. +type GroupTypeEnum string + +const ( + // GroupTypeEnumSystem ... + GroupTypeEnumSystem GroupTypeEnum = "System" + // GroupTypeEnumUser ... + GroupTypeEnumUser GroupTypeEnum = "User" +) + +// PossibleGroupTypeEnumValues returns an array of possible values for the GroupTypeEnum const type. +func PossibleGroupTypeEnumValues() []GroupTypeEnum { + return []GroupTypeEnum{GroupTypeEnumSystem, GroupTypeEnumUser} +} + +// HTTPStatusCode enumerates the values for http status code. +type HTTPStatusCode string + +const ( + // HTTPStatusCodeAccepted ... + HTTPStatusCodeAccepted HTTPStatusCode = "Accepted" + // HTTPStatusCodeAmbiguous ... + HTTPStatusCodeAmbiguous HTTPStatusCode = "Ambiguous" + // HTTPStatusCodeBadGateway ... + HTTPStatusCodeBadGateway HTTPStatusCode = "BadGateway" + // HTTPStatusCodeBadRequest ... + HTTPStatusCodeBadRequest HTTPStatusCode = "BadRequest" + // HTTPStatusCodeConflict ... + HTTPStatusCodeConflict HTTPStatusCode = "Conflict" + // HTTPStatusCodeContinue ... + HTTPStatusCodeContinue HTTPStatusCode = "Continue" + // HTTPStatusCodeCreated ... + HTTPStatusCodeCreated HTTPStatusCode = "Created" + // HTTPStatusCodeExpectationFailed ... + HTTPStatusCodeExpectationFailed HTTPStatusCode = "ExpectationFailed" + // HTTPStatusCodeForbidden ... + HTTPStatusCodeForbidden HTTPStatusCode = "Forbidden" + // HTTPStatusCodeFound ... + HTTPStatusCodeFound HTTPStatusCode = "Found" + // HTTPStatusCodeGatewayTimeout ... + HTTPStatusCodeGatewayTimeout HTTPStatusCode = "GatewayTimeout" + // HTTPStatusCodeGone ... + HTTPStatusCodeGone HTTPStatusCode = "Gone" + // HTTPStatusCodeHTTPVersionNotSupported ... + HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + // HTTPStatusCodeInternalServerError ... + HTTPStatusCodeInternalServerError HTTPStatusCode = "InternalServerError" + // HTTPStatusCodeLengthRequired ... + HTTPStatusCodeLengthRequired HTTPStatusCode = "LengthRequired" + // HTTPStatusCodeMethodNotAllowed ... + HTTPStatusCodeMethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + // HTTPStatusCodeMoved ... + HTTPStatusCodeMoved HTTPStatusCode = "Moved" + // HTTPStatusCodeMovedPermanently ... + HTTPStatusCodeMovedPermanently HTTPStatusCode = "MovedPermanently" + // HTTPStatusCodeMultipleChoices ... + HTTPStatusCodeMultipleChoices HTTPStatusCode = "MultipleChoices" + // HTTPStatusCodeNoContent ... + HTTPStatusCodeNoContent HTTPStatusCode = "NoContent" + // HTTPStatusCodeNonAuthoritativeInformation ... + HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + // HTTPStatusCodeNotAcceptable ... + HTTPStatusCodeNotAcceptable HTTPStatusCode = "NotAcceptable" + // HTTPStatusCodeNotFound ... + HTTPStatusCodeNotFound HTTPStatusCode = "NotFound" + // HTTPStatusCodeNotImplemented ... + HTTPStatusCodeNotImplemented HTTPStatusCode = "NotImplemented" + // HTTPStatusCodeNotModified ... + HTTPStatusCodeNotModified HTTPStatusCode = "NotModified" + // HTTPStatusCodeOK ... + HTTPStatusCodeOK HTTPStatusCode = "OK" + // HTTPStatusCodePartialContent ... + HTTPStatusCodePartialContent HTTPStatusCode = "PartialContent" + // HTTPStatusCodePaymentRequired ... + HTTPStatusCodePaymentRequired HTTPStatusCode = "PaymentRequired" + // HTTPStatusCodePreconditionFailed ... + HTTPStatusCodePreconditionFailed HTTPStatusCode = "PreconditionFailed" + // HTTPStatusCodeProxyAuthenticationRequired ... + HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + // HTTPStatusCodeRedirect ... + HTTPStatusCodeRedirect HTTPStatusCode = "Redirect" + // HTTPStatusCodeRedirectKeepVerb ... + HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + // HTTPStatusCodeRedirectMethod ... + HTTPStatusCodeRedirectMethod HTTPStatusCode = "RedirectMethod" + // HTTPStatusCodeRequestedRangeNotSatisfiable ... + HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" + // HTTPStatusCodeRequestEntityTooLarge ... + HTTPStatusCodeRequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + // HTTPStatusCodeRequestTimeout ... + HTTPStatusCodeRequestTimeout HTTPStatusCode = "RequestTimeout" + // HTTPStatusCodeRequestURITooLong ... + HTTPStatusCodeRequestURITooLong HTTPStatusCode = "RequestUriTooLong" + // HTTPStatusCodeResetContent ... + HTTPStatusCodeResetContent HTTPStatusCode = "ResetContent" + // HTTPStatusCodeSeeOther ... + HTTPStatusCodeSeeOther HTTPStatusCode = "SeeOther" + // HTTPStatusCodeServiceUnavailable ... + HTTPStatusCodeServiceUnavailable HTTPStatusCode = "ServiceUnavailable" + // HTTPStatusCodeSwitchingProtocols ... + HTTPStatusCodeSwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + // HTTPStatusCodeTemporaryRedirect ... + HTTPStatusCodeTemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + // HTTPStatusCodeUnauthorized ... + HTTPStatusCodeUnauthorized HTTPStatusCode = "Unauthorized" + // HTTPStatusCodeUnsupportedMediaType ... + HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + // HTTPStatusCodeUnused ... + HTTPStatusCodeUnused HTTPStatusCode = "Unused" + // HTTPStatusCodeUpgradeRequired ... + HTTPStatusCodeUpgradeRequired HTTPStatusCode = "UpgradeRequired" + // HTTPStatusCodeUseProxy ... + HTTPStatusCodeUseProxy HTTPStatusCode = "UseProxy" +) + +// PossibleHTTPStatusCodeValues returns an array of possible values for the HTTPStatusCode const type. +func PossibleHTTPStatusCodeValues() []HTTPStatusCode { + return []HTTPStatusCode{HTTPStatusCodeAccepted, HTTPStatusCodeAmbiguous, HTTPStatusCodeBadGateway, HTTPStatusCodeBadRequest, HTTPStatusCodeConflict, HTTPStatusCodeContinue, HTTPStatusCodeCreated, HTTPStatusCodeExpectationFailed, HTTPStatusCodeForbidden, HTTPStatusCodeFound, HTTPStatusCodeGatewayTimeout, HTTPStatusCodeGone, HTTPStatusCodeHTTPVersionNotSupported, HTTPStatusCodeInternalServerError, HTTPStatusCodeLengthRequired, HTTPStatusCodeMethodNotAllowed, HTTPStatusCodeMoved, HTTPStatusCodeMovedPermanently, HTTPStatusCodeMultipleChoices, HTTPStatusCodeNoContent, HTTPStatusCodeNonAuthoritativeInformation, HTTPStatusCodeNotAcceptable, HTTPStatusCodeNotFound, HTTPStatusCodeNotImplemented, HTTPStatusCodeNotModified, HTTPStatusCodeOK, HTTPStatusCodePartialContent, HTTPStatusCodePaymentRequired, HTTPStatusCodePreconditionFailed, HTTPStatusCodeProxyAuthenticationRequired, HTTPStatusCodeRedirect, HTTPStatusCodeRedirectKeepVerb, HTTPStatusCodeRedirectMethod, HTTPStatusCodeRequestedRangeNotSatisfiable, HTTPStatusCodeRequestEntityTooLarge, HTTPStatusCodeRequestTimeout, HTTPStatusCodeRequestURITooLong, HTTPStatusCodeResetContent, HTTPStatusCodeSeeOther, HTTPStatusCodeServiceUnavailable, HTTPStatusCodeSwitchingProtocols, HTTPStatusCodeTemporaryRedirect, HTTPStatusCodeUnauthorized, HTTPStatusCodeUnsupportedMediaType, HTTPStatusCodeUnused, HTTPStatusCodeUpgradeRequired, HTTPStatusCodeUseProxy} +} + +// JobProvisioningState enumerates the values for job provisioning state. +type JobProvisioningState string + +const ( + // JobProvisioningStateFailed ... + JobProvisioningStateFailed JobProvisioningState = "Failed" + // JobProvisioningStateProcessing ... + JobProvisioningStateProcessing JobProvisioningState = "Processing" + // JobProvisioningStateSucceeded ... + JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" + // JobProvisioningStateSuspended ... + JobProvisioningStateSuspended JobProvisioningState = "Suspended" +) + +// PossibleJobProvisioningStateValues returns an array of possible values for the JobProvisioningState const type. +func PossibleJobProvisioningStateValues() []JobProvisioningState { + return []JobProvisioningState{JobProvisioningStateFailed, JobProvisioningStateProcessing, JobProvisioningStateSucceeded, JobProvisioningStateSuspended} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusActivating ... + JobStatusActivating JobStatus = "Activating" + // JobStatusBlocked ... + JobStatusBlocked JobStatus = "Blocked" + // JobStatusCompleted ... + JobStatusCompleted JobStatus = "Completed" + // JobStatusDisconnected ... + JobStatusDisconnected JobStatus = "Disconnected" + // JobStatusFailed ... + JobStatusFailed JobStatus = "Failed" + // JobStatusNew ... + JobStatusNew JobStatus = "New" + // JobStatusRemoving ... + JobStatusRemoving JobStatus = "Removing" + // JobStatusResuming ... + JobStatusResuming JobStatus = "Resuming" + // JobStatusRunning ... + JobStatusRunning JobStatus = "Running" + // JobStatusStopped ... + JobStatusStopped JobStatus = "Stopped" + // JobStatusStopping ... + JobStatusStopping JobStatus = "Stopping" + // JobStatusSuspended ... + JobStatusSuspended JobStatus = "Suspended" + // JobStatusSuspending ... + JobStatusSuspending JobStatus = "Suspending" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusActivating, JobStatusBlocked, JobStatusCompleted, JobStatusDisconnected, JobStatusFailed, JobStatusNew, JobStatusRemoving, JobStatusResuming, JobStatusRunning, JobStatusStopped, JobStatusStopping, JobStatusSuspended, JobStatusSuspending} +} + +// JobStreamType enumerates the values for job stream type. +type JobStreamType string + +const ( + // JobStreamTypeAny ... + JobStreamTypeAny JobStreamType = "Any" + // JobStreamTypeDebug ... + JobStreamTypeDebug JobStreamType = "Debug" + // JobStreamTypeError ... + JobStreamTypeError JobStreamType = "Error" + // JobStreamTypeOutput ... + JobStreamTypeOutput JobStreamType = "Output" + // JobStreamTypeProgress ... + JobStreamTypeProgress JobStreamType = "Progress" + // JobStreamTypeVerbose ... + JobStreamTypeVerbose JobStreamType = "Verbose" + // JobStreamTypeWarning ... + JobStreamTypeWarning JobStreamType = "Warning" +) + +// PossibleJobStreamTypeValues returns an array of possible values for the JobStreamType const type. +func PossibleJobStreamTypeValues() []JobStreamType { + return []JobStreamType{JobStreamTypeAny, JobStreamTypeDebug, JobStreamTypeError, JobStreamTypeOutput, JobStreamTypeProgress, JobStreamTypeVerbose, JobStreamTypeWarning} +} + +// KeyName enumerates the values for key name. +type KeyName string + +const ( + // KeyNamePrimary ... + KeyNamePrimary KeyName = "Primary" + // KeyNameSecondary ... + KeyNameSecondary KeyName = "Secondary" +) + +// PossibleKeyNameValues returns an array of possible values for the KeyName const type. +func PossibleKeyNameValues() []KeyName { + return []KeyName{KeyNamePrimary, KeyNameSecondary} +} + +// KeyPermissions enumerates the values for key permissions. +type KeyPermissions string + +const ( + // KeyPermissionsFull ... + KeyPermissionsFull KeyPermissions = "Full" + // KeyPermissionsRead ... + KeyPermissionsRead KeyPermissions = "Read" +) + +// PossibleKeyPermissionsValues returns an array of possible values for the KeyPermissions const type. +func PossibleKeyPermissionsValues() []KeyPermissions { + return []KeyPermissions{KeyPermissionsFull, KeyPermissionsRead} +} + +// LinuxUpdateClasses enumerates the values for linux update classes. +type LinuxUpdateClasses string + +const ( + // LinuxUpdateClassesCritical ... + LinuxUpdateClassesCritical LinuxUpdateClasses = "Critical" + // LinuxUpdateClassesOther ... + LinuxUpdateClassesOther LinuxUpdateClasses = "Other" + // LinuxUpdateClassesSecurity ... + LinuxUpdateClassesSecurity LinuxUpdateClasses = "Security" + // LinuxUpdateClassesUnclassified ... + LinuxUpdateClassesUnclassified LinuxUpdateClasses = "Unclassified" +) + +// PossibleLinuxUpdateClassesValues returns an array of possible values for the LinuxUpdateClasses const type. +func PossibleLinuxUpdateClassesValues() []LinuxUpdateClasses { + return []LinuxUpdateClasses{LinuxUpdateClassesCritical, LinuxUpdateClassesOther, LinuxUpdateClassesSecurity, LinuxUpdateClassesUnclassified} +} + +// ModuleProvisioningState enumerates the values for module provisioning state. +type ModuleProvisioningState string + +const ( + // ModuleProvisioningStateActivitiesStored ... + ModuleProvisioningStateActivitiesStored ModuleProvisioningState = "ActivitiesStored" + // ModuleProvisioningStateCancelled ... + ModuleProvisioningStateCancelled ModuleProvisioningState = "Cancelled" + // ModuleProvisioningStateConnectionTypeImported ... + ModuleProvisioningStateConnectionTypeImported ModuleProvisioningState = "ConnectionTypeImported" + // ModuleProvisioningStateContentDownloaded ... + ModuleProvisioningStateContentDownloaded ModuleProvisioningState = "ContentDownloaded" + // ModuleProvisioningStateContentRetrieved ... + ModuleProvisioningStateContentRetrieved ModuleProvisioningState = "ContentRetrieved" + // ModuleProvisioningStateContentStored ... + ModuleProvisioningStateContentStored ModuleProvisioningState = "ContentStored" + // ModuleProvisioningStateContentValidated ... + ModuleProvisioningStateContentValidated ModuleProvisioningState = "ContentValidated" + // ModuleProvisioningStateCreated ... + ModuleProvisioningStateCreated ModuleProvisioningState = "Created" + // ModuleProvisioningStateCreating ... + ModuleProvisioningStateCreating ModuleProvisioningState = "Creating" + // ModuleProvisioningStateFailed ... + ModuleProvisioningStateFailed ModuleProvisioningState = "Failed" + // ModuleProvisioningStateModuleDataStored ... + ModuleProvisioningStateModuleDataStored ModuleProvisioningState = "ModuleDataStored" + // ModuleProvisioningStateModuleImportRunbookComplete ... + ModuleProvisioningStateModuleImportRunbookComplete ModuleProvisioningState = "ModuleImportRunbookComplete" + // ModuleProvisioningStateRunningImportModuleRunbook ... + ModuleProvisioningStateRunningImportModuleRunbook ModuleProvisioningState = "RunningImportModuleRunbook" + // ModuleProvisioningStateStartingImportModuleRunbook ... + ModuleProvisioningStateStartingImportModuleRunbook ModuleProvisioningState = "StartingImportModuleRunbook" + // ModuleProvisioningStateSucceeded ... + ModuleProvisioningStateSucceeded ModuleProvisioningState = "Succeeded" + // ModuleProvisioningStateUpdating ... + ModuleProvisioningStateUpdating ModuleProvisioningState = "Updating" +) + +// PossibleModuleProvisioningStateValues returns an array of possible values for the ModuleProvisioningState const type. +func PossibleModuleProvisioningStateValues() []ModuleProvisioningState { + return []ModuleProvisioningState{ModuleProvisioningStateActivitiesStored, ModuleProvisioningStateCancelled, ModuleProvisioningStateConnectionTypeImported, ModuleProvisioningStateContentDownloaded, ModuleProvisioningStateContentRetrieved, ModuleProvisioningStateContentStored, ModuleProvisioningStateContentValidated, ModuleProvisioningStateCreated, ModuleProvisioningStateCreating, ModuleProvisioningStateFailed, ModuleProvisioningStateModuleDataStored, ModuleProvisioningStateModuleImportRunbookComplete, ModuleProvisioningStateRunningImportModuleRunbook, ModuleProvisioningStateStartingImportModuleRunbook, ModuleProvisioningStateSucceeded, ModuleProvisioningStateUpdating} +} + +// OperatingSystemType enumerates the values for operating system type. +type OperatingSystemType string + +const ( + // OperatingSystemTypeLinux ... + OperatingSystemTypeLinux OperatingSystemType = "Linux" + // OperatingSystemTypeWindows ... + OperatingSystemTypeWindows OperatingSystemType = "Windows" +) + +// PossibleOperatingSystemTypeValues returns an array of possible values for the OperatingSystemType const type. +func PossibleOperatingSystemTypeValues() []OperatingSystemType { + return []OperatingSystemType{OperatingSystemTypeLinux, OperatingSystemTypeWindows} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCompleted ... + ProvisioningStateCompleted ProvisioningState = "Completed" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateRunning ... + ProvisioningStateRunning ProvisioningState = "Running" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCompleted, ProvisioningStateFailed, ProvisioningStateRunning} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// RunbookProvisioningState enumerates the values for runbook provisioning state. +type RunbookProvisioningState string + +const ( + // RunbookProvisioningStateSucceeded ... + RunbookProvisioningStateSucceeded RunbookProvisioningState = "Succeeded" +) + +// PossibleRunbookProvisioningStateValues returns an array of possible values for the RunbookProvisioningState const type. +func PossibleRunbookProvisioningStateValues() []RunbookProvisioningState { + return []RunbookProvisioningState{RunbookProvisioningStateSucceeded} +} + +// RunbookState enumerates the values for runbook state. +type RunbookState string + +const ( + // RunbookStateEdit ... + RunbookStateEdit RunbookState = "Edit" + // RunbookStateNew ... + RunbookStateNew RunbookState = "New" + // RunbookStatePublished ... + RunbookStatePublished RunbookState = "Published" +) + +// PossibleRunbookStateValues returns an array of possible values for the RunbookState const type. +func PossibleRunbookStateValues() []RunbookState { + return []RunbookState{RunbookStateEdit, RunbookStateNew, RunbookStatePublished} +} + +// RunbookTypeEnum enumerates the values for runbook type enum. +type RunbookTypeEnum string + +const ( + // RunbookTypeEnumGraph ... + RunbookTypeEnumGraph RunbookTypeEnum = "Graph" + // RunbookTypeEnumGraphPowerShell ... + RunbookTypeEnumGraphPowerShell RunbookTypeEnum = "GraphPowerShell" + // RunbookTypeEnumGraphPowerShellWorkflow ... + RunbookTypeEnumGraphPowerShellWorkflow RunbookTypeEnum = "GraphPowerShellWorkflow" + // RunbookTypeEnumPowerShell ... + RunbookTypeEnumPowerShell RunbookTypeEnum = "PowerShell" + // RunbookTypeEnumPowerShellWorkflow ... + RunbookTypeEnumPowerShellWorkflow RunbookTypeEnum = "PowerShellWorkflow" + // RunbookTypeEnumScript ... + RunbookTypeEnumScript RunbookTypeEnum = "Script" +) + +// PossibleRunbookTypeEnumValues returns an array of possible values for the RunbookTypeEnum const type. +func PossibleRunbookTypeEnumValues() []RunbookTypeEnum { + return []RunbookTypeEnum{RunbookTypeEnumGraph, RunbookTypeEnumGraphPowerShell, RunbookTypeEnumGraphPowerShellWorkflow, RunbookTypeEnumPowerShell, RunbookTypeEnumPowerShellWorkflow, RunbookTypeEnumScript} +} + +// ScheduleDay enumerates the values for schedule day. +type ScheduleDay string + +const ( + // ScheduleDayFriday ... + ScheduleDayFriday ScheduleDay = "Friday" + // ScheduleDayMonday ... + ScheduleDayMonday ScheduleDay = "Monday" + // ScheduleDaySaturday ... + ScheduleDaySaturday ScheduleDay = "Saturday" + // ScheduleDaySunday ... + ScheduleDaySunday ScheduleDay = "Sunday" + // ScheduleDayThursday ... + ScheduleDayThursday ScheduleDay = "Thursday" + // ScheduleDayTuesday ... + ScheduleDayTuesday ScheduleDay = "Tuesday" + // ScheduleDayWednesday ... + ScheduleDayWednesday ScheduleDay = "Wednesday" +) + +// PossibleScheduleDayValues returns an array of possible values for the ScheduleDay const type. +func PossibleScheduleDayValues() []ScheduleDay { + return []ScheduleDay{ScheduleDayFriday, ScheduleDayMonday, ScheduleDaySaturday, ScheduleDaySunday, ScheduleDayThursday, ScheduleDayTuesday, ScheduleDayWednesday} +} + +// ScheduleFrequency enumerates the values for schedule frequency. +type ScheduleFrequency string + +const ( + // ScheduleFrequencyDay ... + ScheduleFrequencyDay ScheduleFrequency = "Day" + // ScheduleFrequencyHour ... + ScheduleFrequencyHour ScheduleFrequency = "Hour" + // ScheduleFrequencyMinute The minimum allowed interval for Minute schedules is 15 minutes. + ScheduleFrequencyMinute ScheduleFrequency = "Minute" + // ScheduleFrequencyMonth ... + ScheduleFrequencyMonth ScheduleFrequency = "Month" + // ScheduleFrequencyOneTime ... + ScheduleFrequencyOneTime ScheduleFrequency = "OneTime" + // ScheduleFrequencyWeek ... + ScheduleFrequencyWeek ScheduleFrequency = "Week" +) + +// PossibleScheduleFrequencyValues returns an array of possible values for the ScheduleFrequency const type. +func PossibleScheduleFrequencyValues() []ScheduleFrequency { + return []ScheduleFrequency{ScheduleFrequencyDay, ScheduleFrequencyHour, ScheduleFrequencyMinute, ScheduleFrequencyMonth, ScheduleFrequencyOneTime, ScheduleFrequencyWeek} +} + +// SkuNameEnum enumerates the values for sku name enum. +type SkuNameEnum string + +const ( + // SkuNameEnumBasic ... + SkuNameEnumBasic SkuNameEnum = "Basic" + // SkuNameEnumFree ... + SkuNameEnumFree SkuNameEnum = "Free" +) + +// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. +func PossibleSkuNameEnumValues() []SkuNameEnum { + return []SkuNameEnum{SkuNameEnumBasic, SkuNameEnumFree} +} + +// SourceType enumerates the values for source type. +type SourceType string + +const ( + // SourceTypeGitHub ... + SourceTypeGitHub SourceType = "GitHub" + // SourceTypeVsoGit ... + SourceTypeVsoGit SourceType = "VsoGit" + // SourceTypeVsoTfvc ... + SourceTypeVsoTfvc SourceType = "VsoTfvc" +) + +// PossibleSourceTypeValues returns an array of possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{SourceTypeGitHub, SourceTypeVsoGit, SourceTypeVsoTfvc} +} + +// StreamType enumerates the values for stream type. +type StreamType string + +const ( + // StreamTypeError ... + StreamTypeError StreamType = "Error" + // StreamTypeOutput ... + StreamTypeOutput StreamType = "Output" +) + +// PossibleStreamTypeValues returns an array of possible values for the StreamType const type. +func PossibleStreamTypeValues() []StreamType { + return []StreamType{StreamTypeError, StreamTypeOutput} +} + +// SyncType enumerates the values for sync type. +type SyncType string + +const ( + // SyncTypeFullSync ... + SyncTypeFullSync SyncType = "FullSync" + // SyncTypePartialSync ... + SyncTypePartialSync SyncType = "PartialSync" +) + +// PossibleSyncTypeValues returns an array of possible values for the SyncType const type. +func PossibleSyncTypeValues() []SyncType { + return []SyncType{SyncTypeFullSync, SyncTypePartialSync} +} + +// TagOperators enumerates the values for tag operators. +type TagOperators string + +const ( + // TagOperatorsAll ... + TagOperatorsAll TagOperators = "All" + // TagOperatorsAny ... + TagOperatorsAny TagOperators = "Any" +) + +// PossibleTagOperatorsValues returns an array of possible values for the TagOperators const type. +func PossibleTagOperatorsValues() []TagOperators { + return []TagOperators{TagOperatorsAll, TagOperatorsAny} +} + +// TokenType enumerates the values for token type. +type TokenType string + +const ( + // TokenTypeOauth ... + TokenTypeOauth TokenType = "Oauth" + // TokenTypePersonalAccessToken ... + TokenTypePersonalAccessToken TokenType = "PersonalAccessToken" +) + +// PossibleTokenTypeValues returns an array of possible values for the TokenType const type. +func PossibleTokenTypeValues() []TokenType { + return []TokenType{TokenTypeOauth, TokenTypePersonalAccessToken} +} + +// WindowsUpdateClasses enumerates the values for windows update classes. +type WindowsUpdateClasses string + +const ( + // WindowsUpdateClassesCritical ... + WindowsUpdateClassesCritical WindowsUpdateClasses = "Critical" + // WindowsUpdateClassesDefinition ... + WindowsUpdateClassesDefinition WindowsUpdateClasses = "Definition" + // WindowsUpdateClassesFeaturePack ... + WindowsUpdateClassesFeaturePack WindowsUpdateClasses = "FeaturePack" + // WindowsUpdateClassesSecurity ... + WindowsUpdateClassesSecurity WindowsUpdateClasses = "Security" + // WindowsUpdateClassesServicePack ... + WindowsUpdateClassesServicePack WindowsUpdateClasses = "ServicePack" + // WindowsUpdateClassesTools ... + WindowsUpdateClassesTools WindowsUpdateClasses = "Tools" + // WindowsUpdateClassesUnclassified ... + WindowsUpdateClassesUnclassified WindowsUpdateClasses = "Unclassified" + // WindowsUpdateClassesUpdateRollup ... + WindowsUpdateClassesUpdateRollup WindowsUpdateClasses = "UpdateRollup" + // WindowsUpdateClassesUpdates ... + WindowsUpdateClassesUpdates WindowsUpdateClasses = "Updates" +) + +// PossibleWindowsUpdateClassesValues returns an array of possible values for the WindowsUpdateClasses const type. +func PossibleWindowsUpdateClassesValues() []WindowsUpdateClasses { + return []WindowsUpdateClasses{WindowsUpdateClassesCritical, WindowsUpdateClassesDefinition, WindowsUpdateClassesFeaturePack, WindowsUpdateClassesSecurity, WindowsUpdateClassesServicePack, WindowsUpdateClassesTools, WindowsUpdateClassesUnclassified, WindowsUpdateClassesUpdateRollup, WindowsUpdateClassesUpdates} +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/fields.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/fields.go new file mode 100644 index 000000000000..4449cca1223a --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/fields.go @@ -0,0 +1,120 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// FieldsClient is the automation Client +type FieldsClient struct { + BaseClient +} + +// NewFieldsClient creates an instance of the FieldsClient client. +func NewFieldsClient(subscriptionID string) FieldsClient { + return NewFieldsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFieldsClientWithBaseURI creates an instance of the FieldsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewFieldsClientWithBaseURI(baseURI string, subscriptionID string) FieldsClient { + return FieldsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByType retrieve a list of fields of a given type identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. +func (client FieldsClient) ListByType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FieldsClient.ListByType") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.FieldsClient", "ListByType", err.Error()) + } + + req, err := client.ListByTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure sending request") + return + } + + result, err = client.ListByTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.FieldsClient", "ListByType", resp, "Failure responding to request") + return + } + + return +} + +// ListByTypePreparer prepares the ListByType request. +func (client FieldsClient) ListByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTypeSender sends the ListByType request. The method will close the +// http.Response Body if it receives an error. +func (client FieldsClient) ListByTypeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTypeResponder handles the response to the ListByType request. The method always +// closes the http.Response Body. +func (client FieldsClient) ListByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/hybridrunbookworkergroup.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/hybridrunbookworkergroup.go new file mode 100644 index 000000000000..7b16755ccbc8 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/hybridrunbookworkergroup.go @@ -0,0 +1,423 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// HybridRunbookWorkerGroupClient is the automation Client +type HybridRunbookWorkerGroupClient struct { + BaseClient +} + +// NewHybridRunbookWorkerGroupClient creates an instance of the HybridRunbookWorkerGroupClient client. +func NewHybridRunbookWorkerGroupClient(subscriptionID string) HybridRunbookWorkerGroupClient { + return NewHybridRunbookWorkerGroupClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewHybridRunbookWorkerGroupClientWithBaseURI creates an instance of the HybridRunbookWorkerGroupClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewHybridRunbookWorkerGroupClientWithBaseURI(baseURI string, subscriptionID string) HybridRunbookWorkerGroupClient { + return HybridRunbookWorkerGroupClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client HybridRunbookWorkerGroupClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +func (client HybridRunbookWorkerGroupClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (result HybridRunbookWorkerGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client HybridRunbookWorkerGroupClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) GetResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of hybrid runbook worker groups. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.hrwglr.Response.Response != nil { + sc = result.hrwglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.hrwglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.hrwglr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.hrwglr.hasNextLink() && result.hrwglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountResponder(resp *http.Response) (result HybridRunbookWorkerGroupsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client HybridRunbookWorkerGroupClient) listByAutomationAccountNextResults(ctx context.Context, lastResults HybridRunbookWorkerGroupsListResult) (result HybridRunbookWorkerGroupsListResult, err error) { + req, err := lastResults.hybridRunbookWorkerGroupsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client HybridRunbookWorkerGroupClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result HybridRunbookWorkerGroupsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update a hybrid runbook worker group. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// hybridRunbookWorkerGroupName - the hybrid runbook worker group name +// parameters - the hybrid runbook worker group +func (client HybridRunbookWorkerGroupClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (result HybridRunbookWorkerGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.HybridRunbookWorkerGroupClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.HybridRunbookWorkerGroupClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client HybridRunbookWorkerGroupClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, hybridRunbookWorkerGroupName string, parameters HybridRunbookWorkerGroupUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "hybridRunbookWorkerGroupName": autorest.Encode("path", hybridRunbookWorkerGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client HybridRunbookWorkerGroupClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client HybridRunbookWorkerGroupClient) UpdateResponder(resp *http.Response) (result HybridRunbookWorkerGroup, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/job.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/job.go new file mode 100644 index 000000000000..9132caff3ff2 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/job.go @@ -0,0 +1,806 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// JobClient is the automation Client +type JobClient struct { + BaseClient +} + +// NewJobClient creates an instance of the JobClient client. +func NewJobClient(subscriptionID string) JobClient { + return NewJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobClientWithBaseURI creates an instance of the JobClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewJobClientWithBaseURI(baseURI string, subscriptionID string) JobClient { + return JobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a job of the runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// parameters - the parameters supplied to the create job operation. +// clientRequestID - identifies this specific client request. +func (client JobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.JobCreateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobName, parameters, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, parameters JobCreateParameters, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client JobClient) CreateResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobClient) GetResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOutput retrieve the job output identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the name of the job to be created. +// clientRequestID - identifies this specific client request. +func (client JobClient) GetOutput(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.GetOutput") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetOutput", err.Error()) + } + + req, err := client.GetOutputPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", nil, "Failure preparing request") + return + } + + resp, err := client.GetOutputSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure sending request") + return + } + + result, err = client.GetOutputResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetOutput", resp, "Failure responding to request") + return + } + + return +} + +// GetOutputPreparer prepares the GetOutput request. +func (client JobClient) GetOutputPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOutputSender sends the GetOutput request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetOutputSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOutputResponder handles the response to the GetOutput request. The method always +// closes the http.Response Body. +func (client JobClient) GetOutputResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRunbookContent retrieve the runbook content of the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) GetRunbookContent(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.GetRunbookContent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "GetRunbookContent", err.Error()) + } + + req, err := client.GetRunbookContentPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetRunbookContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure sending request") + return + } + + result, err = client.GetRunbookContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "GetRunbookContent", resp, "Failure responding to request") + return + } + + return +} + +// GetRunbookContentPreparer prepares the GetRunbookContent request. +func (client JobClient) GetRunbookContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRunbookContentSender sends the GetRunbookContent request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) GetRunbookContentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRunbookContentResponder handles the response to the GetRunbookContent request. The method always +// closes the http.Response Body. +func (client JobClient) GetRunbookContentResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +// clientRequestID - identifies this specific client request. +func (client JobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Page, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.jlrv.Response.Response != nil { + sc = result.jlrv.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.jlrv.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.jlrv, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.jlrv.hasNextLink() && result.jlrv.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client JobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client JobClient) ListByAutomationAccountResponder(resp *http.Response) (result JobListResultV2, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client JobClient) listByAutomationAccountNextResults(ctx context.Context, lastResults JobListResultV2) (result JobListResultV2, err error) { + req, err := lastResults.jobListResultV2Preparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string, clientRequestID string) (result JobListResultV2Iterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter, clientRequestID) + return +} + +// Resume resume the job identified by jobName. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Resume") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Resume", err.Error()) + } + + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", nil, "Failure preparing request") + return + } + + resp, err := client.ResumeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure sending request") + return + } + + result, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Resume", resp, "Failure responding to request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client JobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) ResumeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client JobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stop the job identified by jobName. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Stop") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Stop", resp, "Failure responding to request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client JobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) StopSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client JobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Suspend suspend the job identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// clientRequestID - identifies this specific client request. +func (client JobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobClient.Suspend") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobClient", "Suspend", err.Error()) + } + + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, jobName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", nil, "Failure preparing request") + return + } + + resp, err := client.SuspendSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure sending request") + return + } + + result, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobClient", "Suspend", resp, "Failure responding to request") + return + } + + return +} + +// SuspendPreparer prepares the Suspend request. +func (client JobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuspendSender sends the Suspend request. The method will close the +// http.Response Body if it receives an error. +func (client JobClient) SuspendSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SuspendResponder handles the response to the Suspend request. The method always +// closes the http.Response Body. +func (client JobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/jobschedule.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/jobschedule.go new file mode 100644 index 000000000000..9ec4c2662a71 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/jobschedule.go @@ -0,0 +1,428 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// JobScheduleClient is the automation Client +type JobScheduleClient struct { + BaseClient +} + +// NewJobScheduleClient creates an instance of the JobScheduleClient client. +func NewJobScheduleClient(subscriptionID string) JobScheduleClient { + return NewJobScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobScheduleClientWithBaseURI creates an instance of the JobScheduleClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewJobScheduleClientWithBaseURI(baseURI string, subscriptionID string) JobScheduleClient { + return JobScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a job schedule. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +// parameters - the parameters supplied to the create job schedule operation. +func (client JobScheduleClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (result JobSchedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.JobScheduleCreateProperties.Schedule", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.JobScheduleCreateProperties.Runbook", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client JobScheduleClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID, parameters JobScheduleCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) CreateResponder(resp *http.Response) (result JobSchedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the job schedule identified by job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +func (client JobScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client JobScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the job schedule identified by job schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobScheduleID - the job schedule name. +func (client JobScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (result JobSchedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobScheduleID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobScheduleID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobScheduleId": autorest.Encode("path", jobScheduleID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) GetResponder(resp *http.Response) (result JobSchedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of job schedules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client JobScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.jslr.Response.Response != nil { + sc = result.jslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobScheduleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.jslr.hasNextLink() && result.jslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client JobScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client JobScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client JobScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result JobScheduleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client JobScheduleClient) listByAutomationAccountNextResults(ctx context.Context, lastResults JobScheduleListResult) (result JobScheduleListResult, err error) { + req, err := lastResults.jobScheduleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result JobScheduleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/jobstream.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/jobstream.go new file mode 100644 index 000000000000..5b38cc41c429 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/jobstream.go @@ -0,0 +1,262 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// JobStreamClient is the automation Client +type JobStreamClient struct { + BaseClient +} + +// NewJobStreamClient creates an instance of the JobStreamClient client. +func NewJobStreamClient(subscriptionID string) JobStreamClient { + return NewJobStreamClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewJobStreamClientWithBaseURI creates an instance of the JobStreamClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewJobStreamClientWithBaseURI(baseURI string, subscriptionID string) JobStreamClient { + return JobStreamClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the job stream identified by job stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// jobStreamID - the job stream id. +// clientRequestID - identifies this specific client request. +func (client JobStreamClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (result JobStream, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, jobName, jobStreamID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client JobStreamClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, jobStreamID string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client JobStreamClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client JobStreamClient) GetResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByJob retrieve a list of jobs streams identified by job name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// jobName - the job name. +// filter - the filter to apply on the operation. +// clientRequestID - identifies this specific client request. +func (client JobStreamClient) ListByJob(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamClient.ListByJob") + defer func() { + sc := -1 + if result.jslr.Response.Response != nil { + sc = result.jslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.JobStreamClient", "ListByJob", err.Error()) + } + + result.fn = client.listByJobNextResults + req, err := client.ListByJobPreparer(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByJobSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "ListByJob", resp, "Failure responding to request") + return + } + if result.jslr.hasNextLink() && result.jslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByJobPreparer prepares the ListByJob request. +func (client JobStreamClient) ListByJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobName": autorest.Encode("path", jobName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByJobSender sends the ListByJob request. The method will close the +// http.Response Body if it receives an error. +func (client JobStreamClient) ListByJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByJobResponder handles the response to the ListByJob request. The method always +// closes the http.Response Body. +func (client JobStreamClient) ListByJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByJobNextResults retrieves the next set of results, if any. +func (client JobStreamClient) listByJobNextResults(ctx context.Context, lastResults JobStreamListResult) (result JobStreamListResult, err error) { + req, err := lastResults.jobStreamListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.JobStreamClient", "listByJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client JobStreamClient) ListByJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, jobName string, filter string, clientRequestID string) (result JobStreamListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamClient.ListByJob") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByJob(ctx, resourceGroupName, automationAccountName, jobName, filter, clientRequestID) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/keys.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/keys.go new file mode 100644 index 000000000000..5a803e6fb720 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/keys.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// KeysClient is the automation Client +type KeysClient struct { + BaseClient +} + +// NewKeysClient creates an instance of the KeysClient client. +func NewKeysClient(subscriptionID string) KeysClient { + return NewKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewKeysClientWithBaseURI creates an instance of the KeysClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewKeysClientWithBaseURI(baseURI string, subscriptionID string) KeysClient { + return KeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAutomationAccount retrieve the automation keys for an account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client KeysClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result KeyListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KeysClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.KeysClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.KeysClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client KeysClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client KeysClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client KeysClient) ListByAutomationAccountResponder(resp *http.Response) (result KeyListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/linkedworkspace.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/linkedworkspace.go new file mode 100644 index 000000000000..ad81f93bc941 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/linkedworkspace.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LinkedWorkspaceClient is the automation Client +type LinkedWorkspaceClient struct { + BaseClient +} + +// NewLinkedWorkspaceClient creates an instance of the LinkedWorkspaceClient client. +func NewLinkedWorkspaceClient(subscriptionID string) LinkedWorkspaceClient { + return NewLinkedWorkspaceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLinkedWorkspaceClientWithBaseURI creates an instance of the LinkedWorkspaceClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewLinkedWorkspaceClientWithBaseURI(baseURI string, subscriptionID string) LinkedWorkspaceClient { + return LinkedWorkspaceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the linked workspace for the account id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client LinkedWorkspaceClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string) (result LinkedWorkspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedWorkspaceClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.LinkedWorkspaceClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.LinkedWorkspaceClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkedWorkspaceClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/linkedWorkspace", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedWorkspaceClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LinkedWorkspaceClient) GetResponder(resp *http.Response) (result LinkedWorkspace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/models.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/models.go new file mode 100644 index 000000000000..c0d324c7a303 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/models.go @@ -0,0 +1,11239 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "io" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2020-01-13-preview/automation" + +// Account definition of the automation account type. +type Account struct { + autorest.Response `json:"-"` + // AccountProperties - Gets or sets the automation account properties. + *AccountProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + Identity *Identity `json:"identity,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Identity != nil { + objectMap["identity"] = a.Identity + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + if a.Location != nil { + objectMap["location"] = a.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + a.Identity = &identity + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AccountCreateOrUpdateParameters the parameters supplied to the create or update automation account +// operation. +type AccountCreateOrUpdateParameters struct { + // AccountCreateOrUpdateProperties - Gets or sets account create or update properties. + *AccountCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Identity - Sets the identity property for automation account + Identity *Identity `json:"identity,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountCreateOrUpdateParameters. +func (acoup AccountCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acoup.AccountCreateOrUpdateProperties != nil { + objectMap["properties"] = acoup.AccountCreateOrUpdateProperties + } + if acoup.Name != nil { + objectMap["name"] = acoup.Name + } + if acoup.Location != nil { + objectMap["location"] = acoup.Location + } + if acoup.Identity != nil { + objectMap["identity"] = acoup.Identity + } + if acoup.Tags != nil { + objectMap["tags"] = acoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountCreateOrUpdateParameters struct. +func (acoup *AccountCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountCreateOrUpdateProperties AccountCreateOrUpdateProperties + err = json.Unmarshal(*v, &accountCreateOrUpdateProperties) + if err != nil { + return err + } + acoup.AccountCreateOrUpdateProperties = &accountCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + acoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + acoup.Location = &location + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + acoup.Identity = &identity + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + acoup.Tags = tags + } + } + } + + return nil +} + +// AccountCreateOrUpdateProperties the parameters supplied to the create or update account properties. +type AccountCreateOrUpdateProperties struct { + // Sku - Gets or sets account SKU. + Sku *Sku `json:"sku,omitempty"` + // Encryption - Set the encryption properties for the automation account + Encryption *EncryptionProperties `json:"encryption,omitempty"` + // PublicNetworkAccess - Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet + PublicNetworkAccess *bool `json:"publicNetworkAccess,omitempty"` +} + +// AccountListResult the response model for the list account operation. +type AccountListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets list of accounts. + Value *[]Account `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// AccountListResultIterator provides access to a complete listing of Account values. +type AccountListResultIterator struct { + i int + page AccountListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AccountListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AccountListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AccountListResultIterator) Response() AccountListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AccountListResultIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AccountListResultIterator type. +func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { + return AccountListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr AccountListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (alr AccountListResult) hasNextLink() bool { + return alr.NextLink != nil && len(*alr.NextLink) != 0 +} + +// accountListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr AccountListResult) accountListResultPreparer(ctx context.Context) (*http.Request, error) { + if !alr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// AccountListResultPage contains a page of Account values. +type AccountListResultPage struct { + fn func(context.Context, AccountListResult) (AccountListResult, error) + alr AccountListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AccountListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AccountListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListResultPage) Response() AccountListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListResultPage) Values() []Account { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// Creates a new instance of the AccountListResultPage type. +func NewAccountListResultPage(cur AccountListResult, getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { + return AccountListResultPage{ + fn: getNextPage, + alr: cur, + } +} + +// AccountProperties definition of the account property. +type AccountProperties struct { + // Sku - Gets or sets the SKU of account. + Sku *Sku `json:"sku,omitempty"` + // LastModifiedBy - Gets or sets the last modified by. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // State - READ-ONLY; Gets status of account. Possible values include: 'AccountStateOk', 'AccountStateUnavailable', 'AccountStateSuspended' + State AccountState `json:"state,omitempty"` + // CreationTime - READ-ONLY; Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - READ-ONLY; Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` + // Encryption - Encryption properties for the automation account + Encryption *EncryptionProperties `json:"encryption,omitempty"` + // PrivateEndpointConnections - List of Automation operations supported by the Automation resource provider. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet + PublicNetworkAccess *bool `json:"publicNetworkAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountProperties. +func (ap AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.Sku != nil { + objectMap["sku"] = ap.Sku + } + if ap.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = ap.LastModifiedBy + } + if ap.Description != nil { + objectMap["description"] = ap.Description + } + if ap.Encryption != nil { + objectMap["encryption"] = ap.Encryption + } + if ap.PrivateEndpointConnections != nil { + objectMap["privateEndpointConnections"] = ap.PrivateEndpointConnections + } + if ap.PublicNetworkAccess != nil { + objectMap["publicNetworkAccess"] = ap.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// AccountUpdateParameters the parameters supplied to the update automation account operation. +type AccountUpdateParameters struct { + // AccountUpdateProperties - Gets or sets account update properties. + *AccountUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Identity - Sets the identity property for automation account + Identity *Identity `json:"identity,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.AccountUpdateProperties != nil { + objectMap["properties"] = aup.AccountUpdateProperties + } + if aup.Name != nil { + objectMap["name"] = aup.Name + } + if aup.Location != nil { + objectMap["location"] = aup.Location + } + if aup.Identity != nil { + objectMap["identity"] = aup.Identity + } + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. +func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accountUpdateProperties AccountUpdateProperties + err = json.Unmarshal(*v, &accountUpdateProperties) + if err != nil { + return err + } + aup.AccountUpdateProperties = &accountUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + aup.Location = &location + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + aup.Identity = &identity + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aup.Tags = tags + } + } + } + + return nil +} + +// AccountUpdateProperties the parameters supplied to the update account properties. +type AccountUpdateProperties struct { + // Sku - Gets or sets account SKU. + Sku *Sku `json:"sku,omitempty"` + // Encryption - Set the encryption properties for the automation account + Encryption *EncryptionProperties `json:"encryption,omitempty"` + // PublicNetworkAccess - Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet + PublicNetworkAccess *bool `json:"publicNetworkAccess,omitempty"` +} + +// Activity definition of the activity. +type Activity struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the name of the activity. + Name *string `json:"name,omitempty"` + // ActivityProperties - Gets or sets the properties of the activity. + *ActivityProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for Activity. +func (a Activity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.ID != nil { + objectMap["id"] = a.ID + } + if a.ActivityProperties != nil { + objectMap["properties"] = a.ActivityProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Activity struct. +func (a *Activity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "properties": + if v != nil { + var activityProperties ActivityProperties + err = json.Unmarshal(*v, &activityProperties) + if err != nil { + return err + } + a.ActivityProperties = &activityProperties + } + } + } + + return nil +} + +// ActivityListResult the response model for the list activity operation. +type ActivityListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of activities. + Value *[]Activity `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ActivityListResultIterator provides access to a complete listing of Activity values. +type ActivityListResultIterator struct { + i int + page ActivityListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ActivityListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActivityListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ActivityListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ActivityListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ActivityListResultIterator) Response() ActivityListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ActivityListResultIterator) Value() Activity { + if !iter.page.NotDone() { + return Activity{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ActivityListResultIterator type. +func NewActivityListResultIterator(page ActivityListResultPage) ActivityListResultIterator { + return ActivityListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr ActivityListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (alr ActivityListResult) hasNextLink() bool { + return alr.NextLink != nil && len(*alr.NextLink) != 0 +} + +// activityListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr ActivityListResult) activityListResultPreparer(ctx context.Context) (*http.Request, error) { + if !alr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// ActivityListResultPage contains a page of Activity values. +type ActivityListResultPage struct { + fn func(context.Context, ActivityListResult) (ActivityListResult, error) + alr ActivityListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ActivityListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActivityListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ActivityListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ActivityListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ActivityListResultPage) Response() ActivityListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ActivityListResultPage) Values() []Activity { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// Creates a new instance of the ActivityListResultPage type. +func NewActivityListResultPage(cur ActivityListResult, getNextPage func(context.Context, ActivityListResult) (ActivityListResult, error)) ActivityListResultPage { + return ActivityListResultPage{ + fn: getNextPage, + alr: cur, + } +} + +// ActivityOutputType definition of the activity output type. +type ActivityOutputType struct { + // Name - Gets or sets the name of the activity output type. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the activity output type. + Type *string `json:"type,omitempty"` +} + +// ActivityParameter definition of the activity parameter. +type ActivityParameter struct { + // Name - Gets or sets the name of the activity parameter. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the activity parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value that indicates true if the parameter is required. If the value is false, the parameter is optional. + IsMandatory *bool `json:"isMandatory,omitempty"` + // IsDynamic - Gets or sets a Boolean value that indicates true if the parameter is dynamic. + IsDynamic *bool `json:"isDynamic,omitempty"` + // Position - Gets or sets the position of the activity parameter. + Position *int64 `json:"position,omitempty"` + // ValueFromPipeline - Gets or sets a Boolean value that indicates true if the parameter can take values from the incoming pipeline objects. This setting is used if the cmdlet must access the complete input object. false indicates that the parameter cannot take values from the complete input object. + ValueFromPipeline *bool `json:"valueFromPipeline,omitempty"` + // ValueFromPipelineByPropertyName - Gets or sets a Boolean value that indicates true if the parameter can be filled from a property of the incoming pipeline object that has the same name as this parameter. false indicates that the parameter cannot be filled from the incoming pipeline object property with the same name. + ValueFromPipelineByPropertyName *bool `json:"valueFromPipelineByPropertyName,omitempty"` + // ValueFromRemainingArguments - Gets or sets a Boolean value that indicates true if the cmdlet parameter accepts all the remaining command-line arguments that are associated with this parameter in the form of an array. false if the cmdlet parameter does not accept all the remaining argument values. + ValueFromRemainingArguments *bool `json:"valueFromRemainingArguments,omitempty"` + // Description - Gets or sets the description of the activity parameter. + Description *string `json:"description,omitempty"` + // ValidationSet - Gets or sets the validation set of activity parameter. + ValidationSet *[]ActivityParameterValidationSet `json:"validationSet,omitempty"` +} + +// ActivityParameterSet definition of the activity parameter set. +type ActivityParameterSet struct { + // Name - Gets or sets the name of the activity parameter set. + Name *string `json:"name,omitempty"` + // Parameters - Gets or sets the parameters of the activity parameter set. + Parameters *[]ActivityParameter `json:"parameters,omitempty"` +} + +// ActivityParameterValidationSet definition of the activity parameter validation set. +type ActivityParameterValidationSet struct { + // MemberValue - Gets or sets the name of the activity parameter validation set member. + MemberValue *string `json:"memberValue,omitempty"` +} + +// ActivityProperties properties of the activity. +type ActivityProperties struct { + // Definition - Gets or sets the user name of the activity. + Definition *string `json:"definition,omitempty"` + // ParameterSets - Gets or sets the parameter sets of the activity. + ParameterSets *[]ActivityParameterSet `json:"parameterSets,omitempty"` + // OutputTypes - Gets or sets the output types of the activity. + OutputTypes *[]ActivityOutputType `json:"outputTypes,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// AdvancedSchedule the properties of the create Advanced Schedule. +type AdvancedSchedule struct { + // WeekDays - Days of the week that the job should execute on. + WeekDays *[]string `json:"weekDays,omitempty"` + // MonthDays - Days of the month that the job should execute on. Must be between 1 and 31. + MonthDays *[]int32 `json:"monthDays,omitempty"` + // MonthlyOccurrences - Occurrences of days within a month. + MonthlyOccurrences *[]AdvancedScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"` +} + +// AdvancedScheduleMonthlyOccurrence the properties of the create advanced schedule monthly occurrence. +type AdvancedScheduleMonthlyOccurrence struct { + // Occurrence - Occurrence of the week within the month. Must be between 1 and 5 + Occurrence *int32 `json:"occurrence,omitempty"` + // Day - Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'ScheduleDayMonday', 'ScheduleDayTuesday', 'ScheduleDayWednesday', 'ScheduleDayThursday', 'ScheduleDayFriday', 'ScheduleDaySaturday', 'ScheduleDaySunday' + Day ScheduleDay `json:"day,omitempty"` +} + +// AgentRegistration definition of the agent registration information type. +type AgentRegistration struct { + autorest.Response `json:"-"` + // DscMetaConfiguration - Gets or sets the dsc meta configuration. + DscMetaConfiguration *string `json:"dscMetaConfiguration,omitempty"` + // Endpoint - Gets or sets the dsc server endpoint. + Endpoint *string `json:"endpoint,omitempty"` + // Keys - Gets or sets the agent registration keys. + Keys *AgentRegistrationKeys `json:"keys,omitempty"` + // ID - Gets or sets the id. + ID *string `json:"id,omitempty"` +} + +// AgentRegistrationKeys definition of the agent registration keys. +type AgentRegistrationKeys struct { + // Primary - Gets or sets the primary key. + Primary *string `json:"primary,omitempty"` + // Secondary - Gets or sets the secondary key. + Secondary *string `json:"secondary,omitempty"` +} + +// AgentRegistrationRegenerateKeyParameter the parameters supplied to the regenerate keys operation. +type AgentRegistrationRegenerateKeyParameter struct { + // KeyName - Gets or sets the agent registration key name - primary or secondary. Possible values include: 'AgentRegistrationKeyNamePrimary', 'AgentRegistrationKeyNameSecondary' + KeyName AgentRegistrationKeyName `json:"keyName,omitempty"` +} + +// AzureQueryProperties azure query for the update configuration. +type AzureQueryProperties struct { + // Scope - List of Subscription or Resource Group ARM Ids. + Scope *[]string `json:"scope,omitempty"` + // Locations - List of locations to scope the query to. + Locations *[]string `json:"locations,omitempty"` + // TagSettings - Tag settings for the VM. + TagSettings *TagSettingsProperties `json:"tagSettings,omitempty"` +} + +// Certificate definition of the certificate. +type Certificate struct { + autorest.Response `json:"-"` + // CertificateProperties - Gets or sets the properties of the certificate. + *CertificateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CertificateProperties != nil { + objectMap["properties"] = c.CertificateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Certificate struct. +func (c *Certificate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateProperties CertificateProperties + err = json.Unmarshal(*v, &certificateProperties) + if err != nil { + return err + } + c.CertificateProperties = &certificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// CertificateCreateOrUpdateParameters the parameters supplied to the create or update or replace +// certificate operation. +type CertificateCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the certificate. + Name *string `json:"name,omitempty"` + // CertificateCreateOrUpdateProperties - Gets or sets the properties of the certificate. + *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. +func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CertificateCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. +func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties + err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + } + } + } + + return nil +} + +// CertificateCreateOrUpdateProperties the properties of the create certificate operation. +type CertificateCreateOrUpdateProperties struct { + // Base64Value - Gets or sets the base64 encoded value of the certificate. + Base64Value *string `json:"base64Value,omitempty"` + // Description - Gets or sets the description of the certificate. + Description *string `json:"description,omitempty"` + // Thumbprint - Gets or sets the thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // IsExportable - Gets or sets the is exportable flag of the certificate. + IsExportable *bool `json:"isExportable,omitempty"` +} + +// CertificateListResult the response model for the list certificate operation. +type CertificateListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of certificates. + Value *[]Certificate `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// CertificateListResultIterator provides access to a complete listing of Certificate values. +type CertificateListResultIterator struct { + i int + page CertificateListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CertificateListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CertificateListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CertificateListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CertificateListResultIterator) Response() CertificateListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CertificateListResultIterator) Value() Certificate { + if !iter.page.NotDone() { + return Certificate{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CertificateListResultIterator type. +func NewCertificateListResultIterator(page CertificateListResultPage) CertificateListResultIterator { + return CertificateListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +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.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CertificateListResultPage contains a page of Certificate values. +type CertificateListResultPage struct { + fn func(context.Context, CertificateListResult) (CertificateListResult, error) + clr CertificateListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CertificateListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CertificateListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CertificateListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CertificateListResultPage) Response() CertificateListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CertificateListResultPage) Values() []Certificate { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the CertificateListResultPage type. +func NewCertificateListResultPage(cur CertificateListResult, getNextPage func(context.Context, CertificateListResult) (CertificateListResult, error)) CertificateListResultPage { + return CertificateListResultPage{ + fn: getNextPage, + clr: cur, + } +} + +// CertificateProperties properties of the certificate. +type CertificateProperties struct { + // Thumbprint - READ-ONLY; Gets the thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // ExpiryTime - READ-ONLY; Gets the expiry time of the certificate. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // IsExportable - READ-ONLY; Gets the is exportable flag of the certificate. + IsExportable *bool `json:"isExportable,omitempty"` + // CreationTime - READ-ONLY; Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - READ-ONLY; Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateProperties. +func (cp CertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Description != nil { + objectMap["description"] = cp.Description + } + return json.Marshal(objectMap) +} + +// CertificateUpdateParameters the parameters supplied to the update certificate operation. +type CertificateUpdateParameters struct { + // Name - Gets or sets the name of the certificate. + Name *string `json:"name,omitempty"` + // CertificateUpdateProperties - Gets or sets the properties of the certificate. + *CertificateUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateUpdateParameters. +func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CertificateUpdateProperties != nil { + objectMap["properties"] = cup.CertificateUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateUpdateParameters struct. +func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var certificateUpdateProperties CertificateUpdateProperties + err = json.Unmarshal(*v, &certificateUpdateProperties) + if err != nil { + return err + } + cup.CertificateUpdateProperties = &certificateUpdateProperties + } + } + } + + return nil +} + +// CertificateUpdateProperties the properties of the update certificate operation +type CertificateUpdateProperties struct { + // Description - Gets or sets the description of the certificate. + Description *string `json:"description,omitempty"` +} + +// Connection definition of the connection. +type Connection struct { + autorest.Response `json:"-"` + // ConnectionProperties - Gets or sets the properties of the connection. + *ConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Connection. +func (c Connection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ConnectionProperties != nil { + objectMap["properties"] = c.ConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Connection struct. +func (c *Connection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var connectionProperties ConnectionProperties + err = json.Unmarshal(*v, &connectionProperties) + if err != nil { + return err + } + c.ConnectionProperties = &connectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ConnectionCreateOrUpdateParameters the parameters supplied to the create or update connection operation. +type ConnectionCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the connection. + Name *string `json:"name,omitempty"` + // ConnectionCreateOrUpdateProperties - Gets or sets the properties of the connection. + *ConnectionCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateParameters. +func (ccoup ConnectionCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.ConnectionCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.ConnectionCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionCreateOrUpdateParameters struct. +func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var connectionCreateOrUpdateProperties ConnectionCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.ConnectionCreateOrUpdateProperties = &connectionCreateOrUpdateProperties + } + } + } + + return nil +} + +// ConnectionCreateOrUpdateProperties the properties of the create connection properties +type ConnectionCreateOrUpdateProperties struct { + // Description - Gets or sets the description of the connection. + Description *string `json:"description,omitempty"` + // ConnectionType - Gets or sets the connectionType of the connection. + ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` + // FieldDefinitionValues - Gets or sets the field definition properties of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateProperties. +func (ccoup ConnectionCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Description != nil { + objectMap["description"] = ccoup.Description + } + if ccoup.ConnectionType != nil { + objectMap["connectionType"] = ccoup.ConnectionType + } + if ccoup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = ccoup.FieldDefinitionValues + } + return json.Marshal(objectMap) +} + +// ConnectionListResult the response model for the list connection operation. +type ConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of connection. + Value *[]Connection `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConnectionListResultIterator provides access to a complete listing of Connection values. +type ConnectionListResultIterator struct { + i int + page ConnectionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ConnectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectionListResultIterator) Response() ConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectionListResultIterator) Value() Connection { + if !iter.page.NotDone() { + return Connection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConnectionListResultIterator type. +func NewConnectionListResultIterator(page ConnectionListResultPage) ConnectionListResultIterator { + return ConnectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr ConnectionListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (clr ConnectionListResult) hasNextLink() bool { + return clr.NextLink != nil && len(*clr.NextLink) != 0 +} + +// connectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr ConnectionListResult) connectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !clr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// ConnectionListResultPage contains a page of Connection values. +type ConnectionListResultPage struct { + fn func(context.Context, ConnectionListResult) (ConnectionListResult, error) + clr ConnectionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ConnectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectionListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectionListResultPage) Response() ConnectionListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectionListResultPage) Values() []Connection { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the ConnectionListResultPage type. +func NewConnectionListResultPage(cur ConnectionListResult, getNextPage func(context.Context, ConnectionListResult) (ConnectionListResult, error)) ConnectionListResultPage { + return ConnectionListResultPage{ + fn: getNextPage, + clr: cur, + } +} + +// ConnectionProperties definition of the connection properties. +type ConnectionProperties struct { + // ConnectionType - Gets or sets the connectionType of the connection. + ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` + // FieldDefinitionValues - READ-ONLY; Gets the field definition values of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` + // CreationTime - READ-ONLY; Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - READ-ONLY; Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionProperties. +func (cp ConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.ConnectionType != nil { + objectMap["connectionType"] = cp.ConnectionType + } + if cp.Description != nil { + objectMap["description"] = cp.Description + } + return json.Marshal(objectMap) +} + +// ConnectionType definition of the connection type. +type ConnectionType struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Gets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the name of the connection type. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // ConnectionTypeProperties - Gets or sets the properties of the connection type. + *ConnectionTypeProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionType. +func (ct ConnectionType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ct.ConnectionTypeProperties != nil { + objectMap["properties"] = ct.ConnectionTypeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionType struct. +func (ct *ConnectionType) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ct.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ct.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ct.Type = &typeVar + } + case "properties": + if v != nil { + var connectionTypeProperties ConnectionTypeProperties + err = json.Unmarshal(*v, &connectionTypeProperties) + if err != nil { + return err + } + ct.ConnectionTypeProperties = &connectionTypeProperties + } + } + } + + return nil +} + +// ConnectionTypeAssociationProperty the connection type property associated with the entity. +type ConnectionTypeAssociationProperty struct { + // Name - Gets or sets the name of the connection type. + Name *string `json:"name,omitempty"` +} + +// ConnectionTypeCreateOrUpdateParameters the parameters supplied to the create or update connection type +// operation. +type ConnectionTypeCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the connection type. + Name *string `json:"name,omitempty"` + // ConnectionTypeCreateOrUpdateProperties - Gets or sets the value of the connection type. + *ConnectionTypeCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateParameters. +func (ctcoup ConnectionTypeCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.Name != nil { + objectMap["name"] = ctcoup.Name + } + if ctcoup.ConnectionTypeCreateOrUpdateProperties != nil { + objectMap["properties"] = ctcoup.ConnectionTypeCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionTypeCreateOrUpdateParameters struct. +func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ctcoup.Name = &name + } + case "properties": + if v != nil { + var connectionTypeCreateOrUpdateProperties ConnectionTypeCreateOrUpdateProperties + err = json.Unmarshal(*v, &connectionTypeCreateOrUpdateProperties) + if err != nil { + return err + } + ctcoup.ConnectionTypeCreateOrUpdateProperties = &connectionTypeCreateOrUpdateProperties + } + } + } + + return nil +} + +// ConnectionTypeCreateOrUpdateProperties the properties of the create connection type. +type ConnectionTypeCreateOrUpdateProperties struct { + // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. + IsGlobal *bool `json:"isGlobal,omitempty"` + // FieldDefinitions - Gets or sets the field definitions of the connection type. + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateProperties. +func (ctcoup ConnectionTypeCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctcoup.IsGlobal != nil { + objectMap["isGlobal"] = ctcoup.IsGlobal + } + if ctcoup.FieldDefinitions != nil { + objectMap["fieldDefinitions"] = ctcoup.FieldDefinitions + } + return json.Marshal(objectMap) +} + +// ConnectionTypeListResult the response model for the list connection type operation. +type ConnectionTypeListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of connection types. + Value *[]ConnectionType `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConnectionTypeListResultIterator provides access to a complete listing of ConnectionType values. +type ConnectionTypeListResultIterator struct { + i int + page ConnectionTypeListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectionTypeListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ConnectionTypeListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectionTypeListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectionTypeListResultIterator) Response() ConnectionTypeListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectionTypeListResultIterator) Value() ConnectionType { + if !iter.page.NotDone() { + return ConnectionType{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConnectionTypeListResultIterator type. +func NewConnectionTypeListResultIterator(page ConnectionTypeListResultPage) ConnectionTypeListResultIterator { + return ConnectionTypeListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ctlr ConnectionTypeListResult) IsEmpty() bool { + return ctlr.Value == nil || len(*ctlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ctlr ConnectionTypeListResult) hasNextLink() bool { + return ctlr.NextLink != nil && len(*ctlr.NextLink) != 0 +} + +// connectionTypeListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ctlr ConnectionTypeListResult) connectionTypeListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ctlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ctlr.NextLink))) +} + +// ConnectionTypeListResultPage contains a page of ConnectionType values. +type ConnectionTypeListResultPage struct { + fn func(context.Context, ConnectionTypeListResult) (ConnectionTypeListResult, error) + ctlr ConnectionTypeListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectionTypeListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ctlr) + if err != nil { + return err + } + page.ctlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ConnectionTypeListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectionTypeListResultPage) NotDone() bool { + return !page.ctlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectionTypeListResultPage) Response() ConnectionTypeListResult { + return page.ctlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectionTypeListResultPage) Values() []ConnectionType { + if page.ctlr.IsEmpty() { + return nil + } + return *page.ctlr.Value +} + +// Creates a new instance of the ConnectionTypeListResultPage type. +func NewConnectionTypeListResultPage(cur ConnectionTypeListResult, getNextPage func(context.Context, ConnectionTypeListResult) (ConnectionTypeListResult, error)) ConnectionTypeListResultPage { + return ConnectionTypeListResultPage{ + fn: getNextPage, + ctlr: cur, + } +} + +// ConnectionTypeProperties properties of the connection type. +type ConnectionTypeProperties struct { + // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. + IsGlobal *bool `json:"isGlobal,omitempty"` + // FieldDefinitions - READ-ONLY; Gets the field definitions of the connection type. + FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` + // CreationTime - READ-ONLY; Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionTypeProperties. +func (ctp ConnectionTypeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ctp.IsGlobal != nil { + objectMap["isGlobal"] = ctp.IsGlobal + } + if ctp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = ctp.LastModifiedTime + } + if ctp.Description != nil { + objectMap["description"] = ctp.Description + } + return json.Marshal(objectMap) +} + +// ConnectionUpdateParameters the parameters supplied to the update connection operation. +type ConnectionUpdateParameters struct { + // Name - Gets or sets the name of the connection. + Name *string `json:"name,omitempty"` + // ConnectionUpdateProperties - Gets or sets the properties of the connection. + *ConnectionUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionUpdateParameters. +func (cup ConnectionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.ConnectionUpdateProperties != nil { + objectMap["properties"] = cup.ConnectionUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectionUpdateParameters struct. +func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var connectionUpdateProperties ConnectionUpdateProperties + err = json.Unmarshal(*v, &connectionUpdateProperties) + if err != nil { + return err + } + cup.ConnectionUpdateProperties = &connectionUpdateProperties + } + } + } + + return nil +} + +// ConnectionUpdateProperties the properties of the update connection operation. +type ConnectionUpdateProperties struct { + // Description - Gets or sets the description of the connection. + Description *string `json:"description,omitempty"` + // FieldDefinitionValues - Gets or sets the field definition values of the connection. + FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` +} + +// MarshalJSON is the custom marshaler for ConnectionUpdateProperties. +func (cup ConnectionUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Description != nil { + objectMap["description"] = cup.Description + } + if cup.FieldDefinitionValues != nil { + objectMap["fieldDefinitionValues"] = cup.FieldDefinitionValues + } + return json.Marshal(objectMap) +} + +// ContentHash definition of the runbook property type. +type ContentHash struct { + // Algorithm - Gets or sets the content hash algorithm used to hash the content. + Algorithm *string `json:"algorithm,omitempty"` + // Value - Gets or sets expected hash value of the content. + Value *string `json:"value,omitempty"` +} + +// ContentLink definition of the content link. +type ContentLink struct { + // URI - Gets or sets the uri of the runbook content. + URI *string `json:"uri,omitempty"` + // ContentHash - Gets or sets the hash. + ContentHash *ContentHash `json:"contentHash,omitempty"` + // Version - Gets or sets the version of the content. + Version *string `json:"version,omitempty"` +} + +// ContentSource definition of the content source. +type ContentSource struct { + // Hash - Gets or sets the hash. + Hash *ContentHash `json:"hash,omitempty"` + // Type - Gets or sets the content source type. Possible values include: 'ContentSourceTypeEmbeddedContent', 'ContentSourceTypeURI' + Type ContentSourceType `json:"type,omitempty"` + // Value - Gets or sets the value of the content. This is based on the content source type. + Value *string `json:"value,omitempty"` + // Version - Gets or sets the version of the content. + Version *string `json:"version,omitempty"` +} + +// Credential definition of the credential. +type Credential struct { + autorest.Response `json:"-"` + // CredentialProperties - Gets or sets the properties of the credential. + *CredentialProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Credential. +func (c Credential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CredentialProperties != nil { + objectMap["properties"] = c.CredentialProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Credential struct. +func (c *Credential) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var credentialProperties CredentialProperties + err = json.Unmarshal(*v, &credentialProperties) + if err != nil { + return err + } + c.CredentialProperties = &credentialProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// CredentialCreateOrUpdateParameters the parameters supplied to the create or update credential operation. +type CredentialCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` + // CredentialCreateOrUpdateProperties - Gets or sets the properties of the credential. + *CredentialCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialCreateOrUpdateParameters. +func (ccoup CredentialCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.Name != nil { + objectMap["name"] = ccoup.Name + } + if ccoup.CredentialCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CredentialCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CredentialCreateOrUpdateParameters struct. +func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ccoup.Name = &name + } + case "properties": + if v != nil { + var credentialCreateOrUpdateProperties CredentialCreateOrUpdateProperties + err = json.Unmarshal(*v, &credentialCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CredentialCreateOrUpdateProperties = &credentialCreateOrUpdateProperties + } + } + } + + return nil +} + +// CredentialCreateOrUpdateProperties the properties of the create credential operation. +type CredentialCreateOrUpdateProperties struct { + // UserName - Gets or sets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // Password - Gets or sets the password of the credential. + Password *string `json:"password,omitempty"` + // Description - Gets or sets the description of the credential. + Description *string `json:"description,omitempty"` +} + +// CredentialListResult the response model for the list credential operation. +type CredentialListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of credentials. + Value *[]Credential `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// CredentialListResultIterator provides access to a complete listing of Credential values. +type CredentialListResultIterator struct { + i int + page CredentialListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CredentialListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CredentialListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CredentialListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CredentialListResultIterator) Response() CredentialListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CredentialListResultIterator) Value() Credential { + if !iter.page.NotDone() { + return Credential{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CredentialListResultIterator type. +func NewCredentialListResultIterator(page CredentialListResultPage) CredentialListResultIterator { + return CredentialListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CredentialListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (clr CredentialListResult) hasNextLink() bool { + return clr.NextLink != nil && len(*clr.NextLink) != 0 +} + +// credentialListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CredentialListResult) credentialListResultPreparer(ctx context.Context) (*http.Request, error) { + if !clr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CredentialListResultPage contains a page of Credential values. +type CredentialListResultPage struct { + fn func(context.Context, CredentialListResult) (CredentialListResult, error) + clr CredentialListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CredentialListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CredentialListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CredentialListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CredentialListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CredentialListResultPage) Response() CredentialListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CredentialListResultPage) Values() []Credential { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the CredentialListResultPage type. +func NewCredentialListResultPage(cur CredentialListResult, getNextPage func(context.Context, CredentialListResult) (CredentialListResult, error)) CredentialListResultPage { + return CredentialListResultPage{ + fn: getNextPage, + clr: cur, + } +} + +// CredentialProperties definition of the credential properties +type CredentialProperties struct { + // UserName - READ-ONLY; Gets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // CreationTime - READ-ONLY; Gets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - READ-ONLY; Gets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialProperties. +func (cp CredentialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.Description != nil { + objectMap["description"] = cp.Description + } + return json.Marshal(objectMap) +} + +// CredentialUpdateParameters the parameters supplied to the Update credential operation. +type CredentialUpdateParameters struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` + // CredentialUpdateProperties - Gets or sets the properties of the variable. + *CredentialUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CredentialUpdateParameters. +func (cup CredentialUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.Name != nil { + objectMap["name"] = cup.Name + } + if cup.CredentialUpdateProperties != nil { + objectMap["properties"] = cup.CredentialUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CredentialUpdateParameters struct. +func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cup.Name = &name + } + case "properties": + if v != nil { + var credentialUpdateProperties CredentialUpdateProperties + err = json.Unmarshal(*v, &credentialUpdateProperties) + if err != nil { + return err + } + cup.CredentialUpdateProperties = &credentialUpdateProperties + } + } + } + + return nil +} + +// CredentialUpdateProperties the properties of the Update credential +type CredentialUpdateProperties struct { + // UserName - Gets or sets the user name of the credential. + UserName *string `json:"userName,omitempty"` + // Password - Gets or sets the password of the credential. + Password *string `json:"password,omitempty"` + // Description - Gets or sets the description of the credential. + Description *string `json:"description,omitempty"` +} + +// DscCompilationJob definition of the Dsc Compilation job. +type DscCompilationJob struct { + autorest.Response `json:"-"` + // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. + *DscCompilationJobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJob. +func (dcj DscCompilationJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcj.DscCompilationJobProperties != nil { + objectMap["properties"] = dcj.DscCompilationJobProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscCompilationJob struct. +func (dcj *DscCompilationJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscCompilationJobProperties DscCompilationJobProperties + err = json.Unmarshal(*v, &dscCompilationJobProperties) + if err != nil { + return err + } + dcj.DscCompilationJobProperties = &dscCompilationJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dcj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcj.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dcj.Type = &typeVar + } + } + } + + return nil +} + +// DscCompilationJobCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DscCompilationJobCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DscCompilationJobClient) (DscCompilationJob, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DscCompilationJobCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DscCompilationJobCreateFuture.Result. +func (future *DscCompilationJobCreateFuture) result(client DscCompilationJobClient) (dcj DscCompilationJob, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dcj.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("automation.DscCompilationJobCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dcj.Response.Response, err = future.GetResult(sender); err == nil && dcj.Response.Response.StatusCode != http.StatusNoContent { + dcj, err = client.CreateResponder(dcj.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscCompilationJobCreateFuture", "Result", dcj.Response.Response, "Failure responding to request") + } + } + return +} + +// DscCompilationJobCreateParameters the parameters supplied to the create compilation job operation. +type DscCompilationJobCreateParameters struct { + // DscCompilationJobCreateProperties - Gets or sets the list of compilation job properties. + *DscCompilationJobCreateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobCreateParameters. +func (dcjcp DscCompilationJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.DscCompilationJobCreateProperties != nil { + objectMap["properties"] = dcjcp.DscCompilationJobCreateProperties + } + if dcjcp.Name != nil { + objectMap["name"] = dcjcp.Name + } + if dcjcp.Location != nil { + objectMap["location"] = dcjcp.Location + } + if dcjcp.Tags != nil { + objectMap["tags"] = dcjcp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscCompilationJobCreateParameters struct. +func (dcjcp *DscCompilationJobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscCompilationJobCreateProperties DscCompilationJobCreateProperties + err = json.Unmarshal(*v, &dscCompilationJobCreateProperties) + if err != nil { + return err + } + dcjcp.DscCompilationJobCreateProperties = &dscCompilationJobCreateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcjcp.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dcjcp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcjcp.Tags = tags + } + } + } + + return nil +} + +// DscCompilationJobCreateProperties the parameters supplied to the create compilation job operation. +type DscCompilationJobCreateProperties struct { + // Configuration - Gets or sets the configuration. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobCreateProperties. +func (dcjcp DscCompilationJobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjcp.Configuration != nil { + objectMap["configuration"] = dcjcp.Configuration + } + if dcjcp.Parameters != nil { + objectMap["parameters"] = dcjcp.Parameters + } + if dcjcp.IncrementNodeConfigurationBuild != nil { + objectMap["incrementNodeConfigurationBuild"] = dcjcp.IncrementNodeConfigurationBuild + } + return json.Marshal(objectMap) +} + +// DscCompilationJobListResult the response model for the list job operation. +type DscCompilationJobListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of Dsc Compilation jobs. + Value *[]DscCompilationJob `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscCompilationJobListResultIterator provides access to a complete listing of DscCompilationJob values. +type DscCompilationJobListResultIterator struct { + i int + page DscCompilationJobListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscCompilationJobListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DscCompilationJobListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscCompilationJobListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscCompilationJobListResultIterator) Response() DscCompilationJobListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscCompilationJobListResultIterator) Value() DscCompilationJob { + if !iter.page.NotDone() { + return DscCompilationJob{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DscCompilationJobListResultIterator type. +func NewDscCompilationJobListResultIterator(page DscCompilationJobListResultPage) DscCompilationJobListResultIterator { + return DscCompilationJobListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dcjlr DscCompilationJobListResult) IsEmpty() bool { + return dcjlr.Value == nil || len(*dcjlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dcjlr DscCompilationJobListResult) hasNextLink() bool { + return dcjlr.NextLink != nil && len(*dcjlr.NextLink) != 0 +} + +// dscCompilationJobListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dcjlr DscCompilationJobListResult) dscCompilationJobListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dcjlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dcjlr.NextLink))) +} + +// DscCompilationJobListResultPage contains a page of DscCompilationJob values. +type DscCompilationJobListResultPage struct { + fn func(context.Context, DscCompilationJobListResult) (DscCompilationJobListResult, error) + dcjlr DscCompilationJobListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscCompilationJobListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dcjlr) + if err != nil { + return err + } + page.dcjlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DscCompilationJobListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscCompilationJobListResultPage) NotDone() bool { + return !page.dcjlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscCompilationJobListResultPage) Response() DscCompilationJobListResult { + return page.dcjlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscCompilationJobListResultPage) Values() []DscCompilationJob { + if page.dcjlr.IsEmpty() { + return nil + } + return *page.dcjlr.Value +} + +// Creates a new instance of the DscCompilationJobListResultPage type. +func NewDscCompilationJobListResultPage(cur DscCompilationJobListResult, getNextPage func(context.Context, DscCompilationJobListResult) (DscCompilationJobListResult, error)) DscCompilationJobListResultPage { + return DscCompilationJobListResultPage{ + fn: getNextPage, + dcjlr: cur, + } +} + +// DscCompilationJobProperties definition of Dsc Compilation job properties. +type DscCompilationJobProperties struct { + // Configuration - Gets or sets the configuration. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // StartedBy - READ-ONLY; Gets the compilation job started by. + StartedBy *string `json:"startedBy,omitempty"` + // JobID - READ-ONLY; Gets the id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - READ-ONLY; Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the job. + StatusDetails *string `json:"statusDetails,omitempty"` + // StartTime - READ-ONLY; Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - READ-ONLY; Gets the exception of the job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - READ-ONLY; Gets the last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - READ-ONLY; Gets the last status modified time of the job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for DscCompilationJobProperties. +func (dcjp DscCompilationJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcjp.Configuration != nil { + objectMap["configuration"] = dcjp.Configuration + } + if dcjp.ProvisioningState != "" { + objectMap["provisioningState"] = dcjp.ProvisioningState + } + if dcjp.RunOn != nil { + objectMap["runOn"] = dcjp.RunOn + } + if dcjp.Status != "" { + objectMap["status"] = dcjp.Status + } + if dcjp.StatusDetails != nil { + objectMap["statusDetails"] = dcjp.StatusDetails + } + if dcjp.Parameters != nil { + objectMap["parameters"] = dcjp.Parameters + } + return json.Marshal(objectMap) +} + +// DscConfiguration definition of the configuration type. +type DscConfiguration struct { + autorest.Response `json:"-"` + // DscConfigurationProperties - Gets or sets the configuration properties. + *DscConfigurationProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfiguration. +func (dc DscConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.DscConfigurationProperties != nil { + objectMap["properties"] = dc.DscConfigurationProperties + } + if dc.Etag != nil { + objectMap["etag"] = dc.Etag + } + if dc.Tags != nil { + objectMap["tags"] = dc.Tags + } + if dc.Location != nil { + objectMap["location"] = dc.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfiguration struct. +func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationProperties DscConfigurationProperties + err = json.Unmarshal(*v, &dscConfigurationProperties) + if err != nil { + return err + } + dc.DscConfigurationProperties = &dscConfigurationProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dc.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dc.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dc.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar + } + } + } + + return nil +} + +// DscConfigurationAssociationProperty the Dsc configuration property associated with the entity. +type DscConfigurationAssociationProperty struct { + // Name - Gets or sets the name of the Dsc configuration. + Name *string `json:"name,omitempty"` +} + +// DscConfigurationCreateOrUpdateParameters the parameters supplied to the create or update configuration +// operation. +type DscConfigurationCreateOrUpdateParameters struct { + // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. + *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateParameters. +func (dccoup DscConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dccoup.DscConfigurationCreateOrUpdateProperties + } + if dccoup.Name != nil { + objectMap["name"] = dccoup.Name + } + if dccoup.Location != nil { + objectMap["location"] = dccoup.Location + } + if dccoup.Tags != nil { + objectMap["tags"] = dccoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfigurationCreateOrUpdateParameters struct. +func (dccoup *DscConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dccoup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dccoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + dccoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dccoup.Tags = tags + } + } + } + + return nil +} + +// DscConfigurationCreateOrUpdateProperties the properties to create or update configuration. +type DscConfigurationCreateOrUpdateProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // Parameters - Gets or sets the configuration parameters. + Parameters map[string]*DscConfigurationParameter `json:"parameters"` + // Description - Gets or sets the description of the configuration. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateProperties. +func (dccoup DscConfigurationCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dccoup.LogVerbose != nil { + objectMap["logVerbose"] = dccoup.LogVerbose + } + if dccoup.LogProgress != nil { + objectMap["logProgress"] = dccoup.LogProgress + } + if dccoup.Source != nil { + objectMap["source"] = dccoup.Source + } + if dccoup.Parameters != nil { + objectMap["parameters"] = dccoup.Parameters + } + if dccoup.Description != nil { + objectMap["description"] = dccoup.Description + } + return json.Marshal(objectMap) +} + +// DscConfigurationListResult the response model for the list configuration operation. +type DscConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of configurations. + Value *[]DscConfiguration `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets the total number of configurations matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// DscConfigurationListResultIterator provides access to a complete listing of DscConfiguration values. +type DscConfigurationListResultIterator struct { + i int + page DscConfigurationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DscConfigurationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscConfigurationListResultIterator) Response() DscConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscConfigurationListResultIterator) Value() DscConfiguration { + if !iter.page.NotDone() { + return DscConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DscConfigurationListResultIterator type. +func NewDscConfigurationListResultIterator(page DscConfigurationListResultPage) DscConfigurationListResultIterator { + return DscConfigurationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dclr DscConfigurationListResult) IsEmpty() bool { + return dclr.Value == nil || len(*dclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dclr DscConfigurationListResult) hasNextLink() bool { + return dclr.NextLink != nil && len(*dclr.NextLink) != 0 +} + +// dscConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dclr DscConfigurationListResult) dscConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dclr.NextLink))) +} + +// DscConfigurationListResultPage contains a page of DscConfiguration values. +type DscConfigurationListResultPage struct { + fn func(context.Context, DscConfigurationListResult) (DscConfigurationListResult, error) + dclr DscConfigurationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dclr) + if err != nil { + return err + } + page.dclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DscConfigurationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscConfigurationListResultPage) NotDone() bool { + return !page.dclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscConfigurationListResultPage) Response() DscConfigurationListResult { + return page.dclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscConfigurationListResultPage) Values() []DscConfiguration { + if page.dclr.IsEmpty() { + return nil + } + return *page.dclr.Value +} + +// Creates a new instance of the DscConfigurationListResultPage type. +func NewDscConfigurationListResultPage(cur DscConfigurationListResult, getNextPage func(context.Context, DscConfigurationListResult) (DscConfigurationListResult, error)) DscConfigurationListResultPage { + return DscConfigurationListResultPage{ + fn: getNextPage, + dclr: cur, + } +} + +// DscConfigurationParameter definition of the configuration parameter type. +type DscConfigurationParameter struct { + // Type - Gets or sets the type of the parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. + IsMandatory *bool `json:"isMandatory,omitempty"` + // Position - Get or sets the position of the parameter. + Position *int32 `json:"position,omitempty"` + // DefaultValue - Gets or sets the default value of parameter. + DefaultValue *string `json:"defaultValue,omitempty"` +} + +// DscConfigurationProperties definition of the configuration property type. +type DscConfigurationProperties struct { + // ProvisioningState - Gets or sets the provisioning state of the configuration. Possible values include: 'DscConfigurationProvisioningStateSucceeded' + ProvisioningState DscConfigurationProvisioningState `json:"provisioningState,omitempty"` + // JobCount - Gets or sets the job count of the configuration. + JobCount *int32 `json:"jobCount,omitempty"` + // Parameters - Gets or sets the configuration parameters. + Parameters map[string]*DscConfigurationParameter `json:"parameters"` + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // State - Gets or sets the state of the configuration. Possible values include: 'DscConfigurationStateNew', 'DscConfigurationStateEdit', 'DscConfigurationStatePublished' + State DscConfigurationState `json:"state,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // NodeConfigurationCount - Gets the number of compiled node configurations. + NodeConfigurationCount *int32 `json:"nodeConfigurationCount,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationProperties. +func (dcp DscConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcp.ProvisioningState != "" { + objectMap["provisioningState"] = dcp.ProvisioningState + } + if dcp.JobCount != nil { + objectMap["jobCount"] = dcp.JobCount + } + if dcp.Parameters != nil { + objectMap["parameters"] = dcp.Parameters + } + if dcp.Source != nil { + objectMap["source"] = dcp.Source + } + if dcp.State != "" { + objectMap["state"] = dcp.State + } + if dcp.LogVerbose != nil { + objectMap["logVerbose"] = dcp.LogVerbose + } + if dcp.CreationTime != nil { + objectMap["creationTime"] = dcp.CreationTime + } + if dcp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = dcp.LastModifiedTime + } + if dcp.NodeConfigurationCount != nil { + objectMap["nodeConfigurationCount"] = dcp.NodeConfigurationCount + } + if dcp.Description != nil { + objectMap["description"] = dcp.Description + } + return json.Marshal(objectMap) +} + +// DscConfigurationUpdateParameters the parameters supplied to the create or update configuration +// operation. +type DscConfigurationUpdateParameters struct { + // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. + *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscConfigurationUpdateParameters. +func (dcup DscConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcup.DscConfigurationCreateOrUpdateProperties != nil { + objectMap["properties"] = dcup.DscConfigurationCreateOrUpdateProperties + } + if dcup.Name != nil { + objectMap["name"] = dcup.Name + } + if dcup.Tags != nil { + objectMap["tags"] = dcup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscConfigurationUpdateParameters struct. +func (dcup *DscConfigurationUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties + err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) + if err != nil { + return err + } + dcup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dcup.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dcup.Tags = tags + } + } + } + + return nil +} + +// DscMetaConfiguration definition of the DSC Meta Configuration. +type DscMetaConfiguration struct { + // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. + ConfigurationModeFrequencyMins *int32 `json:"configurationModeFrequencyMins,omitempty"` + // RebootNodeIfNeeded - Gets or sets the RebootNodeIfNeeded value of the meta configuration. + RebootNodeIfNeeded *bool `json:"rebootNodeIfNeeded,omitempty"` + // ConfigurationMode - Gets or sets the ConfigurationMode value of the meta configuration. + ConfigurationMode *string `json:"configurationMode,omitempty"` + // ActionAfterReboot - Gets or sets the ActionAfterReboot value of the meta configuration. + ActionAfterReboot *string `json:"actionAfterReboot,omitempty"` + // CertificateID - Gets or sets the CertificateId value of the meta configuration. + CertificateID *string `json:"certificateId,omitempty"` + // RefreshFrequencyMins - Gets or sets the RefreshFrequencyMins value of the meta configuration. + RefreshFrequencyMins *int32 `json:"refreshFrequencyMins,omitempty"` + // AllowModuleOverwrite - Gets or sets the AllowModuleOverwrite value of the meta configuration. + AllowModuleOverwrite *bool `json:"allowModuleOverwrite,omitempty"` +} + +// DscNode definition of a DscNode +type DscNode struct { + autorest.Response `json:"-"` + // DscNodeProperties - The properties of a DscNode. + *DscNodeProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNode. +func (dn DscNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dn.DscNodeProperties != nil { + objectMap["properties"] = dn.DscNodeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNode struct. +func (dn *DscNode) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscNodeProperties DscNodeProperties + err = json.Unmarshal(*v, &dscNodeProperties) + if err != nil { + return err + } + dn.DscNodeProperties = &dscNodeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dn.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dn.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dn.Type = &typeVar + } + } + } + + return nil +} + +// DscNodeConfiguration definition of the dsc node configuration. +type DscNodeConfiguration struct { + autorest.Response `json:"-"` + // DscNodeConfigurationProperties - Gets or sets the configuration properties. + *DscNodeConfigurationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNodeConfiguration. +func (dnc DscNodeConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnc.DscNodeConfigurationProperties != nil { + objectMap["properties"] = dnc.DscNodeConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeConfiguration struct. +func (dnc *DscNodeConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscNodeConfigurationProperties DscNodeConfigurationProperties + err = json.Unmarshal(*v, &dscNodeConfigurationProperties) + if err != nil { + return err + } + dnc.DscNodeConfigurationProperties = &dscNodeConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dnc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dnc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dnc.Type = &typeVar + } + } + } + + return nil +} + +// DscNodeConfigurationAssociationProperty the dsc node configuration property associated with the entity. +type DscNodeConfigurationAssociationProperty struct { + // Name - Gets or sets the name of the dsc node configuration. + Name *string `json:"name,omitempty"` +} + +// DscNodeConfigurationCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DscNodeConfigurationCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DscNodeConfigurationClient) (DscNodeConfiguration, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DscNodeConfigurationCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DscNodeConfigurationCreateOrUpdateFuture.Result. +func (future *DscNodeConfigurationCreateOrUpdateFuture) result(client DscNodeConfigurationClient) (dnc DscNodeConfiguration, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + dnc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("automation.DscNodeConfigurationCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if dnc.Response.Response, err = future.GetResult(sender); err == nil && dnc.Response.Response.StatusCode != http.StatusNoContent { + dnc, err = client.CreateOrUpdateResponder(dnc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.DscNodeConfigurationCreateOrUpdateFuture", "Result", dnc.Response.Response, "Failure responding to request") + } + } + return +} + +// DscNodeConfigurationCreateOrUpdateParameters the parameters supplied to the create or update node +// configuration operation. +type DscNodeConfigurationCreateOrUpdateParameters struct { + // DscNodeConfigurationCreateOrUpdateParametersProperties - Node configuration properties + *DscNodeConfigurationCreateOrUpdateParametersProperties `json:"properties,omitempty"` + // Name - Name of the node configuration. + Name *string `json:"name,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DscNodeConfigurationCreateOrUpdateParameters. +func (dnccoup DscNodeConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties != nil { + objectMap["properties"] = dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties + } + if dnccoup.Name != nil { + objectMap["name"] = dnccoup.Name + } + if dnccoup.Tags != nil { + objectMap["tags"] = dnccoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeConfigurationCreateOrUpdateParameters struct. +func (dnccoup *DscNodeConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dscNodeConfigurationCreateOrUpdateParametersProperties DscNodeConfigurationCreateOrUpdateParametersProperties + err = json.Unmarshal(*v, &dscNodeConfigurationCreateOrUpdateParametersProperties) + if err != nil { + return err + } + dnccoup.DscNodeConfigurationCreateOrUpdateParametersProperties = &dscNodeConfigurationCreateOrUpdateParametersProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dnccoup.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dnccoup.Tags = tags + } + } + } + + return nil +} + +// DscNodeConfigurationCreateOrUpdateParametersProperties the parameter properties supplied to the create +// or update node configuration operation. +type DscNodeConfigurationCreateOrUpdateParametersProperties struct { + // Source - Gets or sets the source. + Source *ContentSource `json:"source,omitempty"` + // Configuration - Gets or sets the configuration of the node. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// DscNodeConfigurationListResult the response model for the list job operation. +type DscNodeConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of Dsc node configurations. + Value *[]DscNodeConfiguration `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets or sets the total rows in query. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// DscNodeConfigurationListResultIterator provides access to a complete listing of DscNodeConfiguration +// values. +type DscNodeConfigurationListResultIterator struct { + i int + page DscNodeConfigurationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DscNodeConfigurationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeConfigurationListResultIterator) Response() DscNodeConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeConfigurationListResultIterator) Value() DscNodeConfiguration { + if !iter.page.NotDone() { + return DscNodeConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DscNodeConfigurationListResultIterator type. +func NewDscNodeConfigurationListResultIterator(page DscNodeConfigurationListResultPage) DscNodeConfigurationListResultIterator { + return DscNodeConfigurationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnclr DscNodeConfigurationListResult) IsEmpty() bool { + return dnclr.Value == nil || len(*dnclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dnclr DscNodeConfigurationListResult) hasNextLink() bool { + return dnclr.NextLink != nil && len(*dnclr.NextLink) != 0 +} + +// dscNodeConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnclr DscNodeConfigurationListResult) dscNodeConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dnclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnclr.NextLink))) +} + +// DscNodeConfigurationListResultPage contains a page of DscNodeConfiguration values. +type DscNodeConfigurationListResultPage struct { + fn func(context.Context, DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error) + dnclr DscNodeConfigurationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dnclr) + if err != nil { + return err + } + page.dnclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DscNodeConfigurationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeConfigurationListResultPage) NotDone() bool { + return !page.dnclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeConfigurationListResultPage) Response() DscNodeConfigurationListResult { + return page.dnclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeConfigurationListResultPage) Values() []DscNodeConfiguration { + if page.dnclr.IsEmpty() { + return nil + } + return *page.dnclr.Value +} + +// Creates a new instance of the DscNodeConfigurationListResultPage type. +func NewDscNodeConfigurationListResultPage(cur DscNodeConfigurationListResult, getNextPage func(context.Context, DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error)) DscNodeConfigurationListResultPage { + return DscNodeConfigurationListResultPage{ + fn: getNextPage, + dnclr: cur, + } +} + +// DscNodeConfigurationProperties properties for the DscNodeConfiguration +type DscNodeConfigurationProperties struct { + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // CreationTime - Gets or sets creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Configuration - Gets or sets the configuration of the node. + Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` + // Source - Source of node configuration. + Source *string `json:"source,omitempty"` + // NodeCount - Number of nodes with this node configuration assigned + NodeCount *int64 `json:"nodeCount,omitempty"` + // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. + IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` +} + +// DscNodeExtensionHandlerAssociationProperty the dsc extensionHandler property associated with the node +type DscNodeExtensionHandlerAssociationProperty struct { + // Name - Gets or sets the name of the extension handler. + Name *string `json:"name,omitempty"` + // Version - Gets or sets the version of the extension handler. + Version *string `json:"version,omitempty"` +} + +// DscNodeListResult the response model for the list dsc nodes operation. +type DscNodeListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of dsc nodes. + Value *[]DscNode `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` + // TotalCount - Gets the total number of nodes matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// DscNodeListResultIterator provides access to a complete listing of DscNode values. +type DscNodeListResultIterator struct { + i int + page DscNodeListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DscNodeListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeListResultIterator) Response() DscNodeListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeListResultIterator) Value() DscNode { + if !iter.page.NotDone() { + return DscNode{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DscNodeListResultIterator type. +func NewDscNodeListResultIterator(page DscNodeListResultPage) DscNodeListResultIterator { + return DscNodeListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnlr DscNodeListResult) IsEmpty() bool { + return dnlr.Value == nil || len(*dnlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dnlr DscNodeListResult) hasNextLink() bool { + return dnlr.NextLink != nil && len(*dnlr.NextLink) != 0 +} + +// dscNodeListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnlr DscNodeListResult) dscNodeListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dnlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnlr.NextLink))) +} + +// DscNodeListResultPage contains a page of DscNode values. +type DscNodeListResultPage struct { + fn func(context.Context, DscNodeListResult) (DscNodeListResult, error) + dnlr DscNodeListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dnlr) + if err != nil { + return err + } + page.dnlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DscNodeListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeListResultPage) NotDone() bool { + return !page.dnlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeListResultPage) Response() DscNodeListResult { + return page.dnlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeListResultPage) Values() []DscNode { + if page.dnlr.IsEmpty() { + return nil + } + return *page.dnlr.Value +} + +// Creates a new instance of the DscNodeListResultPage type. +func NewDscNodeListResultPage(cur DscNodeListResult, getNextPage func(context.Context, DscNodeListResult) (DscNodeListResult, error)) DscNodeListResultPage { + return DscNodeListResultPage{ + fn: getNextPage, + dnlr: cur, + } +} + +// DscNodeProperties the properties of a DscNode +type DscNodeProperties struct { + // LastSeen - Gets or sets the last seen time of the node. + LastSeen *date.Time `json:"lastSeen,omitempty"` + // RegistrationTime - Gets or sets the registration time of the node. + RegistrationTime *date.Time `json:"registrationTime,omitempty"` + // IP - Gets or sets the ip of the node. + IP *string `json:"ip,omitempty"` + // AccountID - Gets or sets the account id of the node. + AccountID *string `json:"accountId,omitempty"` + // DscNodeConfigurationAssociationProperty - Gets or sets the configuration of the node. + *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` + // Status - Gets or sets the status of the node. + Status *string `json:"status,omitempty"` + // NodeID - Gets or sets the node id. + NodeID *string `json:"nodeId,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // TotalCount - Gets the total number of records matching filter criteria. + TotalCount *int32 `json:"totalCount,omitempty"` + // ExtensionHandler - Gets or sets the list of extensionHandler properties for a Node. + ExtensionHandler *[]DscNodeExtensionHandlerAssociationProperty `json:"extensionHandler,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNodeProperties. +func (dnp DscNodeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnp.LastSeen != nil { + objectMap["lastSeen"] = dnp.LastSeen + } + if dnp.RegistrationTime != nil { + objectMap["registrationTime"] = dnp.RegistrationTime + } + if dnp.IP != nil { + objectMap["ip"] = dnp.IP + } + if dnp.AccountID != nil { + objectMap["accountId"] = dnp.AccountID + } + if dnp.DscNodeConfigurationAssociationProperty != nil { + objectMap["nodeConfiguration"] = dnp.DscNodeConfigurationAssociationProperty + } + if dnp.Status != nil { + objectMap["status"] = dnp.Status + } + if dnp.NodeID != nil { + objectMap["nodeId"] = dnp.NodeID + } + if dnp.Etag != nil { + objectMap["etag"] = dnp.Etag + } + if dnp.TotalCount != nil { + objectMap["totalCount"] = dnp.TotalCount + } + if dnp.ExtensionHandler != nil { + objectMap["extensionHandler"] = dnp.ExtensionHandler + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeProperties struct. +func (dnp *DscNodeProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "lastSeen": + if v != nil { + var lastSeen date.Time + err = json.Unmarshal(*v, &lastSeen) + if err != nil { + return err + } + dnp.LastSeen = &lastSeen + } + case "registrationTime": + if v != nil { + var registrationTime date.Time + err = json.Unmarshal(*v, ®istrationTime) + if err != nil { + return err + } + dnp.RegistrationTime = ®istrationTime + } + case "ip": + if v != nil { + var IP string + err = json.Unmarshal(*v, &IP) + if err != nil { + return err + } + dnp.IP = &IP + } + case "accountId": + if v != nil { + var accountID string + err = json.Unmarshal(*v, &accountID) + if err != nil { + return err + } + dnp.AccountID = &accountID + } + case "nodeConfiguration": + if v != nil { + var dscNodeConfigurationAssociationProperty DscNodeConfigurationAssociationProperty + err = json.Unmarshal(*v, &dscNodeConfigurationAssociationProperty) + if err != nil { + return err + } + dnp.DscNodeConfigurationAssociationProperty = &dscNodeConfigurationAssociationProperty + } + case "status": + if v != nil { + var status string + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + dnp.Status = &status + } + case "nodeId": + if v != nil { + var nodeID string + err = json.Unmarshal(*v, &nodeID) + if err != nil { + return err + } + dnp.NodeID = &nodeID + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dnp.Etag = &etag + } + case "totalCount": + if v != nil { + var totalCount int32 + err = json.Unmarshal(*v, &totalCount) + if err != nil { + return err + } + dnp.TotalCount = &totalCount + } + case "extensionHandler": + if v != nil { + var extensionHandler []DscNodeExtensionHandlerAssociationProperty + err = json.Unmarshal(*v, &extensionHandler) + if err != nil { + return err + } + dnp.ExtensionHandler = &extensionHandler + } + } + } + + return nil +} + +// DscNodeReport definition of the dsc node report type. +type DscNodeReport struct { + autorest.Response `json:"-"` + // EndTime - Gets or sets the end time of the node report. + EndTime *date.Time `json:"endTime,omitempty"` + // LastModifiedTime - Gets or sets the lastModifiedTime of the node report. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // StartTime - Gets or sets the start time of the node report. + StartTime *date.Time `json:"startTime,omitempty"` + // Type - Gets or sets the type of the node report. + Type *string `json:"type,omitempty"` + // ReportID - Gets or sets the id of the node report. + ReportID *string `json:"reportId,omitempty"` + // Status - Gets or sets the status of the node report. + Status *string `json:"status,omitempty"` + // RefreshMode - Gets or sets the refreshMode of the node report. + RefreshMode *string `json:"refreshMode,omitempty"` + // RebootRequested - Gets or sets the rebootRequested of the node report. + RebootRequested *string `json:"rebootRequested,omitempty"` + // ReportFormatVersion - Gets or sets the reportFormatVersion of the node report. + ReportFormatVersion *string `json:"reportFormatVersion,omitempty"` + // ConfigurationVersion - Gets or sets the configurationVersion of the node report. + ConfigurationVersion *string `json:"configurationVersion,omitempty"` + // ID - Gets or sets the id. + ID *string `json:"id,omitempty"` + // Errors - Gets or sets the errors for the node report. + Errors *[]DscReportError `json:"errors,omitempty"` + // Resources - Gets or sets the resource for the node report. + Resources *[]DscReportResource `json:"resources,omitempty"` + // MetaConfiguration - Gets or sets the metaConfiguration of the node at the time of the report. + MetaConfiguration *DscMetaConfiguration `json:"metaConfiguration,omitempty"` + // HostName - Gets or sets the hostname of the node that sent the report. + HostName *string `json:"hostName,omitempty"` + // IPV4Addresses - Gets or sets the IPv4 address of the node that sent the report. + IPV4Addresses *[]string `json:"iPV4Addresses,omitempty"` + // IPV6Addresses - Gets or sets the IPv6 address of the node that sent the report. + IPV6Addresses *[]string `json:"iPV6Addresses,omitempty"` + // NumberOfResources - Gets or sets the number of resource in the node report. + NumberOfResources *int32 `json:"numberOfResources,omitempty"` + // RawErrors - Gets or sets the unparsed errors for the node report. + RawErrors *string `json:"rawErrors,omitempty"` +} + +// DscNodeReportListResult the response model for the list dsc nodes operation. +type DscNodeReportListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of dsc node reports. + Value *[]DscNodeReport `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// DscNodeReportListResultIterator provides access to a complete listing of DscNodeReport values. +type DscNodeReportListResultIterator struct { + i int + page DscNodeReportListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DscNodeReportListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeReportListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DscNodeReportListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DscNodeReportListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DscNodeReportListResultIterator) Response() DscNodeReportListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DscNodeReportListResultIterator) Value() DscNodeReport { + if !iter.page.NotDone() { + return DscNodeReport{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DscNodeReportListResultIterator type. +func NewDscNodeReportListResultIterator(page DscNodeReportListResultPage) DscNodeReportListResultIterator { + return DscNodeReportListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dnrlr DscNodeReportListResult) IsEmpty() bool { + return dnrlr.Value == nil || len(*dnrlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dnrlr DscNodeReportListResult) hasNextLink() bool { + return dnrlr.NextLink != nil && len(*dnrlr.NextLink) != 0 +} + +// dscNodeReportListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dnrlr DscNodeReportListResult) dscNodeReportListResultPreparer(ctx context.Context) (*http.Request, error) { + if !dnrlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dnrlr.NextLink))) +} + +// DscNodeReportListResultPage contains a page of DscNodeReport values. +type DscNodeReportListResultPage struct { + fn func(context.Context, DscNodeReportListResult) (DscNodeReportListResult, error) + dnrlr DscNodeReportListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DscNodeReportListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeReportListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dnrlr) + if err != nil { + return err + } + page.dnrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DscNodeReportListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DscNodeReportListResultPage) NotDone() bool { + return !page.dnrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DscNodeReportListResultPage) Response() DscNodeReportListResult { + return page.dnrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DscNodeReportListResultPage) Values() []DscNodeReport { + if page.dnrlr.IsEmpty() { + return nil + } + return *page.dnrlr.Value +} + +// Creates a new instance of the DscNodeReportListResultPage type. +func NewDscNodeReportListResultPage(cur DscNodeReportListResult, getNextPage func(context.Context, DscNodeReportListResult) (DscNodeReportListResult, error)) DscNodeReportListResultPage { + return DscNodeReportListResultPage{ + fn: getNextPage, + dnrlr: cur, + } +} + +// DscNodeUpdateParameters the parameters supplied to the update dsc node operation. +type DscNodeUpdateParameters struct { + // NodeID - Gets or sets the id of the dsc node. + NodeID *string `json:"nodeId,omitempty"` + Properties *DscNodeUpdateParametersProperties `json:"properties,omitempty"` +} + +// DscNodeUpdateParametersProperties ... +type DscNodeUpdateParametersProperties struct { + // DscNodeConfigurationAssociationProperty - Gets or sets the configuration of the node. + *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` +} + +// MarshalJSON is the custom marshaler for DscNodeUpdateParametersProperties. +func (dnup DscNodeUpdateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dnup.DscNodeConfigurationAssociationProperty != nil { + objectMap["nodeConfiguration"] = dnup.DscNodeConfigurationAssociationProperty + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DscNodeUpdateParametersProperties struct. +func (dnup *DscNodeUpdateParametersProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nodeConfiguration": + if v != nil { + var dscNodeConfigurationAssociationProperty DscNodeConfigurationAssociationProperty + err = json.Unmarshal(*v, &dscNodeConfigurationAssociationProperty) + if err != nil { + return err + } + dnup.DscNodeConfigurationAssociationProperty = &dscNodeConfigurationAssociationProperty + } + } + } + + return nil +} + +// DscReportError definition of the dsc node report error type. +type DscReportError struct { + // ErrorSource - Gets or sets the source of the error. + ErrorSource *string `json:"errorSource,omitempty"` + // ResourceID - Gets or sets the resource ID which generated the error. + ResourceID *string `json:"resourceId,omitempty"` + // ErrorCode - Gets or sets the error code. + ErrorCode *string `json:"errorCode,omitempty"` + // ErrorMessage - Gets or sets the error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Locale - Gets or sets the locale of the error. + Locale *string `json:"locale,omitempty"` + // ErrorDetails - Gets or sets the error details. + ErrorDetails *string `json:"errorDetails,omitempty"` +} + +// DscReportResource definition of the DSC Report Resource. +type DscReportResource struct { + // ResourceID - Gets or sets the ID of the resource. + ResourceID *string `json:"resourceId,omitempty"` + // SourceInfo - Gets or sets the source info of the resource. + SourceInfo *string `json:"sourceInfo,omitempty"` + // DependsOn - Gets or sets the Resource Navigation values for resources the resource depends on. + DependsOn *[]DscReportResourceNavigation `json:"dependsOn,omitempty"` + // ModuleName - Gets or sets the module name of the resource. + ModuleName *string `json:"moduleName,omitempty"` + // ModuleVersion - Gets or sets the module version of the resource. + ModuleVersion *string `json:"moduleVersion,omitempty"` + // ResourceName - Gets or sets the name of the resource. + ResourceName *string `json:"resourceName,omitempty"` + // Error - Gets or sets the error of the resource. + Error *string `json:"error,omitempty"` + // Status - Gets or sets the status of the resource. + Status *string `json:"status,omitempty"` + // DurationInSeconds - Gets or sets the duration in seconds for the resource. + DurationInSeconds *float64 `json:"durationInSeconds,omitempty"` + // StartDate - Gets or sets the start date of the resource. + StartDate *date.Time `json:"startDate,omitempty"` +} + +// DscReportResourceNavigation navigation for DSC Report Resource. +type DscReportResourceNavigation struct { + // ResourceID - Gets or sets the ID of the resource to navigate to. + ResourceID *string `json:"resourceId,omitempty"` +} + +// EncryptionProperties the encryption settings for automation account +type EncryptionProperties struct { + // KeyVaultProperties - Key vault properties. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + // KeySource - Encryption Key Source. Possible values include: 'EncryptionKeySourceTypeMicrosoftAutomation', 'EncryptionKeySourceTypeMicrosoftKeyvault' + KeySource EncryptionKeySourceType `json:"keySource,omitempty"` + // Identity - User identity used for CMK. + Identity *EncryptionPropertiesIdentity `json:"identity,omitempty"` +} + +// EncryptionPropertiesIdentity user identity used for CMK. +type EncryptionPropertiesIdentity struct { + // UserAssignedIdentity - The user identity used for CMK. It will be an ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentity interface{} `json:"userAssignedIdentity,omitempty"` +} + +// ErrorResponse error response of an operation failure +type ErrorResponse struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// FieldDefinition definition of the connection fields. +type FieldDefinition struct { + // IsEncrypted - Gets or sets the isEncrypted flag of the connection field definition. + IsEncrypted *bool `json:"isEncrypted,omitempty"` + // IsOptional - Gets or sets the isOptional flag of the connection field definition. + IsOptional *bool `json:"isOptional,omitempty"` + // Type - Gets or sets the type of the connection field definition. + Type *string `json:"type,omitempty"` +} + +// HybridRunbookWorker definition of hybrid runbook worker. +type HybridRunbookWorker struct { + // Name - Gets or sets the worker machine name. + Name *string `json:"name,omitempty"` + // IP - Gets or sets the assigned machine IP address. + IP *string `json:"ip,omitempty"` + // RegistrationTime - Gets or sets the registration time of the worker machine. + RegistrationTime *date.Time `json:"registrationTime,omitempty"` + // LastSeenDateTime - Last Heartbeat from the Worker + LastSeenDateTime *date.Time `json:"lastSeenDateTime,omitempty"` +} + +// HybridRunbookWorkerGroup definition of hybrid runbook worker group. +type HybridRunbookWorkerGroup struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets or sets the name of the group. + Name *string `json:"name,omitempty"` + // HybridRunbookWorkers - Gets or sets the list of hybrid runbook workers. + HybridRunbookWorkers *[]HybridRunbookWorker `json:"hybridRunbookWorkers,omitempty"` + // Credential - Sets the credential of a worker group. + Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` + // GroupType - Type of the HybridWorkerGroup. Possible values include: 'GroupTypeEnumUser', 'GroupTypeEnumSystem' + GroupType GroupTypeEnum `json:"groupType,omitempty"` +} + +// HybridRunbookWorkerGroupsListResult the response model for the list hybrid runbook worker groups. +type HybridRunbookWorkerGroupsListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of hybrid runbook worker groups. + Value *[]HybridRunbookWorkerGroup `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// HybridRunbookWorkerGroupsListResultIterator provides access to a complete listing of +// HybridRunbookWorkerGroup values. +type HybridRunbookWorkerGroupsListResultIterator struct { + i int + page HybridRunbookWorkerGroupsListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *HybridRunbookWorkerGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *HybridRunbookWorkerGroupsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HybridRunbookWorkerGroupsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter HybridRunbookWorkerGroupsListResultIterator) Response() HybridRunbookWorkerGroupsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter HybridRunbookWorkerGroupsListResultIterator) Value() HybridRunbookWorkerGroup { + if !iter.page.NotDone() { + return HybridRunbookWorkerGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the HybridRunbookWorkerGroupsListResultIterator type. +func NewHybridRunbookWorkerGroupsListResultIterator(page HybridRunbookWorkerGroupsListResultPage) HybridRunbookWorkerGroupsListResultIterator { + return HybridRunbookWorkerGroupsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (hrwglr HybridRunbookWorkerGroupsListResult) IsEmpty() bool { + return hrwglr.Value == nil || len(*hrwglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (hrwglr HybridRunbookWorkerGroupsListResult) hasNextLink() bool { + return hrwglr.NextLink != nil && len(*hrwglr.NextLink) != 0 +} + +// hybridRunbookWorkerGroupsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hrwglr HybridRunbookWorkerGroupsListResult) hybridRunbookWorkerGroupsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !hrwglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hrwglr.NextLink))) +} + +// HybridRunbookWorkerGroupsListResultPage contains a page of HybridRunbookWorkerGroup values. +type HybridRunbookWorkerGroupsListResultPage struct { + fn func(context.Context, HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error) + hrwglr HybridRunbookWorkerGroupsListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *HybridRunbookWorkerGroupsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.hrwglr) + if err != nil { + return err + } + page.hrwglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *HybridRunbookWorkerGroupsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HybridRunbookWorkerGroupsListResultPage) NotDone() bool { + return !page.hrwglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HybridRunbookWorkerGroupsListResultPage) Response() HybridRunbookWorkerGroupsListResult { + return page.hrwglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HybridRunbookWorkerGroupsListResultPage) Values() []HybridRunbookWorkerGroup { + if page.hrwglr.IsEmpty() { + return nil + } + return *page.hrwglr.Value +} + +// Creates a new instance of the HybridRunbookWorkerGroupsListResultPage type. +func NewHybridRunbookWorkerGroupsListResultPage(cur HybridRunbookWorkerGroupsListResult, getNextPage func(context.Context, HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error)) HybridRunbookWorkerGroupsListResultPage { + return HybridRunbookWorkerGroupsListResultPage{ + fn: getNextPage, + hrwglr: cur, + } +} + +// HybridRunbookWorkerGroupUpdateParameters parameters supplied to the update operation. +type HybridRunbookWorkerGroupUpdateParameters struct { + // Credential - Sets the credential of a worker group. + Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` +} + +// Identity identity for the resource. +type Identity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.Type != "" { + objectMap["type"] = i.Type + } + if i.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = i.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// IdentityUserAssignedIdentitiesValue ... +type IdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityUserAssignedIdentitiesValue. +func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Job definition of the job. +type Job struct { + autorest.Response `json:"-"` + // JobProperties - The properties of the job. + *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.JobProperties != nil { + objectMap["properties"] = j.JobProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } + } + } + + return nil +} + +// JobCollectionItem job collection item properties. +type JobCollectionItem struct { + // JobCollectionItemProperties - Job properties. + *JobCollectionItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCollectionItem. +func (jci JobCollectionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jci.JobCollectionItemProperties != nil { + objectMap["properties"] = jci.JobCollectionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobCollectionItem struct. +func (jci *JobCollectionItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobCollectionItemProperties JobCollectionItemProperties + err = json.Unmarshal(*v, &jobCollectionItemProperties) + if err != nil { + return err + } + jci.JobCollectionItemProperties = &jobCollectionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jci.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jci.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jci.Type = &typeVar + } + } + } + + return nil +} + +// JobCollectionItemProperties job collection item properties. +type JobCollectionItemProperties struct { + // Runbook - READ-ONLY; The runbook association. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // JobID - READ-ONLY; The id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - READ-ONLY; The creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - READ-ONLY; The status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // LastModifiedTime - READ-ONLY; The last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of a resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RunOn - Specifies the runOn group name where the job was executed. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCollectionItemProperties. +func (jcip JobCollectionItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcip.RunOn != nil { + objectMap["runOn"] = jcip.RunOn + } + return json.Marshal(objectMap) +} + +// JobCreateParameters the parameters supplied to the create job operation. +type JobCreateParameters struct { + // JobCreateProperties - Gets or sets the list of job properties. + *JobCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCreateParameters. +func (jcp JobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.JobCreateProperties != nil { + objectMap["properties"] = jcp.JobCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. +func (jcp *JobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobCreateProperties JobCreateProperties + err = json.Unmarshal(*v, &jobCreateProperties) + if err != nil { + return err + } + jcp.JobCreateProperties = &jobCreateProperties + } + } + } + + return nil +} + +// JobCreateProperties ... +type JobCreateProperties struct { + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCreateProperties. +func (jcp JobCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jcp.Runbook != nil { + objectMap["runbook"] = jcp.Runbook + } + if jcp.Parameters != nil { + objectMap["parameters"] = jcp.Parameters + } + if jcp.RunOn != nil { + objectMap["runOn"] = jcp.RunOn + } + return json.Marshal(objectMap) +} + +// JobListResultV2 the response model for the list job operation. +type JobListResultV2 struct { + autorest.Response `json:"-"` + // Value - List of jobs. + Value *[]JobCollectionItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobListResultV2. +func (jlrv JobListResultV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jlrv.Value != nil { + objectMap["value"] = jlrv.Value + } + return json.Marshal(objectMap) +} + +// JobListResultV2Iterator provides access to a complete listing of JobCollectionItem values. +type JobListResultV2Iterator struct { + i int + page JobListResultV2Page +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobListResultV2Iterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultV2Iterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobListResultV2Iterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobListResultV2Iterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobListResultV2Iterator) Response() JobListResultV2 { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobListResultV2Iterator) Value() JobCollectionItem { + if !iter.page.NotDone() { + return JobCollectionItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobListResultV2Iterator type. +func NewJobListResultV2Iterator(page JobListResultV2Page) JobListResultV2Iterator { + return JobListResultV2Iterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jlrv JobListResultV2) IsEmpty() bool { + return jlrv.Value == nil || len(*jlrv.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jlrv JobListResultV2) hasNextLink() bool { + return jlrv.NextLink != nil && len(*jlrv.NextLink) != 0 +} + +// jobListResultV2Preparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jlrv JobListResultV2) jobListResultV2Preparer(ctx context.Context) (*http.Request, error) { + if !jlrv.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jlrv.NextLink))) +} + +// JobListResultV2Page contains a page of JobCollectionItem values. +type JobListResultV2Page struct { + fn func(context.Context, JobListResultV2) (JobListResultV2, error) + jlrv JobListResultV2 +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobListResultV2Page) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultV2Page.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jlrv) + if err != nil { + return err + } + page.jlrv = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobListResultV2Page) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobListResultV2Page) NotDone() bool { + return !page.jlrv.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobListResultV2Page) Response() JobListResultV2 { + return page.jlrv +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobListResultV2Page) Values() []JobCollectionItem { + if page.jlrv.IsEmpty() { + return nil + } + return *page.jlrv.Value +} + +// Creates a new instance of the JobListResultV2Page type. +func NewJobListResultV2Page(cur JobListResultV2, getNextPage func(context.Context, JobListResultV2) (JobListResultV2, error)) JobListResultV2Page { + return JobListResultV2Page{ + fn: getNextPage, + jlrv: cur, + } +} + +// JobNavigation software update configuration machine run job navigation properties. +type JobNavigation struct { + // ID - READ-ONLY; Id of the job associated with the software update configuration run + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobNavigation. +func (jn JobNavigation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// JobProperties definition of job properties. +type JobProperties struct { + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // StartedBy - Gets or sets the job started by. + StartedBy *string `json:"startedBy,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // JobID - Gets or sets the id of the job. + JobID *uuid.UUID `json:"jobId,omitempty"` + // CreationTime - Gets or sets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' + Status JobStatus `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the job. + StatusDetails *string `json:"statusDetails,omitempty"` + // StartTime - Gets or sets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets or sets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets or sets the exception of the job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets or sets the last status modified time of the job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' + ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobProperties. +func (jp JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jp.Runbook != nil { + objectMap["runbook"] = jp.Runbook + } + if jp.StartedBy != nil { + objectMap["startedBy"] = jp.StartedBy + } + if jp.RunOn != nil { + objectMap["runOn"] = jp.RunOn + } + if jp.JobID != nil { + objectMap["jobId"] = jp.JobID + } + if jp.CreationTime != nil { + objectMap["creationTime"] = jp.CreationTime + } + if jp.Status != "" { + objectMap["status"] = jp.Status + } + if jp.StatusDetails != nil { + objectMap["statusDetails"] = jp.StatusDetails + } + if jp.StartTime != nil { + objectMap["startTime"] = jp.StartTime + } + if jp.EndTime != nil { + objectMap["endTime"] = jp.EndTime + } + if jp.Exception != nil { + objectMap["exception"] = jp.Exception + } + if jp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = jp.LastModifiedTime + } + if jp.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = jp.LastStatusModifiedTime + } + if jp.Parameters != nil { + objectMap["parameters"] = jp.Parameters + } + if jp.ProvisioningState != "" { + objectMap["provisioningState"] = jp.ProvisioningState + } + return json.Marshal(objectMap) +} + +// JobSchedule definition of the job schedule. +type JobSchedule struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Gets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Gets the name of the variable. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // JobScheduleProperties - Gets or sets the properties of the job schedule. + *JobScheduleProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobSchedule. +func (js JobSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.JobScheduleProperties != nil { + objectMap["properties"] = js.JobScheduleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobSchedule struct. +func (js *JobSchedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + js.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + js.Type = &typeVar + } + case "properties": + if v != nil { + var jobScheduleProperties JobScheduleProperties + err = json.Unmarshal(*v, &jobScheduleProperties) + if err != nil { + return err + } + js.JobScheduleProperties = &jobScheduleProperties + } + } + } + + return nil +} + +// JobScheduleCreateParameters the parameters supplied to the create job schedule operation. +type JobScheduleCreateParameters struct { + // JobScheduleCreateProperties - Gets or sets the list of job schedule properties. + *JobScheduleCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobScheduleCreateParameters. +func (jscp JobScheduleCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.JobScheduleCreateProperties != nil { + objectMap["properties"] = jscp.JobScheduleCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobScheduleCreateParameters struct. +func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobScheduleCreateProperties JobScheduleCreateProperties + err = json.Unmarshal(*v, &jobScheduleCreateProperties) + if err != nil { + return err + } + jscp.JobScheduleCreateProperties = &jobScheduleCreateProperties + } + } + } + + return nil +} + +// JobScheduleCreateProperties the parameters supplied to the create job schedule operation. +type JobScheduleCreateProperties struct { + // Schedule - Gets or sets the schedule. + Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets a list of job properties. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleCreateProperties. +func (jscp JobScheduleCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jscp.Schedule != nil { + objectMap["schedule"] = jscp.Schedule + } + if jscp.Runbook != nil { + objectMap["runbook"] = jscp.Runbook + } + if jscp.RunOn != nil { + objectMap["runOn"] = jscp.RunOn + } + if jscp.Parameters != nil { + objectMap["parameters"] = jscp.Parameters + } + return json.Marshal(objectMap) +} + +// JobScheduleListResult the response model for the list job schedule operation. +type JobScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of job schedules. + Value *[]JobSchedule `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobScheduleListResultIterator provides access to a complete listing of JobSchedule values. +type JobScheduleListResultIterator struct { + i int + page JobScheduleListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobScheduleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobScheduleListResultIterator) Response() JobScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobScheduleListResultIterator) Value() JobSchedule { + if !iter.page.NotDone() { + return JobSchedule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobScheduleListResultIterator type. +func NewJobScheduleListResultIterator(page JobScheduleListResultPage) JobScheduleListResultIterator { + return JobScheduleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jslr JobScheduleListResult) IsEmpty() bool { + return jslr.Value == nil || len(*jslr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jslr JobScheduleListResult) hasNextLink() bool { + return jslr.NextLink != nil && len(*jslr.NextLink) != 0 +} + +// jobScheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jslr JobScheduleListResult) jobScheduleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !jslr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jslr.NextLink))) +} + +// JobScheduleListResultPage contains a page of JobSchedule values. +type JobScheduleListResultPage struct { + fn func(context.Context, JobScheduleListResult) (JobScheduleListResult, error) + jslr JobScheduleListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobScheduleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jslr) + if err != nil { + return err + } + page.jslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobScheduleListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobScheduleListResultPage) NotDone() bool { + return !page.jslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobScheduleListResultPage) Response() JobScheduleListResult { + return page.jslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobScheduleListResultPage) Values() []JobSchedule { + if page.jslr.IsEmpty() { + return nil + } + return *page.jslr.Value +} + +// Creates a new instance of the JobScheduleListResultPage type. +func NewJobScheduleListResultPage(cur JobScheduleListResult, getNextPage func(context.Context, JobScheduleListResult) (JobScheduleListResult, error)) JobScheduleListResultPage { + return JobScheduleListResultPage{ + fn: getNextPage, + jslr: cur, + } +} + +// JobScheduleProperties definition of job schedule parameters. +type JobScheduleProperties struct { + // JobScheduleID - Gets or sets the id of job schedule. + JobScheduleID *string `json:"jobScheduleId,omitempty"` + // Schedule - Gets or sets the schedule. + Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets the parameters of the job schedule. + Parameters map[string]*string `json:"parameters"` +} + +// MarshalJSON is the custom marshaler for JobScheduleProperties. +func (jsp JobScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobScheduleID != nil { + objectMap["jobScheduleId"] = jsp.JobScheduleID + } + if jsp.Schedule != nil { + objectMap["schedule"] = jsp.Schedule + } + if jsp.Runbook != nil { + objectMap["runbook"] = jsp.Runbook + } + if jsp.RunOn != nil { + objectMap["runOn"] = jsp.RunOn + } + if jsp.Parameters != nil { + objectMap["parameters"] = jsp.Parameters + } + return json.Marshal(objectMap) +} + +// JobStream definition of the job stream. +type JobStream struct { + autorest.Response `json:"-"` + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // JobStreamProperties - Gets or sets the id of the job stream. + *JobStreamProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobStream. +func (js JobStream) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if js.ID != nil { + objectMap["id"] = js.ID + } + if js.JobStreamProperties != nil { + objectMap["properties"] = js.JobStreamProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JobStream struct. +func (js *JobStream) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + js.ID = &ID + } + case "properties": + if v != nil { + var jobStreamProperties JobStreamProperties + err = json.Unmarshal(*v, &jobStreamProperties) + if err != nil { + return err + } + js.JobStreamProperties = &jobStreamProperties + } + } + } + + return nil +} + +// JobStreamListResult the response model for the list job stream operation. +type JobStreamListResult struct { + autorest.Response `json:"-"` + // Value - A list of job streams. + Value *[]JobStream `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// JobStreamListResultIterator provides access to a complete listing of JobStream values. +type JobStreamListResultIterator struct { + i int + page JobStreamListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobStreamListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobStreamListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobStreamListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobStreamListResultIterator) Response() JobStreamListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobStreamListResultIterator) Value() JobStream { + if !iter.page.NotDone() { + return JobStream{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobStreamListResultIterator type. +func NewJobStreamListResultIterator(page JobStreamListResultPage) JobStreamListResultIterator { + return JobStreamListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jslr JobStreamListResult) IsEmpty() bool { + return jslr.Value == nil || len(*jslr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jslr JobStreamListResult) hasNextLink() bool { + return jslr.NextLink != nil && len(*jslr.NextLink) != 0 +} + +// jobStreamListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jslr JobStreamListResult) jobStreamListResultPreparer(ctx context.Context) (*http.Request, error) { + if !jslr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jslr.NextLink))) +} + +// JobStreamListResultPage contains a page of JobStream values. +type JobStreamListResultPage struct { + fn func(context.Context, JobStreamListResult) (JobStreamListResult, error) + jslr JobStreamListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobStreamListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jslr) + if err != nil { + return err + } + page.jslr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobStreamListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobStreamListResultPage) NotDone() bool { + return !page.jslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobStreamListResultPage) Response() JobStreamListResult { + return page.jslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobStreamListResultPage) Values() []JobStream { + if page.jslr.IsEmpty() { + return nil + } + return *page.jslr.Value +} + +// Creates a new instance of the JobStreamListResultPage type. +func NewJobStreamListResultPage(cur JobStreamListResult, getNextPage func(context.Context, JobStreamListResult) (JobStreamListResult, error)) JobStreamListResultPage { + return JobStreamListResultPage{ + fn: getNextPage, + jslr: cur, + } +} + +// JobStreamProperties definition of the job stream. +type JobStreamProperties struct { + // JobStreamID - Gets or sets the id of the job stream. + JobStreamID *string `json:"jobStreamId,omitempty"` + // Time - Gets or sets the creation time of the job. + Time *date.Time `json:"time,omitempty"` + // StreamType - Gets or sets the stream type. Possible values include: 'JobStreamTypeProgress', 'JobStreamTypeOutput', 'JobStreamTypeWarning', 'JobStreamTypeError', 'JobStreamTypeDebug', 'JobStreamTypeVerbose', 'JobStreamTypeAny' + StreamType JobStreamType `json:"streamType,omitempty"` + // StreamText - Gets or sets the stream text. + StreamText *string `json:"streamText,omitempty"` + // Summary - Gets or sets the summary. + Summary *string `json:"summary,omitempty"` + // Value - Gets or sets the values of the job stream. + Value map[string]interface{} `json:"value"` +} + +// MarshalJSON is the custom marshaler for JobStreamProperties. +func (jsp JobStreamProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jsp.JobStreamID != nil { + objectMap["jobStreamId"] = jsp.JobStreamID + } + if jsp.Time != nil { + objectMap["time"] = jsp.Time + } + if jsp.StreamType != "" { + objectMap["streamType"] = jsp.StreamType + } + if jsp.StreamText != nil { + objectMap["streamText"] = jsp.StreamText + } + if jsp.Summary != nil { + objectMap["summary"] = jsp.Summary + } + if jsp.Value != nil { + objectMap["value"] = jsp.Value + } + return json.Marshal(objectMap) +} + +// Key automation key which is used to register a DSC Node +type Key struct { + // KeyName - READ-ONLY; Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' + KeyName KeyName `json:"KeyName,omitempty"` + // Permissions - READ-ONLY; Automation key permissions. Possible values include: 'KeyPermissionsRead', 'KeyPermissionsFull' + Permissions KeyPermissions `json:"Permissions,omitempty"` + // Value - READ-ONLY; Value of the Automation Key used for registration. + Value *string `json:"Value,omitempty"` +} + +// MarshalJSON is the custom marshaler for Key. +func (kVar Key) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// KeyListResult ... +type KeyListResult struct { + autorest.Response `json:"-"` + // Keys - Lists the automation keys. + Keys *[]Key `json:"keys,omitempty"` +} + +// KeyVaultProperties settings concerning key vault encryption for a configuration store. +type KeyVaultProperties struct { + // KeyvaultURI - The URI of the key vault key used to encrypt data. + KeyvaultURI *string `json:"keyvaultUri,omitempty"` + // KeyName - The name of key used to encrypt data. + KeyName *string `json:"keyName,omitempty"` + // KeyVersion - The key version of the key used to encrypt data. + KeyVersion *string `json:"keyVersion,omitempty"` +} + +// LinkedWorkspace definition of the linked workspace. +type LinkedWorkspace struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Gets the id of the linked workspace. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinkedWorkspace. +func (lw LinkedWorkspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// LinuxProperties linux specific update configuration. +type LinuxProperties struct { + // IncludedPackageClassifications - Update classifications included in the software update configuration. Possible values include: 'LinuxUpdateClassesUnclassified', 'LinuxUpdateClassesCritical', 'LinuxUpdateClassesSecurity', 'LinuxUpdateClassesOther' + IncludedPackageClassifications LinuxUpdateClasses `json:"includedPackageClassifications,omitempty"` + // ExcludedPackageNameMasks - packages excluded from the software update configuration. + ExcludedPackageNameMasks *[]string `json:"excludedPackageNameMasks,omitempty"` + // IncludedPackageNameMasks - packages included from the software update configuration. + IncludedPackageNameMasks *[]string `json:"includedPackageNameMasks,omitempty"` + // RebootSetting - Reboot setting for the software update configuration. + RebootSetting *string `json:"rebootSetting,omitempty"` +} + +// Module definition of the module type. +type Module struct { + autorest.Response `json:"-"` + // ModuleProperties - Gets or sets the module properties. + *ModuleProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Module. +func (mVar Module) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.ModuleProperties != nil { + objectMap["properties"] = mVar.ModuleProperties + } + if mVar.Etag != nil { + objectMap["etag"] = mVar.Etag + } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags + } + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Module struct. +func (mVar *Module) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleProperties ModuleProperties + err = json.Unmarshal(*v, &moduleProperties) + if err != nil { + return err + } + mVar.ModuleProperties = &moduleProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + mVar.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mVar.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } + } + } + + return nil +} + +// ModuleCreateOrUpdateParameters the parameters supplied to the create or update module operation. +type ModuleCreateOrUpdateParameters struct { + // ModuleCreateOrUpdateProperties - Gets or sets the module create properties. + *ModuleCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ModuleCreateOrUpdateParameters. +func (mcoup ModuleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcoup.ModuleCreateOrUpdateProperties != nil { + objectMap["properties"] = mcoup.ModuleCreateOrUpdateProperties + } + if mcoup.Name != nil { + objectMap["name"] = mcoup.Name + } + if mcoup.Location != nil { + objectMap["location"] = mcoup.Location + } + if mcoup.Tags != nil { + objectMap["tags"] = mcoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. +func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleCreateOrUpdateProperties ModuleCreateOrUpdateProperties + err = json.Unmarshal(*v, &moduleCreateOrUpdateProperties) + if err != nil { + return err + } + mcoup.ModuleCreateOrUpdateProperties = &moduleCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcoup.Tags = tags + } + } + } + + return nil +} + +// ModuleCreateOrUpdateProperties the parameters supplied to the create or update module properties. +type ModuleCreateOrUpdateProperties struct { + // ContentLink - Gets or sets the module content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// ModuleErrorInfo definition of the module error info type. +type ModuleErrorInfo struct { + // Code - Gets or sets the error code. + Code *string `json:"code,omitempty"` + // Message - Gets or sets the error message. + Message *string `json:"message,omitempty"` +} + +// ModuleListResult the response model for the list module operation. +type ModuleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of modules. + Value *[]Module `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ModuleListResultIterator provides access to a complete listing of Module values. +type ModuleListResultIterator struct { + i int + page ModuleListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ModuleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ModuleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ModuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ModuleListResultIterator) Response() ModuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ModuleListResultIterator) Value() Module { + if !iter.page.NotDone() { + return Module{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ModuleListResultIterator type. +func NewModuleListResultIterator(page ModuleListResultPage) ModuleListResultIterator { + return ModuleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mlr ModuleListResult) IsEmpty() bool { + return mlr.Value == nil || len(*mlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mlr ModuleListResult) hasNextLink() bool { + return mlr.NextLink != nil && len(*mlr.NextLink) != 0 +} + +// moduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mlr ModuleListResult) moduleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !mlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mlr.NextLink))) +} + +// ModuleListResultPage contains a page of Module values. +type ModuleListResultPage struct { + fn func(context.Context, ModuleListResult) (ModuleListResult, error) + mlr ModuleListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ModuleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mlr) + if err != nil { + return err + } + page.mlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ModuleListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ModuleListResultPage) NotDone() bool { + return !page.mlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ModuleListResultPage) Response() ModuleListResult { + return page.mlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ModuleListResultPage) Values() []Module { + if page.mlr.IsEmpty() { + return nil + } + return *page.mlr.Value +} + +// Creates a new instance of the ModuleListResultPage type. +func NewModuleListResultPage(cur ModuleListResult, getNextPage func(context.Context, ModuleListResult) (ModuleListResult, error)) ModuleListResultPage { + return ModuleListResultPage{ + fn: getNextPage, + mlr: cur, + } +} + +// ModuleProperties definition of the module property type. +type ModuleProperties struct { + // IsGlobal - Gets or sets the isGlobal flag of the module. + IsGlobal *bool `json:"isGlobal,omitempty"` + // Version - Gets or sets the version of the module. + Version *string `json:"version,omitempty"` + // SizeInBytes - Gets or sets the size in bytes of the module. + SizeInBytes *int64 `json:"sizeInBytes,omitempty"` + // ActivityCount - Gets or sets the activity count of the module. + ActivityCount *int32 `json:"activityCount,omitempty"` + // ProvisioningState - Gets or sets the provisioning state of the module. Possible values include: 'ModuleProvisioningStateCreated', 'ModuleProvisioningStateCreating', 'ModuleProvisioningStateStartingImportModuleRunbook', 'ModuleProvisioningStateRunningImportModuleRunbook', 'ModuleProvisioningStateContentRetrieved', 'ModuleProvisioningStateContentDownloaded', 'ModuleProvisioningStateContentValidated', 'ModuleProvisioningStateConnectionTypeImported', 'ModuleProvisioningStateContentStored', 'ModuleProvisioningStateModuleDataStored', 'ModuleProvisioningStateActivitiesStored', 'ModuleProvisioningStateModuleImportRunbookComplete', 'ModuleProvisioningStateSucceeded', 'ModuleProvisioningStateFailed', 'ModuleProvisioningStateCancelled', 'ModuleProvisioningStateUpdating' + ProvisioningState ModuleProvisioningState `json:"provisioningState,omitempty"` + // ContentLink - Gets or sets the contentLink of the module. + ContentLink *ContentLink `json:"contentLink,omitempty"` + // Error - Gets or sets the error info of the module. + Error *ModuleErrorInfo `json:"error,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` + // IsComposite - Gets or sets type of module, if its composite or not. + IsComposite *bool `json:"isComposite,omitempty"` +} + +// ModuleUpdateParameters the parameters supplied to the update module operation. +type ModuleUpdateParameters struct { + // ModuleUpdateProperties - Gets or sets the module update properties. + *ModuleUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ModuleUpdateParameters. +func (mup ModuleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mup.ModuleUpdateProperties != nil { + objectMap["properties"] = mup.ModuleUpdateProperties + } + if mup.Name != nil { + objectMap["name"] = mup.Name + } + if mup.Location != nil { + objectMap["location"] = mup.Location + } + if mup.Tags != nil { + objectMap["tags"] = mup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ModuleUpdateParameters struct. +func (mup *ModuleUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var moduleUpdateProperties ModuleUpdateProperties + err = json.Unmarshal(*v, &moduleUpdateProperties) + if err != nil { + return err + } + mup.ModuleUpdateProperties = &moduleUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mup.Tags = tags + } + } + } + + return nil +} + +// ModuleUpdateProperties the parameters supplied to the update properties. +type ModuleUpdateProperties struct { + // ContentLink - Gets or sets the module content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// NodeCount number of nodes based on the Filter +type NodeCount struct { + // Name - Gets the name of a count type + Name *string `json:"name,omitempty"` + Properties *NodeCountProperties `json:"properties,omitempty"` +} + +// NodeCountProperties ... +type NodeCountProperties struct { + // Count - Gets the count for the name + Count *int32 `json:"count,omitempty"` +} + +// NodeCounts gets the count of nodes by count type +type NodeCounts struct { + autorest.Response `json:"-"` + // Value - Gets an array of counts + Value *[]NodeCount `json:"value,omitempty"` + // TotalCount - Gets the total number of records matching countType criteria. + TotalCount *int32 `json:"totalCount,omitempty"` +} + +// NonAzureQueryProperties non Azure query for the update configuration. +type NonAzureQueryProperties struct { + // FunctionAlias - Log Analytics Saved Search name. + FunctionAlias *string `json:"functionAlias,omitempty"` + // WorkspaceID - Workspace Id for Log Analytics in which the saved Search is resided. + WorkspaceID *string `json:"workspaceId,omitempty"` +} + +// Operation automation REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Provider, Resource and Operation values + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay provider, Resource and Operation values +type OperationDisplay struct { + // Provider - Service provider: Microsoft.Automation + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed: Runbooks, Jobs etc. + Resource *string `json:"resource,omitempty"` + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult the response model for the list of Automation operations +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of Automation operations supported by the Automation resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// PrivateEndpointConnection a private endpoint connection +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult a list of private endpoint connections +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - Private endpoint which the connection belongs to. + PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type PrivateEndpointConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("automation.PrivateEndpointConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateOrUpdateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("automation.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateEndpointProperty private endpoint which the connection belongs to. +type PrivateEndpointProperty struct { + // ID - Resource id of the private endpoint. + ID *string `json:"id,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection. +type PrivateLinkServiceConnectionStateProperty struct { + // Status - The private link service connection status. + Status *string `json:"status,omitempty"` + // Description - The private link service connection description. + Description *string `json:"description,omitempty"` + // ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect) + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. +func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plscsp.Status != nil { + objectMap["status"] = plscsp.Status + } + if plscsp.Description != nil { + objectMap["description"] = plscsp.Description + } + return json.Marshal(objectMap) +} + +// ProxyResource ARM proxy resource. +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PythonPackageCreateParameters the parameters supplied to the create or update module operation. +type PythonPackageCreateParameters struct { + // PythonPackageCreateProperties - Gets or sets the module create properties. + *PythonPackageCreateProperties `json:"properties,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PythonPackageCreateParameters. +func (ppcp PythonPackageCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppcp.PythonPackageCreateProperties != nil { + objectMap["properties"] = ppcp.PythonPackageCreateProperties + } + if ppcp.Tags != nil { + objectMap["tags"] = ppcp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PythonPackageCreateParameters struct. +func (ppcp *PythonPackageCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var pythonPackageCreateProperties PythonPackageCreateProperties + err = json.Unmarshal(*v, &pythonPackageCreateProperties) + if err != nil { + return err + } + ppcp.PythonPackageCreateProperties = &pythonPackageCreateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ppcp.Tags = tags + } + } + } + + return nil +} + +// PythonPackageCreateProperties the parameters supplied to the create or update module properties. +type PythonPackageCreateProperties struct { + // ContentLink - Gets or sets the module content link. + ContentLink *ContentLink `json:"contentLink,omitempty"` +} + +// PythonPackageUpdateParameters the parameters supplied to the update module operation. +type PythonPackageUpdateParameters struct { + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PythonPackageUpdateParameters. +func (ppup PythonPackageUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ppup.Tags != nil { + objectMap["tags"] = ppup.Tags + } + return json.Marshal(objectMap) +} + +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} + +// Resource the core properties of ARM resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RunAsCredentialAssociationProperty definition of RunAs credential to use for hybrid worker. +type RunAsCredentialAssociationProperty struct { + // Name - Gets or sets the name of the credential. + Name *string `json:"name,omitempty"` +} + +// Runbook definition of the runbook type. +type Runbook struct { + autorest.Response `json:"-"` + // RunbookProperties - Gets or sets the runbook properties. + *RunbookProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Runbook. +func (r Runbook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RunbookProperties != nil { + objectMap["properties"] = r.RunbookProperties + } + if r.Etag != nil { + objectMap["etag"] = r.Etag + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Location != nil { + objectMap["location"] = r.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Runbook struct. +func (r *Runbook) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookProperties RunbookProperties + err = json.Unmarshal(*v, &runbookProperties) + if err != nil { + return err + } + r.RunbookProperties = &runbookProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + r.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + } + } + + return nil +} + +// RunbookAssociationProperty the runbook property associated with the entity. +type RunbookAssociationProperty struct { + // Name - Gets or sets the name of the runbook. + Name *string `json:"name,omitempty"` +} + +// RunbookCreateOrUpdateDraftParameters the parameters supplied to the create or update runbook operation. +type RunbookCreateOrUpdateDraftParameters struct { + // RunbookContent - Content of the Runbook. + RunbookContent *string `json:"runbookContent,omitempty"` +} + +// RunbookCreateOrUpdateDraftProperties the parameters supplied to the create or update draft runbook +// properties. +type RunbookCreateOrUpdateDraftProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'RunbookTypeEnumScript', 'RunbookTypeEnumGraph', 'RunbookTypeEnumPowerShellWorkflow', 'RunbookTypeEnumPowerShell', 'RunbookTypeEnumGraphPowerShellWorkflow', 'RunbookTypeEnumGraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// RunbookCreateOrUpdateParameters the parameters supplied to the create or update runbook operation. +type RunbookCreateOrUpdateParameters struct { + // RunbookCreateOrUpdateProperties - Gets or sets runbook create or update properties. + *RunbookCreateOrUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookCreateOrUpdateParameters. +func (rcoup RunbookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcoup.RunbookCreateOrUpdateProperties != nil { + objectMap["properties"] = rcoup.RunbookCreateOrUpdateProperties + } + if rcoup.Name != nil { + objectMap["name"] = rcoup.Name + } + if rcoup.Location != nil { + objectMap["location"] = rcoup.Location + } + if rcoup.Tags != nil { + objectMap["tags"] = rcoup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RunbookCreateOrUpdateParameters struct. +func (rcoup *RunbookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookCreateOrUpdateProperties RunbookCreateOrUpdateProperties + err = json.Unmarshal(*v, &runbookCreateOrUpdateProperties) + if err != nil { + return err + } + rcoup.RunbookCreateOrUpdateProperties = &runbookCreateOrUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcoup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rcoup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rcoup.Tags = tags + } + } + } + + return nil +} + +// RunbookCreateOrUpdateProperties the parameters supplied to the create or update runbook properties. +type RunbookCreateOrUpdateProperties struct { + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'RunbookTypeEnumScript', 'RunbookTypeEnumGraph', 'RunbookTypeEnumPowerShellWorkflow', 'RunbookTypeEnumPowerShell', 'RunbookTypeEnumGraphPowerShellWorkflow', 'RunbookTypeEnumGraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // PublishContentLink - Gets or sets the published runbook content link. + PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// RunbookDraft ... +type RunbookDraft struct { + autorest.Response `json:"-"` + // InEdit - Gets or sets whether runbook is in edit mode. + InEdit *bool `json:"inEdit,omitempty"` + // DraftContentLink - Gets or sets the draft runbook content link. + DraftContentLink *ContentLink `json:"draftContentLink,omitempty"` + // CreationTime - Gets or sets the creation time of the runbook draft. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the runbook draft. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Parameters - Gets or sets the runbook draft parameters. + Parameters map[string]*RunbookParameter `json:"parameters"` + // OutputTypes - Gets or sets the runbook output types. + OutputTypes *[]string `json:"outputTypes,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunbookDraft. +func (rd RunbookDraft) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rd.InEdit != nil { + objectMap["inEdit"] = rd.InEdit + } + if rd.DraftContentLink != nil { + objectMap["draftContentLink"] = rd.DraftContentLink + } + if rd.CreationTime != nil { + objectMap["creationTime"] = rd.CreationTime + } + if rd.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rd.LastModifiedTime + } + if rd.Parameters != nil { + objectMap["parameters"] = rd.Parameters + } + if rd.OutputTypes != nil { + objectMap["outputTypes"] = rd.OutputTypes + } + return json.Marshal(objectMap) +} + +// RunbookDraftReplaceContentFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RunbookDraftReplaceContentFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RunbookDraftClient) (ReadCloser, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RunbookDraftReplaceContentFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RunbookDraftReplaceContentFuture.Result. +func (future *RunbookDraftReplaceContentFuture) result(client RunbookDraftClient) (rc ReadCloser, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rc.Response.Response, err = future.GetResult(sender); err == nil && rc.Response.Response.StatusCode != http.StatusNoContent { + rc, err = client.ReplaceContentResponder(rc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", rc.Response.Response, "Failure responding to request") + } + } + return +} + +// RunbookDraftUndoEditResult the response model for the undo edit runbook operation. +type RunbookDraftUndoEditResult struct { + autorest.Response `json:"-"` + // StatusCode - Possible values include: 'HTTPStatusCodeContinue', 'HTTPStatusCodeSwitchingProtocols', 'HTTPStatusCodeOK', 'HTTPStatusCodeCreated', 'HTTPStatusCodeAccepted', 'HTTPStatusCodeNonAuthoritativeInformation', 'HTTPStatusCodeNoContent', 'HTTPStatusCodeResetContent', 'HTTPStatusCodePartialContent', 'HTTPStatusCodeMultipleChoices', 'HTTPStatusCodeAmbiguous', 'HTTPStatusCodeMovedPermanently', 'HTTPStatusCodeMoved', 'HTTPStatusCodeFound', 'HTTPStatusCodeRedirect', 'HTTPStatusCodeSeeOther', 'HTTPStatusCodeRedirectMethod', 'HTTPStatusCodeNotModified', 'HTTPStatusCodeUseProxy', 'HTTPStatusCodeUnused', 'HTTPStatusCodeTemporaryRedirect', 'HTTPStatusCodeRedirectKeepVerb', 'HTTPStatusCodeBadRequest', 'HTTPStatusCodeUnauthorized', 'HTTPStatusCodePaymentRequired', 'HTTPStatusCodeForbidden', 'HTTPStatusCodeNotFound', 'HTTPStatusCodeMethodNotAllowed', 'HTTPStatusCodeNotAcceptable', 'HTTPStatusCodeProxyAuthenticationRequired', 'HTTPStatusCodeRequestTimeout', 'HTTPStatusCodeConflict', 'HTTPStatusCodeGone', 'HTTPStatusCodeLengthRequired', 'HTTPStatusCodePreconditionFailed', 'HTTPStatusCodeRequestEntityTooLarge', 'HTTPStatusCodeRequestURITooLong', 'HTTPStatusCodeUnsupportedMediaType', 'HTTPStatusCodeRequestedRangeNotSatisfiable', 'HTTPStatusCodeExpectationFailed', 'HTTPStatusCodeUpgradeRequired', 'HTTPStatusCodeInternalServerError', 'HTTPStatusCodeNotImplemented', 'HTTPStatusCodeBadGateway', 'HTTPStatusCodeServiceUnavailable', 'HTTPStatusCodeGatewayTimeout', 'HTTPStatusCodeHTTPVersionNotSupported' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + RequestID *string `json:"requestId,omitempty"` +} + +// RunbookListResult the response model for the list runbook operation. +type RunbookListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of runbooks. + Value *[]Runbook `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// RunbookListResultIterator provides access to a complete listing of Runbook values. +type RunbookListResultIterator struct { + i int + page RunbookListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RunbookListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RunbookListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RunbookListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RunbookListResultIterator) Response() RunbookListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RunbookListResultIterator) Value() Runbook { + if !iter.page.NotDone() { + return Runbook{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RunbookListResultIterator type. +func NewRunbookListResultIterator(page RunbookListResultPage) RunbookListResultIterator { + return RunbookListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RunbookListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rlr RunbookListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + +// runbookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RunbookListResult) runbookListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RunbookListResultPage contains a page of Runbook values. +type RunbookListResultPage struct { + fn func(context.Context, RunbookListResult) (RunbookListResult, error) + rlr RunbookListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RunbookListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RunbookListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RunbookListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RunbookListResultPage) Response() RunbookListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RunbookListResultPage) Values() []Runbook { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// Creates a new instance of the RunbookListResultPage type. +func NewRunbookListResultPage(cur RunbookListResult, getNextPage func(context.Context, RunbookListResult) (RunbookListResult, error)) RunbookListResultPage { + return RunbookListResultPage{ + fn: getNextPage, + rlr: cur, + } +} + +// RunbookParameter definition of the runbook parameter type. +type RunbookParameter struct { + // Type - Gets or sets the type of the parameter. + Type *string `json:"type,omitempty"` + // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. + IsMandatory *bool `json:"isMandatory,omitempty"` + // Position - Get or sets the position of the parameter. + Position *int32 `json:"position,omitempty"` + // DefaultValue - Gets or sets the default value of parameter. + DefaultValue *string `json:"defaultValue,omitempty"` +} + +// RunbookProperties definition of the runbook property type. +type RunbookProperties struct { + // RunbookType - Gets or sets the type of the runbook. Possible values include: 'RunbookTypeEnumScript', 'RunbookTypeEnumGraph', 'RunbookTypeEnumPowerShellWorkflow', 'RunbookTypeEnumPowerShell', 'RunbookTypeEnumGraphPowerShellWorkflow', 'RunbookTypeEnumGraphPowerShell' + RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` + // PublishContentLink - Gets or sets the published runbook content link. + PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` + // State - Gets or sets the state of the runbook. Possible values include: 'RunbookStateNew', 'RunbookStateEdit', 'RunbookStatePublished' + State RunbookState `json:"state,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // LogActivityTrace - Gets or sets the option to log activity trace of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` + // JobCount - Gets or sets the job count of the runbook. + JobCount *int32 `json:"jobCount,omitempty"` + // Parameters - Gets or sets the runbook parameters. + Parameters map[string]*RunbookParameter `json:"parameters"` + // OutputTypes - Gets or sets the runbook output types. + OutputTypes *[]string `json:"outputTypes,omitempty"` + // Draft - Gets or sets the draft runbook properties. + Draft *RunbookDraft `json:"draft,omitempty"` + // ProvisioningState - Gets or sets the provisioning state of the runbook. Possible values include: 'RunbookProvisioningStateSucceeded' + ProvisioningState RunbookProvisioningState `json:"provisioningState,omitempty"` + // LastModifiedBy - Gets or sets the last modified by. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunbookProperties. +func (rp RunbookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RunbookType != "" { + objectMap["runbookType"] = rp.RunbookType + } + if rp.PublishContentLink != nil { + objectMap["publishContentLink"] = rp.PublishContentLink + } + if rp.State != "" { + objectMap["state"] = rp.State + } + if rp.LogVerbose != nil { + objectMap["logVerbose"] = rp.LogVerbose + } + if rp.LogProgress != nil { + objectMap["logProgress"] = rp.LogProgress + } + if rp.LogActivityTrace != nil { + objectMap["logActivityTrace"] = rp.LogActivityTrace + } + if rp.JobCount != nil { + objectMap["jobCount"] = rp.JobCount + } + if rp.Parameters != nil { + objectMap["parameters"] = rp.Parameters + } + if rp.OutputTypes != nil { + objectMap["outputTypes"] = rp.OutputTypes + } + if rp.Draft != nil { + objectMap["draft"] = rp.Draft + } + if rp.ProvisioningState != "" { + objectMap["provisioningState"] = rp.ProvisioningState + } + if rp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = rp.LastModifiedBy + } + if rp.CreationTime != nil { + objectMap["creationTime"] = rp.CreationTime + } + if rp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = rp.LastModifiedTime + } + if rp.Description != nil { + objectMap["description"] = rp.Description + } + return json.Marshal(objectMap) +} + +// RunbookPublishFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RunbookPublishFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RunbookClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RunbookPublishFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RunbookPublishFuture.Result. +func (future *RunbookPublishFuture) result(client RunbookClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookPublishFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("automation.RunbookPublishFuture") + return + } + ar.Response = future.Response() + return +} + +// RunbookUpdateParameters the parameters supplied to the update runbook operation. +type RunbookUpdateParameters struct { + // RunbookUpdateProperties - Gets or sets the runbook update properties. + *RunbookUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Gets or sets the location of the resource. + Location *string `json:"location,omitempty"` + // Tags - Gets or sets the tags attached to the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RunbookUpdateParameters. +func (rup RunbookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.RunbookUpdateProperties != nil { + objectMap["properties"] = rup.RunbookUpdateProperties + } + if rup.Name != nil { + objectMap["name"] = rup.Name + } + if rup.Location != nil { + objectMap["location"] = rup.Location + } + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RunbookUpdateParameters struct. +func (rup *RunbookUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runbookUpdateProperties RunbookUpdateProperties + err = json.Unmarshal(*v, &runbookUpdateProperties) + if err != nil { + return err + } + rup.RunbookUpdateProperties = &runbookUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rup.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rup.Tags = tags + } + } + } + + return nil +} + +// RunbookUpdateProperties the parameters supplied to the update runbook properties. +type RunbookUpdateProperties struct { + // Description - Gets or sets the description of the runbook. + Description *string `json:"description,omitempty"` + // LogVerbose - Gets or sets verbose log option. + LogVerbose *bool `json:"logVerbose,omitempty"` + // LogProgress - Gets or sets progress log option. + LogProgress *bool `json:"logProgress,omitempty"` + // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// Schedule definition of the schedule. +type Schedule struct { + autorest.Response `json:"-"` + // ScheduleProperties - Gets or sets the properties of the schedule. + *ScheduleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ScheduleProperties != nil { + objectMap["properties"] = s.ScheduleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Schedule struct. +func (s *Schedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduleProperties ScheduleProperties + err = json.Unmarshal(*v, &scheduleProperties) + if err != nil { + return err + } + s.ScheduleProperties = &scheduleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ScheduleAssociationProperty the schedule property associated with the entity. +type ScheduleAssociationProperty struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` +} + +// ScheduleCreateOrUpdateParameters the parameters supplied to the create or update schedule operation. +type ScheduleCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` + // ScheduleCreateOrUpdateProperties - Gets or sets the list of schedule properties. + *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleCreateOrUpdateParameters. +func (scoup ScheduleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scoup.Name != nil { + objectMap["name"] = scoup.Name + } + if scoup.ScheduleCreateOrUpdateProperties != nil { + objectMap["properties"] = scoup.ScheduleCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleCreateOrUpdateParameters struct. +func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scoup.Name = &name + } + case "properties": + if v != nil { + var scheduleCreateOrUpdateProperties ScheduleCreateOrUpdateProperties + err = json.Unmarshal(*v, &scheduleCreateOrUpdateProperties) + if err != nil { + return err + } + scoup.ScheduleCreateOrUpdateProperties = &scheduleCreateOrUpdateProperties + } + } + } + + return nil +} + +// ScheduleCreateOrUpdateProperties the parameters supplied to the create or update schedule operation. +type ScheduleCreateOrUpdateProperties struct { + // Description - Gets or sets the description of the schedule. + Description *string `json:"description,omitempty"` + // StartTime - Gets or sets the start time of the schedule. + StartTime *date.Time `json:"startTime,omitempty"` + // ExpiryTime - Gets or sets the end time of the schedule. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // Interval - Gets or sets the interval of the schedule. + Interval interface{} `json:"interval,omitempty"` + // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // TimeZone - Gets or sets the time zone of the schedule. + TimeZone *string `json:"timeZone,omitempty"` + // AdvancedSchedule - Gets or sets the AdvancedSchedule. + AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` +} + +// ScheduleListResult the response model for the list schedule operation. +type ScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of schedules. + Value *[]Schedule `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// ScheduleListResultIterator provides access to a complete listing of Schedule values. +type ScheduleListResultIterator struct { + i int + page ScheduleListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ScheduleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ScheduleListResultIterator) Response() ScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ScheduleListResultIterator) Value() Schedule { + if !iter.page.NotDone() { + return Schedule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ScheduleListResultIterator type. +func NewScheduleListResultIterator(page ScheduleListResultPage) ScheduleListResultIterator { + return ScheduleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr ScheduleListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (slr ScheduleListResult) hasNextLink() bool { + return slr.NextLink != nil && len(*slr.NextLink) != 0 +} + +// scheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr ScheduleListResult) scheduleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !slr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// ScheduleListResultPage contains a page of Schedule values. +type ScheduleListResultPage struct { + fn func(context.Context, ScheduleListResult) (ScheduleListResult, error) + slr ScheduleListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ScheduleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ScheduleListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ScheduleListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ScheduleListResultPage) Response() ScheduleListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ScheduleListResultPage) Values() []Schedule { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// Creates a new instance of the ScheduleListResultPage type. +func NewScheduleListResultPage(cur ScheduleListResult, getNextPage func(context.Context, ScheduleListResult) (ScheduleListResult, error)) ScheduleListResultPage { + return ScheduleListResultPage{ + fn: getNextPage, + slr: cur, + } +} + +// ScheduleProperties definition of schedule parameters. +type ScheduleProperties struct { + // StartTime - Gets or sets the start time of the schedule. + StartTime *date.Time `json:"startTime,omitempty"` + // StartTimeOffsetMinutes - READ-ONLY; Gets the start time's offset in minutes. + StartTimeOffsetMinutes *float64 `json:"startTimeOffsetMinutes,omitempty"` + // ExpiryTime - Gets or sets the end time of the schedule. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // ExpiryTimeOffsetMinutes - Gets or sets the expiry time's offset in minutes. + ExpiryTimeOffsetMinutes *float64 `json:"expiryTimeOffsetMinutes,omitempty"` + // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // NextRun - Gets or sets the next run time of the schedule. + NextRun *date.Time `json:"nextRun,omitempty"` + // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. + NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` + // Interval - Gets or sets the interval of the schedule. + Interval interface{} `json:"interval,omitempty"` + // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // TimeZone - Gets or sets the time zone of the schedule. + TimeZone *string `json:"timeZone,omitempty"` + // AdvancedSchedule - Gets or sets the advanced schedule. + AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleProperties. +func (sp ScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.StartTime != nil { + objectMap["startTime"] = sp.StartTime + } + if sp.ExpiryTime != nil { + objectMap["expiryTime"] = sp.ExpiryTime + } + if sp.ExpiryTimeOffsetMinutes != nil { + objectMap["expiryTimeOffsetMinutes"] = sp.ExpiryTimeOffsetMinutes + } + if sp.IsEnabled != nil { + objectMap["isEnabled"] = sp.IsEnabled + } + if sp.NextRun != nil { + objectMap["nextRun"] = sp.NextRun + } + if sp.NextRunOffsetMinutes != nil { + objectMap["nextRunOffsetMinutes"] = sp.NextRunOffsetMinutes + } + if sp.Interval != nil { + objectMap["interval"] = sp.Interval + } + if sp.Frequency != "" { + objectMap["frequency"] = sp.Frequency + } + if sp.TimeZone != nil { + objectMap["timeZone"] = sp.TimeZone + } + if sp.AdvancedSchedule != nil { + objectMap["advancedSchedule"] = sp.AdvancedSchedule + } + if sp.CreationTime != nil { + objectMap["creationTime"] = sp.CreationTime + } + if sp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = sp.LastModifiedTime + } + if sp.Description != nil { + objectMap["description"] = sp.Description + } + return json.Marshal(objectMap) +} + +// ScheduleUpdateParameters the parameters supplied to the update schedule operation. +type ScheduleUpdateParameters struct { + // Name - Gets or sets the name of the Schedule. + Name *string `json:"name,omitempty"` + // ScheduleUpdateProperties - Gets or sets the list of schedule properties. + *ScheduleUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleUpdateParameters. +func (sup ScheduleUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sup.Name != nil { + objectMap["name"] = sup.Name + } + if sup.ScheduleUpdateProperties != nil { + objectMap["properties"] = sup.ScheduleUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleUpdateParameters struct. +func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sup.Name = &name + } + case "properties": + if v != nil { + var scheduleUpdateProperties ScheduleUpdateProperties + err = json.Unmarshal(*v, &scheduleUpdateProperties) + if err != nil { + return err + } + sup.ScheduleUpdateProperties = &scheduleUpdateProperties + } + } + } + + return nil +} + +// ScheduleUpdateProperties the parameters supplied to the update schedule operation. +type ScheduleUpdateProperties struct { + // Description - Gets or sets the description of the schedule. + Description *string `json:"description,omitempty"` + // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// Sku the account SKU. +type Sku struct { + // Name - Gets or sets the SKU name of the account. Possible values include: 'SkuNameEnumFree', 'SkuNameEnumBasic' + Name SkuNameEnum `json:"name,omitempty"` + // Family - Gets or sets the SKU family. + Family *string `json:"family,omitempty"` + // Capacity - Gets or sets the SKU capacity. + Capacity *int32 `json:"capacity,omitempty"` +} + +// SoftwareUpdateConfiguration software update configuration properties. +type SoftwareUpdateConfiguration struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // SoftwareUpdateConfigurationProperties - Software update configuration properties. + *SoftwareUpdateConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfiguration. +func (suc SoftwareUpdateConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if suc.SoftwareUpdateConfigurationProperties != nil { + objectMap["properties"] = suc.SoftwareUpdateConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfiguration struct. +func (suc *SoftwareUpdateConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + suc.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + suc.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + suc.Type = &typeVar + } + case "properties": + if v != nil { + var softwareUpdateConfigurationProperties SoftwareUpdateConfigurationProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationProperties) + if err != nil { + return err + } + suc.SoftwareUpdateConfigurationProperties = &softwareUpdateConfigurationProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationCollectionItem software update configuration collection item properties. +type SoftwareUpdateConfigurationCollectionItem struct { + // Name - READ-ONLY; Name of the software update configuration. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Resource Id of the software update configuration + ID *string `json:"id,omitempty"` + // SoftwareUpdateConfigurationCollectionItemProperties - Software update configuration properties. + *SoftwareUpdateConfigurationCollectionItemProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItem. +func (succi SoftwareUpdateConfigurationCollectionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if succi.SoftwareUpdateConfigurationCollectionItemProperties != nil { + objectMap["properties"] = succi.SoftwareUpdateConfigurationCollectionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationCollectionItem struct. +func (succi *SoftwareUpdateConfigurationCollectionItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + succi.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + succi.ID = &ID + } + case "properties": + if v != nil { + var softwareUpdateConfigurationCollectionItemProperties SoftwareUpdateConfigurationCollectionItemProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationCollectionItemProperties) + if err != nil { + return err + } + succi.SoftwareUpdateConfigurationCollectionItemProperties = &softwareUpdateConfigurationCollectionItemProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationCollectionItemProperties software update configuration collection item +// properties. +type SoftwareUpdateConfigurationCollectionItemProperties struct { + // UpdateConfiguration - Update specific properties of the software update configuration. + UpdateConfiguration *UpdateConfiguration `json:"updateConfiguration,omitempty"` + // Tasks - Pre and Post Tasks defined + Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` + // Frequency - execution frequency of the schedule associated with the software update configuration. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // StartTime - the start time of the update. + StartTime *date.Time `json:"startTime,omitempty"` + // CreationTime - READ-ONLY; Creation time of the software update configuration, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - READ-ONLY; Last time software update configuration was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state for the software update configuration, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // NextRun - ext run time of the update. + NextRun *date.Time `json:"nextRun,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItemProperties. +func (succip SoftwareUpdateConfigurationCollectionItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if succip.UpdateConfiguration != nil { + objectMap["updateConfiguration"] = succip.UpdateConfiguration + } + if succip.Tasks != nil { + objectMap["tasks"] = succip.Tasks + } + if succip.Frequency != "" { + objectMap["frequency"] = succip.Frequency + } + if succip.StartTime != nil { + objectMap["startTime"] = succip.StartTime + } + if succip.NextRun != nil { + objectMap["nextRun"] = succip.NextRun + } + return json.Marshal(objectMap) +} + +// SoftwareUpdateConfigurationListResult result of listing all software update configuration +type SoftwareUpdateConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configurations + Value *[]SoftwareUpdateConfigurationCollectionItem `json:"value,omitempty"` +} + +// SoftwareUpdateConfigurationMachineRun software update configuration machine run model. +type SoftwareUpdateConfigurationMachineRun struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Name of the software update configuration machine run + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Resource Id of the software update configuration machine run + ID *string `json:"id,omitempty"` + // UpdateConfigurationMachineRunProperties - Software update configuration machine run properties. + *UpdateConfigurationMachineRunProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationMachineRun. +func (sucmr SoftwareUpdateConfigurationMachineRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucmr.UpdateConfigurationMachineRunProperties != nil { + objectMap["properties"] = sucmr.UpdateConfigurationMachineRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationMachineRun struct. +func (sucmr *SoftwareUpdateConfigurationMachineRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sucmr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sucmr.ID = &ID + } + case "properties": + if v != nil { + var updateConfigurationMachineRunProperties UpdateConfigurationMachineRunProperties + err = json.Unmarshal(*v, &updateConfigurationMachineRunProperties) + if err != nil { + return err + } + sucmr.UpdateConfigurationMachineRunProperties = &updateConfigurationMachineRunProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationMachineRunListResult result of listing all software update configuration +// machine runs +type SoftwareUpdateConfigurationMachineRunListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configuration machine runs + Value *[]SoftwareUpdateConfigurationMachineRun `json:"value,omitempty"` + // NextLink - link to next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SoftwareUpdateConfigurationProperties software update configuration properties. +type SoftwareUpdateConfigurationProperties struct { + // UpdateConfiguration - update specific properties for the Software update configuration + UpdateConfiguration *UpdateConfiguration `json:"updateConfiguration,omitempty"` + // ScheduleInfo - Schedule information for the Software update configuration + ScheduleInfo *SUCScheduleProperties `json:"scheduleInfo,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state for the software update configuration, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Error - Details of provisioning error + Error *ErrorResponse `json:"error,omitempty"` + // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - READ-ONLY; CreatedBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - READ-ONLY; LastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Tasks - Tasks information for the Software update configuration. + Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationProperties. +func (sucp SoftwareUpdateConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucp.UpdateConfiguration != nil { + objectMap["updateConfiguration"] = sucp.UpdateConfiguration + } + if sucp.ScheduleInfo != nil { + objectMap["scheduleInfo"] = sucp.ScheduleInfo + } + if sucp.Error != nil { + objectMap["error"] = sucp.Error + } + if sucp.Tasks != nil { + objectMap["tasks"] = sucp.Tasks + } + return json.Marshal(objectMap) +} + +// SoftwareUpdateConfigurationRun software update configuration Run properties. +type SoftwareUpdateConfigurationRun struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Name of the software update configuration run. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; Resource Id of the software update configuration run + ID *string `json:"id,omitempty"` + // SoftwareUpdateConfigurationRunProperties - Software update configuration Run properties. + *SoftwareUpdateConfigurationRunProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRun. +func (sucr SoftwareUpdateConfigurationRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucr.SoftwareUpdateConfigurationRunProperties != nil { + objectMap["properties"] = sucr.SoftwareUpdateConfigurationRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationRun struct. +func (sucr *SoftwareUpdateConfigurationRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sucr.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sucr.ID = &ID + } + case "properties": + if v != nil { + var softwareUpdateConfigurationRunProperties SoftwareUpdateConfigurationRunProperties + err = json.Unmarshal(*v, &softwareUpdateConfigurationRunProperties) + if err != nil { + return err + } + sucr.SoftwareUpdateConfigurationRunProperties = &softwareUpdateConfigurationRunProperties + } + } + } + + return nil +} + +// SoftwareUpdateConfigurationRunListResult result of listing all software update configuration runs +type SoftwareUpdateConfigurationRunListResult struct { + autorest.Response `json:"-"` + // Value - outer object returned when listing all software update configuration runs + Value *[]SoftwareUpdateConfigurationRun `json:"value,omitempty"` + // NextLink - link to next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SoftwareUpdateConfigurationRunProperties software update configuration properties. +type SoftwareUpdateConfigurationRunProperties struct { + // SoftwareUpdateConfiguration - software update configuration triggered this run + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + // Status - READ-ONLY; Status of the software update configuration run. + Status *string `json:"status,omitempty"` + // ConfiguredDuration - READ-ONLY; Configured duration for the software update configuration run. + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + // OsType - READ-ONLY; Operating system target of the software update configuration triggered this run + OsType *string `json:"osType,omitempty"` + // StartTime - READ-ONLY; Start time of the software update configuration run. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time of the software update configuration run. + EndTime *date.Time `json:"endTime,omitempty"` + // ComputerCount - READ-ONLY; Number of computers in the software update configuration run. + ComputerCount *int32 `json:"computerCount,omitempty"` + // FailedCount - READ-ONLY; Number of computers with failed status. + FailedCount *int32 `json:"failedCount,omitempty"` + // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - READ-ONLY; CreatedBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - READ-ONLY; LastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Tasks - Software update configuration tasks triggered in this run + Tasks *SoftwareUpdateConfigurationRunTasks `json:"tasks,omitempty"` +} + +// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRunProperties. +func (sucrp SoftwareUpdateConfigurationRunProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sucrp.SoftwareUpdateConfiguration != nil { + objectMap["softwareUpdateConfiguration"] = sucrp.SoftwareUpdateConfiguration + } + if sucrp.Tasks != nil { + objectMap["tasks"] = sucrp.Tasks + } + return json.Marshal(objectMap) +} + +// SoftwareUpdateConfigurationRunTaskProperties task properties of the software update configuration. +type SoftwareUpdateConfigurationRunTaskProperties struct { + // Status - The status of the task. + Status *string `json:"status,omitempty"` + // Source - The name of the source of the task. + Source *string `json:"source,omitempty"` + // JobID - The job id of the task. + JobID *string `json:"jobId,omitempty"` +} + +// SoftwareUpdateConfigurationRunTasks software update configuration run tasks model. +type SoftwareUpdateConfigurationRunTasks struct { + // PreTask - Pre task properties. + PreTask *SoftwareUpdateConfigurationRunTaskProperties `json:"preTask,omitempty"` + // PostTask - Post task properties. + PostTask *SoftwareUpdateConfigurationRunTaskProperties `json:"postTask,omitempty"` +} + +// SoftwareUpdateConfigurationTasks task properties of the software update configuration. +type SoftwareUpdateConfigurationTasks struct { + // PreTask - Pre task properties. + PreTask *TaskProperties `json:"preTask,omitempty"` + // PostTask - Post task properties. + PostTask *TaskProperties `json:"postTask,omitempty"` +} + +// SourceControl definition of the source control. +type SourceControl struct { + autorest.Response `json:"-"` + // SourceControlProperties - The properties of the source control. + *SourceControlProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControl. +func (sc SourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SourceControlProperties != nil { + objectMap["properties"] = sc.SourceControlProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControl struct. +func (sc *SourceControl) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlProperties SourceControlProperties + err = json.Unmarshal(*v, &sourceControlProperties) + if err != nil { + return err + } + sc.SourceControlProperties = &sourceControlProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + } + } + + return nil +} + +// SourceControlCreateOrUpdateParameters the parameters supplied to the create or update source control +// operation. +type SourceControlCreateOrUpdateParameters struct { + // SourceControlCreateOrUpdateProperties - The properties of the source control. + *SourceControlCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlCreateOrUpdateParameters. +func (sccoup SourceControlCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sccoup.SourceControlCreateOrUpdateProperties != nil { + objectMap["properties"] = sccoup.SourceControlCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlCreateOrUpdateParameters struct. +func (sccoup *SourceControlCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlCreateOrUpdateProperties SourceControlCreateOrUpdateProperties + err = json.Unmarshal(*v, &sourceControlCreateOrUpdateProperties) + if err != nil { + return err + } + sccoup.SourceControlCreateOrUpdateProperties = &sourceControlCreateOrUpdateProperties + } + } + } + + return nil +} + +// SourceControlCreateOrUpdateProperties the properties of the create source control operation. +type SourceControlCreateOrUpdateProperties struct { + // RepoURL - The repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - The repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - The folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - The auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - The auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'SourceTypeVsoGit', 'SourceTypeVsoTfvc', 'SourceTypeGitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // SecurityToken - The authorization token for the repo of the source control. + SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` + // Description - The user description of the source control. + Description *string `json:"description,omitempty"` +} + +// SourceControlListResult the response model for the list source controls operation. +type SourceControlListResult struct { + autorest.Response `json:"-"` + // Value - The list of source controls. + Value *[]SourceControl `json:"value,omitempty"` + // NextLink - The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlListResultIterator provides access to a complete listing of SourceControl values. +type SourceControlListResultIterator struct { + i int + page SourceControlListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SourceControlListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlListResultIterator) Response() SourceControlListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlListResultIterator) Value() SourceControl { + if !iter.page.NotDone() { + return SourceControl{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SourceControlListResultIterator type. +func NewSourceControlListResultIterator(page SourceControlListResultPage) SourceControlListResultIterator { + return SourceControlListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sclr SourceControlListResult) IsEmpty() bool { + return sclr.Value == nil || len(*sclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sclr SourceControlListResult) hasNextLink() bool { + return sclr.NextLink != nil && len(*sclr.NextLink) != 0 +} + +// sourceControlListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sclr SourceControlListResult) sourceControlListResultPreparer(ctx context.Context) (*http.Request, error) { + if !sclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sclr.NextLink))) +} + +// SourceControlListResultPage contains a page of SourceControl values. +type SourceControlListResultPage struct { + fn func(context.Context, SourceControlListResult) (SourceControlListResult, error) + sclr SourceControlListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sclr) + if err != nil { + return err + } + page.sclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SourceControlListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlListResultPage) NotDone() bool { + return !page.sclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlListResultPage) Response() SourceControlListResult { + return page.sclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlListResultPage) Values() []SourceControl { + if page.sclr.IsEmpty() { + return nil + } + return *page.sclr.Value +} + +// Creates a new instance of the SourceControlListResultPage type. +func NewSourceControlListResultPage(cur SourceControlListResult, getNextPage func(context.Context, SourceControlListResult) (SourceControlListResult, error)) SourceControlListResultPage { + return SourceControlListResultPage{ + fn: getNextPage, + sclr: cur, + } +} + +// SourceControlProperties definition of the source control properties +type SourceControlProperties struct { + // RepoURL - The repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - The repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - The folder path of the source control. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - The auto sync of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - The auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values include: 'SourceTypeVsoGit', 'SourceTypeVsoTfvc', 'SourceTypeGitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // Description - The description. + Description *string `json:"description,omitempty"` + // CreationTime - The creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - The last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` +} + +// SourceControlSecurityTokenProperties ... +type SourceControlSecurityTokenProperties struct { + // AccessToken - The access token. + AccessToken *string `json:"accessToken,omitempty"` + // RefreshToken - The refresh token. + RefreshToken *string `json:"refreshToken,omitempty"` + // TokenType - The token type. Must be either PersonalAccessToken or Oauth. Possible values include: 'TokenTypePersonalAccessToken', 'TokenTypeOauth' + TokenType TokenType `json:"tokenType,omitempty"` +} + +// SourceControlSyncJob definition of the source control sync job. +type SourceControlSyncJob struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobProperties - The properties of the source control sync job. + *SourceControlSyncJobProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJob. +func (scsj SourceControlSyncJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsj.SourceControlSyncJobProperties != nil { + objectMap["properties"] = scsj.SourceControlSyncJobProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJob struct. +func (scsj *SourceControlSyncJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scsj.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scsj.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsj.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobProperties SourceControlSyncJobProperties + err = json.Unmarshal(*v, &sourceControlSyncJobProperties) + if err != nil { + return err + } + scsj.SourceControlSyncJobProperties = &sourceControlSyncJobProperties + } + } + } + + return nil +} + +// SourceControlSyncJobByID definition of the source control sync job. +type SourceControlSyncJobByID struct { + autorest.Response `json:"-"` + // ID - The id of the job. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobByIDProperties - The properties of the source control sync job. + *SourceControlSyncJobByIDProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobByID. +func (scsjbi SourceControlSyncJobByID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjbi.ID != nil { + objectMap["id"] = scsjbi.ID + } + if scsjbi.SourceControlSyncJobByIDProperties != nil { + objectMap["properties"] = scsjbi.SourceControlSyncJobByIDProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobByID struct. +func (scsjbi *SourceControlSyncJobByID) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjbi.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobByIDProperties SourceControlSyncJobByIDProperties + err = json.Unmarshal(*v, &sourceControlSyncJobByIDProperties) + if err != nil { + return err + } + scsjbi.SourceControlSyncJobByIDProperties = &sourceControlSyncJobByIDProperties + } + } + } + + return nil +} + +// SourceControlSyncJobByIDProperties definition of source control sync job properties. +type SourceControlSyncJobByIDProperties struct { + // SourceControlSyncJobID - The source control sync job id. + SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` + // CreationTime - READ-ONLY; The creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - The provisioning state of the job. Possible values include: 'ProvisioningStateCompleted', 'ProvisioningStateFailed', 'ProvisioningStateRunning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // SyncType - The sync type. Possible values include: 'SyncTypePartialSync', 'SyncTypeFullSync' + SyncType SyncType `json:"syncType,omitempty"` + // Exception - The exceptions that occurred while running the sync job. + Exception *string `json:"exception,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobByIDProperties. +func (scsjbip SourceControlSyncJobByIDProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjbip.SourceControlSyncJobID != nil { + objectMap["sourceControlSyncJobId"] = scsjbip.SourceControlSyncJobID + } + if scsjbip.ProvisioningState != "" { + objectMap["provisioningState"] = scsjbip.ProvisioningState + } + if scsjbip.SyncType != "" { + objectMap["syncType"] = scsjbip.SyncType + } + if scsjbip.Exception != nil { + objectMap["exception"] = scsjbip.Exception + } + return json.Marshal(objectMap) +} + +// SourceControlSyncJobCreateParameters the parameters supplied to the create source control sync job +// operation. +type SourceControlSyncJobCreateParameters struct { + // SourceControlSyncJobCreateProperties - The properties of the source control sync job. + *SourceControlSyncJobCreateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobCreateParameters. +func (scsjcp SourceControlSyncJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjcp.SourceControlSyncJobCreateProperties != nil { + objectMap["properties"] = scsjcp.SourceControlSyncJobCreateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobCreateParameters struct. +func (scsjcp *SourceControlSyncJobCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlSyncJobCreateProperties SourceControlSyncJobCreateProperties + err = json.Unmarshal(*v, &sourceControlSyncJobCreateProperties) + if err != nil { + return err + } + scsjcp.SourceControlSyncJobCreateProperties = &sourceControlSyncJobCreateProperties + } + } + } + + return nil +} + +// SourceControlSyncJobCreateProperties definition of create source control sync job properties. +type SourceControlSyncJobCreateProperties struct { + // CommitID - The commit id of the source control sync job. If not syncing to a commitId, enter an empty string. + CommitID *string `json:"commitId,omitempty"` +} + +// SourceControlSyncJobListResult the response model for the list source control sync jobs operation. +type SourceControlSyncJobListResult struct { + autorest.Response `json:"-"` + // Value - The list of source control sync jobs. + Value *[]SourceControlSyncJob `json:"value,omitempty"` + // NextLink - The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlSyncJobListResultIterator provides access to a complete listing of SourceControlSyncJob +// values. +type SourceControlSyncJobListResultIterator struct { + i int + page SourceControlSyncJobListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlSyncJobListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SourceControlSyncJobListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlSyncJobListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlSyncJobListResultIterator) Response() SourceControlSyncJobListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlSyncJobListResultIterator) Value() SourceControlSyncJob { + if !iter.page.NotDone() { + return SourceControlSyncJob{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SourceControlSyncJobListResultIterator type. +func NewSourceControlSyncJobListResultIterator(page SourceControlSyncJobListResultPage) SourceControlSyncJobListResultIterator { + return SourceControlSyncJobListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsjlr SourceControlSyncJobListResult) IsEmpty() bool { + return scsjlr.Value == nil || len(*scsjlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scsjlr SourceControlSyncJobListResult) hasNextLink() bool { + return scsjlr.NextLink != nil && len(*scsjlr.NextLink) != 0 +} + +// sourceControlSyncJobListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsjlr SourceControlSyncJobListResult) sourceControlSyncJobListResultPreparer(ctx context.Context) (*http.Request, error) { + if !scsjlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsjlr.NextLink))) +} + +// SourceControlSyncJobListResultPage contains a page of SourceControlSyncJob values. +type SourceControlSyncJobListResultPage struct { + fn func(context.Context, SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error) + scsjlr SourceControlSyncJobListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlSyncJobListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scsjlr) + if err != nil { + return err + } + page.scsjlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SourceControlSyncJobListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlSyncJobListResultPage) NotDone() bool { + return !page.scsjlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlSyncJobListResultPage) Response() SourceControlSyncJobListResult { + return page.scsjlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlSyncJobListResultPage) Values() []SourceControlSyncJob { + if page.scsjlr.IsEmpty() { + return nil + } + return *page.scsjlr.Value +} + +// Creates a new instance of the SourceControlSyncJobListResultPage type. +func NewSourceControlSyncJobListResultPage(cur SourceControlSyncJobListResult, getNextPage func(context.Context, SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error)) SourceControlSyncJobListResultPage { + return SourceControlSyncJobListResultPage{ + fn: getNextPage, + scsjlr: cur, + } +} + +// SourceControlSyncJobProperties definition of source control sync job properties. +type SourceControlSyncJobProperties struct { + // SourceControlSyncJobID - The source control sync job id. + SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` + // CreationTime - READ-ONLY; The creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - The provisioning state of the job. Possible values include: 'ProvisioningStateCompleted', 'ProvisioningStateFailed', 'ProvisioningStateRunning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - READ-ONLY; The start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; The end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // SyncType - The sync type. Possible values include: 'SyncTypePartialSync', 'SyncTypeFullSync' + SyncType SyncType `json:"syncType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobProperties. +func (scsjp SourceControlSyncJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjp.SourceControlSyncJobID != nil { + objectMap["sourceControlSyncJobId"] = scsjp.SourceControlSyncJobID + } + if scsjp.ProvisioningState != "" { + objectMap["provisioningState"] = scsjp.ProvisioningState + } + if scsjp.SyncType != "" { + objectMap["syncType"] = scsjp.SyncType + } + return json.Marshal(objectMap) +} + +// SourceControlSyncJobStream definition of the source control sync job stream. +type SourceControlSyncJobStream struct { + // ID - READ-ONLY; Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobStreamProperties - The properties of the source control sync job stream. + *SourceControlSyncJobStreamProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStream. +func (scsjs SourceControlSyncJobStream) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjs.SourceControlSyncJobStreamProperties != nil { + objectMap["properties"] = scsjs.SourceControlSyncJobStreamProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStream struct. +func (scsjs *SourceControlSyncJobStream) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjs.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobStreamProperties SourceControlSyncJobStreamProperties + err = json.Unmarshal(*v, &sourceControlSyncJobStreamProperties) + if err != nil { + return err + } + scsjs.SourceControlSyncJobStreamProperties = &sourceControlSyncJobStreamProperties + } + } + } + + return nil +} + +// SourceControlSyncJobStreamByID definition of the source control sync job stream by id. +type SourceControlSyncJobStreamByID struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobStreamByIDProperties - The properties of the source control sync job stream. + *SourceControlSyncJobStreamByIDProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByID. +func (scsjsbi SourceControlSyncJobStreamByID) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjsbi.SourceControlSyncJobStreamByIDProperties != nil { + objectMap["properties"] = scsjsbi.SourceControlSyncJobStreamByIDProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStreamByID struct. +func (scsjsbi *SourceControlSyncJobStreamByID) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsjsbi.ID = &ID + } + case "properties": + if v != nil { + var sourceControlSyncJobStreamByIDProperties SourceControlSyncJobStreamByIDProperties + err = json.Unmarshal(*v, &sourceControlSyncJobStreamByIDProperties) + if err != nil { + return err + } + scsjsbi.SourceControlSyncJobStreamByIDProperties = &sourceControlSyncJobStreamByIDProperties + } + } + } + + return nil +} + +// SourceControlSyncJobStreamByIDProperties definition of source control sync job stream by id properties. +type SourceControlSyncJobStreamByIDProperties struct { + // SourceControlSyncJobStreamID - The sync job stream id. + SourceControlSyncJobStreamID *string `json:"sourceControlSyncJobStreamId,omitempty"` + // Summary - The summary of the sync job stream. + Summary *string `json:"summary,omitempty"` + // Time - READ-ONLY; The time of the sync job stream. + Time *date.Time `json:"time,omitempty"` + // StreamType - The type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' + StreamType StreamType `json:"streamType,omitempty"` + // StreamText - The text of the sync job stream. + StreamText *string `json:"streamText,omitempty"` + // Value - The values of the job stream. + Value map[string]interface{} `json:"value"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByIDProperties. +func (scsjsbip SourceControlSyncJobStreamByIDProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjsbip.SourceControlSyncJobStreamID != nil { + objectMap["sourceControlSyncJobStreamId"] = scsjsbip.SourceControlSyncJobStreamID + } + if scsjsbip.Summary != nil { + objectMap["summary"] = scsjsbip.Summary + } + if scsjsbip.StreamType != "" { + objectMap["streamType"] = scsjsbip.StreamType + } + if scsjsbip.StreamText != nil { + objectMap["streamText"] = scsjsbip.StreamText + } + if scsjsbip.Value != nil { + objectMap["value"] = scsjsbip.Value + } + return json.Marshal(objectMap) +} + +// SourceControlSyncJobStreamProperties definition of source control sync job stream properties. +type SourceControlSyncJobStreamProperties struct { + // SourceControlSyncJobStreamID - The sync job stream id. + SourceControlSyncJobStreamID *string `json:"sourceControlSyncJobStreamId,omitempty"` + // Summary - The summary of the sync job stream. + Summary *string `json:"summary,omitempty"` + // Time - READ-ONLY; The time of the sync job stream. + Time *date.Time `json:"time,omitempty"` + // StreamType - The type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' + StreamType StreamType `json:"streamType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamProperties. +func (scsjsp SourceControlSyncJobStreamProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjsp.SourceControlSyncJobStreamID != nil { + objectMap["sourceControlSyncJobStreamId"] = scsjsp.SourceControlSyncJobStreamID + } + if scsjsp.Summary != nil { + objectMap["summary"] = scsjsp.Summary + } + if scsjsp.StreamType != "" { + objectMap["streamType"] = scsjsp.StreamType + } + return json.Marshal(objectMap) +} + +// SourceControlSyncJobStreamsListBySyncJob the response model for the list source control sync job streams +// operation. +type SourceControlSyncJobStreamsListBySyncJob struct { + autorest.Response `json:"-"` + // Value - The list of source control sync job streams. + Value *[]SourceControlSyncJobStream `json:"value,omitempty"` + // NextLink - READ-ONLY; The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamsListBySyncJob. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsjslbsj.Value != nil { + objectMap["value"] = scsjslbsj.Value + } + return json.Marshal(objectMap) +} + +// SourceControlSyncJobStreamsListBySyncJobIterator provides access to a complete listing of +// SourceControlSyncJobStream values. +type SourceControlSyncJobStreamsListBySyncJobIterator struct { + i int + page SourceControlSyncJobStreamsListBySyncJobPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsListBySyncJobIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Response() SourceControlSyncJobStreamsListBySyncJob { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Value() SourceControlSyncJobStream { + if !iter.page.NotDone() { + return SourceControlSyncJobStream{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SourceControlSyncJobStreamsListBySyncJobIterator type. +func NewSourceControlSyncJobStreamsListBySyncJobIterator(page SourceControlSyncJobStreamsListBySyncJobPage) SourceControlSyncJobStreamsListBySyncJobIterator { + return SourceControlSyncJobStreamsListBySyncJobIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) IsEmpty() bool { + return scsjslbsj.Value == nil || len(*scsjslbsj.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) hasNextLink() bool { + return scsjslbsj.NextLink != nil && len(*scsjslbsj.NextLink) != 0 +} + +// sourceControlSyncJobStreamsListBySyncJobPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) sourceControlSyncJobStreamsListBySyncJobPreparer(ctx context.Context) (*http.Request, error) { + if !scsjslbsj.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsjslbsj.NextLink))) +} + +// SourceControlSyncJobStreamsListBySyncJobPage contains a page of SourceControlSyncJobStream values. +type SourceControlSyncJobStreamsListBySyncJobPage struct { + fn func(context.Context, SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error) + scsjslbsj SourceControlSyncJobStreamsListBySyncJob +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlSyncJobStreamsListBySyncJobPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsListBySyncJobPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scsjslbsj) + if err != nil { + return err + } + page.scsjslbsj = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SourceControlSyncJobStreamsListBySyncJobPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlSyncJobStreamsListBySyncJobPage) NotDone() bool { + return !page.scsjslbsj.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlSyncJobStreamsListBySyncJobPage) Response() SourceControlSyncJobStreamsListBySyncJob { + return page.scsjslbsj +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlSyncJobStreamsListBySyncJobPage) Values() []SourceControlSyncJobStream { + if page.scsjslbsj.IsEmpty() { + return nil + } + return *page.scsjslbsj.Value +} + +// Creates a new instance of the SourceControlSyncJobStreamsListBySyncJobPage type. +func NewSourceControlSyncJobStreamsListBySyncJobPage(cur SourceControlSyncJobStreamsListBySyncJob, getNextPage func(context.Context, SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error)) SourceControlSyncJobStreamsListBySyncJobPage { + return SourceControlSyncJobStreamsListBySyncJobPage{ + fn: getNextPage, + scsjslbsj: cur, + } +} + +// SourceControlUpdateParameters the parameters supplied to the update source control operation. +type SourceControlUpdateParameters struct { + // SourceControlUpdateProperties - The value of the source control. + *SourceControlUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlUpdateParameters. +func (scup SourceControlUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scup.SourceControlUpdateProperties != nil { + objectMap["properties"] = scup.SourceControlUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlUpdateParameters struct. +func (scup *SourceControlUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlUpdateProperties SourceControlUpdateProperties + err = json.Unmarshal(*v, &sourceControlUpdateProperties) + if err != nil { + return err + } + scup.SourceControlUpdateProperties = &sourceControlUpdateProperties + } + } + } + + return nil +} + +// SourceControlUpdateProperties the properties of the update source control +type SourceControlUpdateProperties struct { + // Branch - The repo branch of the source control. + Branch *string `json:"branch,omitempty"` + // FolderPath - The folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - The auto sync of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - The auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SecurityToken - The authorization token for the repo of the source control. + SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` + // Description - The user description of the source control. + Description *string `json:"description,omitempty"` +} + +// Statistics definition of the statistic. +type Statistics struct { + // CounterProperty - READ-ONLY; Gets the property value of the statistic. + CounterProperty *string `json:"counterProperty,omitempty"` + // CounterValue - READ-ONLY; Gets the value of the statistic. + CounterValue *int64 `json:"counterValue,omitempty"` + // StartTime - READ-ONLY; Gets the startTime of the statistic. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; Gets the endTime of the statistic. + EndTime *date.Time `json:"endTime,omitempty"` + // ID - READ-ONLY; Gets the id. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for Statistics. +func (s Statistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StatisticsListResult the response model for the list statistics operation. +type StatisticsListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of statistics. + Value *[]Statistics `json:"value,omitempty"` +} + +// String ... +type String struct { + autorest.Response `json:"-"` + Value *string `json:"value,omitempty"` +} + +// SUCScheduleProperties definition of schedule parameters. +type SUCScheduleProperties struct { + // StartTime - Gets or sets the start time of the schedule. + StartTime *date.Time `json:"startTime,omitempty"` + // StartTimeOffsetMinutes - READ-ONLY; Gets the start time's offset in minutes. + StartTimeOffsetMinutes *float64 `json:"startTimeOffsetMinutes,omitempty"` + // ExpiryTime - Gets or sets the end time of the schedule. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // ExpiryTimeOffsetMinutes - Gets or sets the expiry time's offset in minutes. + ExpiryTimeOffsetMinutes *float64 `json:"expiryTimeOffsetMinutes,omitempty"` + // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // NextRun - Gets or sets the next run time of the schedule. + NextRun *date.Time `json:"nextRun,omitempty"` + // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. + NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` + // Interval - Gets or sets the interval of the schedule. + Interval *int64 `json:"interval,omitempty"` + // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'ScheduleFrequencyOneTime', 'ScheduleFrequencyDay', 'ScheduleFrequencyHour', 'ScheduleFrequencyWeek', 'ScheduleFrequencyMonth', 'ScheduleFrequencyMinute' + Frequency ScheduleFrequency `json:"frequency,omitempty"` + // TimeZone - Gets or sets the time zone of the schedule. + TimeZone *string `json:"timeZone,omitempty"` + // AdvancedSchedule - Gets or sets the advanced schedule. + AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for SUCScheduleProperties. +func (ssp SUCScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssp.StartTime != nil { + objectMap["startTime"] = ssp.StartTime + } + if ssp.ExpiryTime != nil { + objectMap["expiryTime"] = ssp.ExpiryTime + } + if ssp.ExpiryTimeOffsetMinutes != nil { + objectMap["expiryTimeOffsetMinutes"] = ssp.ExpiryTimeOffsetMinutes + } + if ssp.IsEnabled != nil { + objectMap["isEnabled"] = ssp.IsEnabled + } + if ssp.NextRun != nil { + objectMap["nextRun"] = ssp.NextRun + } + if ssp.NextRunOffsetMinutes != nil { + objectMap["nextRunOffsetMinutes"] = ssp.NextRunOffsetMinutes + } + if ssp.Interval != nil { + objectMap["interval"] = ssp.Interval + } + if ssp.Frequency != "" { + objectMap["frequency"] = ssp.Frequency + } + if ssp.TimeZone != nil { + objectMap["timeZone"] = ssp.TimeZone + } + if ssp.AdvancedSchedule != nil { + objectMap["advancedSchedule"] = ssp.AdvancedSchedule + } + if ssp.CreationTime != nil { + objectMap["creationTime"] = ssp.CreationTime + } + if ssp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = ssp.LastModifiedTime + } + if ssp.Description != nil { + objectMap["description"] = ssp.Description + } + return json.Marshal(objectMap) +} + +// TagSettingsProperties tag filter information for the VM. +type TagSettingsProperties struct { + // Tags - Dictionary of tags with its list of values. + Tags map[string][]string `json:"tags"` + // FilterOperator - Filter VMs by Any or All specified tags. Possible values include: 'TagOperatorsAll', 'TagOperatorsAny' + FilterOperator TagOperators `json:"filterOperator,omitempty"` +} + +// MarshalJSON is the custom marshaler for TagSettingsProperties. +func (tsp TagSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsp.Tags != nil { + objectMap["tags"] = tsp.Tags + } + if tsp.FilterOperator != "" { + objectMap["filterOperator"] = tsp.FilterOperator + } + return json.Marshal(objectMap) +} + +// TargetProperties group specific to the update configuration. +type TargetProperties struct { + // AzureQueries - List of Azure queries in the software update configuration. + AzureQueries *[]AzureQueryProperties `json:"azureQueries,omitempty"` + // NonAzureQueries - List of non Azure queries in the software update configuration. + NonAzureQueries *[]NonAzureQueryProperties `json:"nonAzureQueries,omitempty"` +} + +// TaskProperties task properties of the software update configuration. +type TaskProperties struct { + // Parameters - Gets or sets the parameters of the task. + Parameters map[string]*string `json:"parameters"` + // Source - Gets or sets the name of the runbook. + Source *string `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for TaskProperties. +func (tp TaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tp.Parameters != nil { + objectMap["parameters"] = tp.Parameters + } + if tp.Source != nil { + objectMap["source"] = tp.Source + } + return json.Marshal(objectMap) +} + +// TestJob definition of the test job. +type TestJob struct { + autorest.Response `json:"-"` + // CreationTime - Gets or sets the creation time of the test job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // Status - Gets or sets the status of the test job. + Status *string `json:"status,omitempty"` + // StatusDetails - Gets or sets the status details of the test job. + StatusDetails *string `json:"statusDetails,omitempty"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` + // StartTime - Gets or sets the start time of the test job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets or sets the end time of the test job. + EndTime *date.Time `json:"endTime,omitempty"` + // Exception - Gets or sets the exception of the test job. + Exception *string `json:"exception,omitempty"` + // LastModifiedTime - Gets or sets the last modified time of the test job. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastStatusModifiedTime - Gets or sets the last status modified time of the test job. + LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` + // Parameters - Gets or sets the parameters of the test job. + Parameters map[string]*string `json:"parameters"` + // LogActivityTrace - The activity-level tracing options of the runbook. + LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestJob. +func (tj TestJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tj.CreationTime != nil { + objectMap["creationTime"] = tj.CreationTime + } + if tj.Status != nil { + objectMap["status"] = tj.Status + } + if tj.StatusDetails != nil { + objectMap["statusDetails"] = tj.StatusDetails + } + if tj.RunOn != nil { + objectMap["runOn"] = tj.RunOn + } + if tj.StartTime != nil { + objectMap["startTime"] = tj.StartTime + } + if tj.EndTime != nil { + objectMap["endTime"] = tj.EndTime + } + if tj.Exception != nil { + objectMap["exception"] = tj.Exception + } + if tj.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = tj.LastModifiedTime + } + if tj.LastStatusModifiedTime != nil { + objectMap["lastStatusModifiedTime"] = tj.LastStatusModifiedTime + } + if tj.Parameters != nil { + objectMap["parameters"] = tj.Parameters + } + if tj.LogActivityTrace != nil { + objectMap["logActivityTrace"] = tj.LogActivityTrace + } + return json.Marshal(objectMap) +} + +// TestJobCreateParameters the parameters supplied to the create test job operation. +type TestJobCreateParameters struct { + // Parameters - Gets or sets the parameters of the test job. + Parameters map[string]*string `json:"parameters"` + // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for TestJobCreateParameters. +func (tjcp TestJobCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjcp.Parameters != nil { + objectMap["parameters"] = tjcp.Parameters + } + if tjcp.RunOn != nil { + objectMap["runOn"] = tjcp.RunOn + } + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The Azure Region where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// TypeField information about a field of a type. +type TypeField struct { + // Name - Gets or sets the name of the field. + Name *string `json:"name,omitempty"` + // Type - Gets or sets the type of the field. + Type *string `json:"type,omitempty"` +} + +// TypeFieldListResult the response model for the list fields operation. +type TypeFieldListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of fields. + Value *[]TypeField `json:"value,omitempty"` +} + +// UpdateConfiguration update specific properties of the software update configuration. +type UpdateConfiguration struct { + // OperatingSystem - operating system of target machines. Possible values include: 'OperatingSystemTypeWindows', 'OperatingSystemTypeLinux' + OperatingSystem OperatingSystemType `json:"operatingSystem,omitempty"` + // Windows - Windows specific update configuration. + Windows *WindowsProperties `json:"windows,omitempty"` + // Linux - Linux specific update configuration. + Linux *LinuxProperties `json:"linux,omitempty"` + // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 + Duration *string `json:"duration,omitempty"` + // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. + AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` + // NonAzureComputerNames - List of names of non-azure machines targeted by the software update configuration. + NonAzureComputerNames *[]string `json:"nonAzureComputerNames,omitempty"` + // Targets - Group targets for the software update configuration. + Targets *TargetProperties `json:"targets,omitempty"` +} + +// UpdateConfigurationMachineRunProperties software update configuration machine run properties. +type UpdateConfigurationMachineRunProperties struct { + // TargetComputer - READ-ONLY; name of the updated computer + TargetComputer *string `json:"targetComputer,omitempty"` + // TargetComputerType - READ-ONLY; type of the updated computer. + TargetComputerType *string `json:"targetComputerType,omitempty"` + // SoftwareUpdateConfiguration - software update configuration triggered this run + SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` + // Status - READ-ONLY; Status of the software update configuration machine run. + Status *string `json:"status,omitempty"` + // OsType - READ-ONLY; Operating system target of the software update configuration triggered this run + OsType *string `json:"osType,omitempty"` + // CorrelationID - READ-ONLY; correlation id of the software update configuration machine run + CorrelationID *uuid.UUID `json:"correlationId,omitempty"` + // SourceComputerID - READ-ONLY; source computer id of the software update configuration machine run + SourceComputerID *uuid.UUID `json:"sourceComputerId,omitempty"` + // StartTime - READ-ONLY; Start time of the software update configuration machine run. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time of the software update configuration machine run. + EndTime *date.Time `json:"endTime,omitempty"` + // ConfiguredDuration - READ-ONLY; configured duration for the software update configuration run. + ConfiguredDuration *string `json:"configuredDuration,omitempty"` + // Job - Job associated with the software update configuration machine run + Job *JobNavigation `json:"job,omitempty"` + // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. + CreationTime *date.Time `json:"creationTime,omitempty"` + // CreatedBy - READ-ONLY; createdBy property, which only appears in the response. + CreatedBy *string `json:"createdBy,omitempty"` + // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - READ-ONLY; lastModifiedBy property, which only appears in the response. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Error - Details of provisioning error + Error *ErrorResponse `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateConfigurationMachineRunProperties. +func (ucmrp UpdateConfigurationMachineRunProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ucmrp.SoftwareUpdateConfiguration != nil { + objectMap["softwareUpdateConfiguration"] = ucmrp.SoftwareUpdateConfiguration + } + if ucmrp.Job != nil { + objectMap["job"] = ucmrp.Job + } + if ucmrp.Error != nil { + objectMap["error"] = ucmrp.Error + } + return json.Marshal(objectMap) +} + +// UpdateConfigurationNavigation software update configuration Run Navigation model. +type UpdateConfigurationNavigation struct { + // Name - READ-ONLY; Name of the software update configuration triggered the software update configuration run + Name *string `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for UpdateConfigurationNavigation. +func (ucn UpdateConfigurationNavigation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Usage definition of Usage. +type Usage struct { + // ID - Gets or sets the id of the resource. + ID *string `json:"id,omitempty"` + // Name - Gets or sets the usage counter name. + Name *UsageCounterName `json:"name,omitempty"` + // Unit - Gets or sets the usage unit name. + Unit *string `json:"unit,omitempty"` + // CurrentValue - Gets or sets the current usage value. + CurrentValue *float64 `json:"currentValue,omitempty"` + // Limit - Gets or sets max limit. -1 for unlimited + Limit *int64 `json:"limit,omitempty"` + // ThrottleStatus - Gets or sets the throttle status. + ThrottleStatus *string `json:"throttleStatus,omitempty"` +} + +// UsageCounterName definition of usage counter name. +type UsageCounterName struct { + // Value - Gets or sets the usage counter name. + Value *string `json:"value,omitempty"` + // LocalizedValue - Gets or sets the localized usage counter name. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// UsageListResult the response model for the get usage operation. +type UsageListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets usage. + Value *[]Usage `json:"value,omitempty"` +} + +// Variable definition of the variable. +type Variable struct { + autorest.Response `json:"-"` + // VariableProperties - Gets or sets the properties of the variable. + *VariableProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Variable. +func (vVar Variable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vVar.VariableProperties != nil { + objectMap["properties"] = vVar.VariableProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Variable struct. +func (vVar *Variable) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var variableProperties VariableProperties + err = json.Unmarshal(*v, &variableProperties) + if err != nil { + return err + } + vVar.VariableProperties = &variableProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + } + } + + return nil +} + +// VariableCreateOrUpdateParameters the parameters supplied to the create or update variable operation. +type VariableCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the variable. + Name *string `json:"name,omitempty"` + // VariableCreateOrUpdateProperties - Gets or sets the properties of the variable. + *VariableCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VariableCreateOrUpdateParameters. +func (vcoup VariableCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcoup.Name != nil { + objectMap["name"] = vcoup.Name + } + if vcoup.VariableCreateOrUpdateProperties != nil { + objectMap["properties"] = vcoup.VariableCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VariableCreateOrUpdateParameters struct. +func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vcoup.Name = &name + } + case "properties": + if v != nil { + var variableCreateOrUpdateProperties VariableCreateOrUpdateProperties + err = json.Unmarshal(*v, &variableCreateOrUpdateProperties) + if err != nil { + return err + } + vcoup.VariableCreateOrUpdateProperties = &variableCreateOrUpdateProperties + } + } + } + + return nil +} + +// VariableCreateOrUpdateProperties the properties of the create variable operation. +type VariableCreateOrUpdateProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // Description - Gets or sets the description of the variable. + Description *string `json:"description,omitempty"` + // IsEncrypted - Gets or sets the encrypted flag of the variable. + IsEncrypted *bool `json:"isEncrypted,omitempty"` +} + +// VariableListResult the response model for the list variables operation. +type VariableListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of variables. + Value *[]Variable `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// VariableListResultIterator provides access to a complete listing of Variable values. +type VariableListResultIterator struct { + i int + page VariableListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VariableListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VariableListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VariableListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VariableListResultIterator) Response() VariableListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VariableListResultIterator) Value() Variable { + if !iter.page.NotDone() { + return Variable{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VariableListResultIterator type. +func NewVariableListResultIterator(page VariableListResultPage) VariableListResultIterator { + return VariableListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vlr VariableListResult) IsEmpty() bool { + return vlr.Value == nil || len(*vlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vlr VariableListResult) hasNextLink() bool { + return vlr.NextLink != nil && len(*vlr.NextLink) != 0 +} + +// variableListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vlr VariableListResult) variableListResultPreparer(ctx context.Context) (*http.Request, error) { + if !vlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vlr.NextLink))) +} + +// VariableListResultPage contains a page of Variable values. +type VariableListResultPage struct { + fn func(context.Context, VariableListResult) (VariableListResult, error) + vlr VariableListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VariableListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vlr) + if err != nil { + return err + } + page.vlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VariableListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VariableListResultPage) NotDone() bool { + return !page.vlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VariableListResultPage) Response() VariableListResult { + return page.vlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VariableListResultPage) Values() []Variable { + if page.vlr.IsEmpty() { + return nil + } + return *page.vlr.Value +} + +// Creates a new instance of the VariableListResultPage type. +func NewVariableListResultPage(cur VariableListResult, getNextPage func(context.Context, VariableListResult) (VariableListResult, error)) VariableListResultPage { + return VariableListResultPage{ + fn: getNextPage, + vlr: cur, + } +} + +// VariableProperties definition of the variable properties +type VariableProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // IsEncrypted - Gets or sets the encrypted flag of the variable. + IsEncrypted *bool `json:"isEncrypted,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// VariableUpdateParameters the parameters supplied to the update variable operation. +type VariableUpdateParameters struct { + // Name - Gets or sets the name of the variable. + Name *string `json:"name,omitempty"` + // VariableUpdateProperties - Gets or sets the value of the variable. + *VariableUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for VariableUpdateParameters. +func (vup VariableUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vup.Name != nil { + objectMap["name"] = vup.Name + } + if vup.VariableUpdateProperties != nil { + objectMap["properties"] = vup.VariableUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VariableUpdateParameters struct. +func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vup.Name = &name + } + case "properties": + if v != nil { + var variableUpdateProperties VariableUpdateProperties + err = json.Unmarshal(*v, &variableUpdateProperties) + if err != nil { + return err + } + vup.VariableUpdateProperties = &variableUpdateProperties + } + } + } + + return nil +} + +// VariableUpdateProperties the properties of the update variable +type VariableUpdateProperties struct { + // Value - Gets or sets the value of the variable. + Value *string `json:"value,omitempty"` + // Description - Gets or sets the description of the variable. + Description *string `json:"description,omitempty"` +} + +// Watcher definition of the watcher type. +type Watcher struct { + autorest.Response `json:"-"` + // WatcherProperties - Gets or sets the watcher properties. + *WatcherProperties `json:"properties,omitempty"` + // Etag - Gets or sets the etag of the resource. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Watcher. +func (w Watcher) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WatcherProperties != nil { + objectMap["properties"] = w.WatcherProperties + } + if w.Etag != nil { + objectMap["etag"] = w.Etag + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Location != nil { + objectMap["location"] = w.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Watcher struct. +func (w *Watcher) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var watcherProperties WatcherProperties + err = json.Unmarshal(*v, &watcherProperties) + if err != nil { + return err + } + w.WatcherProperties = &watcherProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + w.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + } + } + + return nil +} + +// WatcherListResult the response model for the list watcher operation. +type WatcherListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of watchers. + Value *[]Watcher `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// WatcherListResultIterator provides access to a complete listing of Watcher values. +type WatcherListResultIterator struct { + i int + page WatcherListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WatcherListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WatcherListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WatcherListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WatcherListResultIterator) Response() WatcherListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WatcherListResultIterator) Value() Watcher { + if !iter.page.NotDone() { + return Watcher{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WatcherListResultIterator type. +func NewWatcherListResultIterator(page WatcherListResultPage) WatcherListResultIterator { + return WatcherListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WatcherListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wlr WatcherListResult) hasNextLink() bool { + return wlr.NextLink != nil && len(*wlr.NextLink) != 0 +} + +// watcherListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WatcherListResult) watcherListResultPreparer(ctx context.Context) (*http.Request, error) { + if !wlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WatcherListResultPage contains a page of Watcher values. +type WatcherListResultPage struct { + fn func(context.Context, WatcherListResult) (WatcherListResult, error) + wlr WatcherListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WatcherListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wlr) + if err != nil { + return err + } + page.wlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *WatcherListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WatcherListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WatcherListResultPage) Response() WatcherListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WatcherListResultPage) Values() []Watcher { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// Creates a new instance of the WatcherListResultPage type. +func NewWatcherListResultPage(cur WatcherListResult, getNextPage func(context.Context, WatcherListResult) (WatcherListResult, error)) WatcherListResultPage { + return WatcherListResultPage{ + fn: getNextPage, + wlr: cur, + } +} + +// WatcherProperties definition of the watcher properties +type WatcherProperties struct { + // ExecutionFrequencyInSeconds - Gets or sets the frequency at which the watcher is invoked. + ExecutionFrequencyInSeconds *int64 `json:"executionFrequencyInSeconds,omitempty"` + // ScriptName - Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook. + ScriptName *string `json:"scriptName,omitempty"` + // ScriptParameters - Gets or sets the parameters of the script. + ScriptParameters map[string]*string `json:"scriptParameters"` + // ScriptRunOn - Gets or sets the name of the hybrid worker group the watcher will run on. + ScriptRunOn *string `json:"scriptRunOn,omitempty"` + // Status - READ-ONLY; Gets the current status of the watcher. + Status *string `json:"status,omitempty"` + // CreationTime - READ-ONLY; Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - READ-ONLY; Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - READ-ONLY; Details of the user who last modified the watcher. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WatcherProperties. +func (wp WatcherProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.ExecutionFrequencyInSeconds != nil { + objectMap["executionFrequencyInSeconds"] = wp.ExecutionFrequencyInSeconds + } + if wp.ScriptName != nil { + objectMap["scriptName"] = wp.ScriptName + } + if wp.ScriptParameters != nil { + objectMap["scriptParameters"] = wp.ScriptParameters + } + if wp.ScriptRunOn != nil { + objectMap["scriptRunOn"] = wp.ScriptRunOn + } + if wp.Description != nil { + objectMap["description"] = wp.Description + } + return json.Marshal(objectMap) +} + +// WatcherUpdateParameters ... +type WatcherUpdateParameters struct { + // WatcherUpdateProperties - Gets or sets the watcher update properties. + *WatcherUpdateProperties `json:"properties,omitempty"` + // Name - Gets or sets the name of the resource. + Name *string `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for WatcherUpdateParameters. +func (wup WatcherUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.WatcherUpdateProperties != nil { + objectMap["properties"] = wup.WatcherUpdateProperties + } + if wup.Name != nil { + objectMap["name"] = wup.Name + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WatcherUpdateParameters struct. +func (wup *WatcherUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var watcherUpdateProperties WatcherUpdateProperties + err = json.Unmarshal(*v, &watcherUpdateProperties) + if err != nil { + return err + } + wup.WatcherUpdateProperties = &watcherUpdateProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wup.Name = &name + } + } + } + + return nil +} + +// WatcherUpdateProperties the properties of the update watcher operation. +type WatcherUpdateProperties struct { + // ExecutionFrequencyInSeconds - Gets or sets the frequency at which the watcher is invoked. + ExecutionFrequencyInSeconds *int64 `json:"executionFrequencyInSeconds,omitempty"` +} + +// Webhook definition of the webhook type. +type Webhook struct { + autorest.Response `json:"-"` + // WebhookProperties - Gets or sets the webhook properties. + *WebhookProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Webhook struct. +func (w *Webhook) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + } + } + + return nil +} + +// WebhookCreateOrUpdateParameters the parameters supplied to the create or update webhook operation. +type WebhookCreateOrUpdateParameters struct { + // Name - Gets or sets the name of the webhook. + Name *string `json:"name,omitempty"` + // WebhookCreateOrUpdateProperties - Gets or sets the properties of the webhook. + *WebhookCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateParameters. +func (wcoup WebhookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.Name != nil { + objectMap["name"] = wcoup.Name + } + if wcoup.WebhookCreateOrUpdateProperties != nil { + objectMap["properties"] = wcoup.WebhookCreateOrUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookCreateOrUpdateParameters struct. +func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wcoup.Name = &name + } + case "properties": + if v != nil { + var webhookCreateOrUpdateProperties WebhookCreateOrUpdateProperties + err = json.Unmarshal(*v, &webhookCreateOrUpdateProperties) + if err != nil { + return err + } + wcoup.WebhookCreateOrUpdateProperties = &webhookCreateOrUpdateProperties + } + } + } + + return nil +} + +// WebhookCreateOrUpdateProperties the properties of the create webhook operation. +type WebhookCreateOrUpdateProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // URI - Gets or sets the uri. + URI *string `json:"uri,omitempty"` + // ExpiryTime - Gets or sets the expiry time. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // Runbook - Gets or sets the runbook. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateProperties. +func (wcoup WebhookCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcoup.IsEnabled != nil { + objectMap["isEnabled"] = wcoup.IsEnabled + } + if wcoup.URI != nil { + objectMap["uri"] = wcoup.URI + } + if wcoup.ExpiryTime != nil { + objectMap["expiryTime"] = wcoup.ExpiryTime + } + if wcoup.Parameters != nil { + objectMap["parameters"] = wcoup.Parameters + } + if wcoup.Runbook != nil { + objectMap["runbook"] = wcoup.Runbook + } + if wcoup.RunOn != nil { + objectMap["runOn"] = wcoup.RunOn + } + return json.Marshal(objectMap) +} + +// WebhookListResult the response model for the list webhook operation. +type WebhookListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of webhooks. + Value *[]Webhook `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebhookListResultIterator provides access to a complete listing of Webhook values. +type WebhookListResultIterator struct { + i int + page WebhookListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WebhookListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WebhookListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebhookListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WebhookListResultIterator) Response() WebhookListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WebhookListResultIterator) Value() Webhook { + if !iter.page.NotDone() { + return Webhook{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WebhookListResultIterator type. +func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator { + return WebhookListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WebhookListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wlr WebhookListResult) hasNextLink() bool { + return wlr.NextLink != nil && len(*wlr.NextLink) != 0 +} + +// webhookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WebhookListResult) webhookListResultPreparer(ctx context.Context) (*http.Request, error) { + if !wlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WebhookListResultPage contains a page of Webhook values. +type WebhookListResultPage struct { + fn func(context.Context, WebhookListResult) (WebhookListResult, error) + wlr WebhookListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WebhookListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wlr) + if err != nil { + return err + } + page.wlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *WebhookListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebhookListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebhookListResultPage) Response() WebhookListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebhookListResultPage) Values() []Webhook { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// Creates a new instance of the WebhookListResultPage type. +func NewWebhookListResultPage(cur WebhookListResult, getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage { + return WebhookListResultPage{ + fn: getNextPage, + wlr: cur, + } +} + +// WebhookProperties definition of the webhook properties +type WebhookProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of the webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // URI - Gets or sets the webhook uri. + URI *string `json:"uri,omitempty"` + // ExpiryTime - Gets or sets the expiry time. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // LastInvokedTime - Gets or sets the last invoked time. + LastInvokedTime *date.Time `json:"lastInvokedTime,omitempty"` + // Parameters - Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. + Parameters map[string]*string `json:"parameters"` + // Runbook - Gets or sets the runbook the webhook is associated with. + Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // LastModifiedBy - Details of the user who last modified the Webhook + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookProperties. +func (wp WebhookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.IsEnabled != nil { + objectMap["isEnabled"] = wp.IsEnabled + } + if wp.URI != nil { + objectMap["uri"] = wp.URI + } + if wp.ExpiryTime != nil { + objectMap["expiryTime"] = wp.ExpiryTime + } + if wp.LastInvokedTime != nil { + objectMap["lastInvokedTime"] = wp.LastInvokedTime + } + if wp.Parameters != nil { + objectMap["parameters"] = wp.Parameters + } + if wp.Runbook != nil { + objectMap["runbook"] = wp.Runbook + } + if wp.RunOn != nil { + objectMap["runOn"] = wp.RunOn + } + if wp.CreationTime != nil { + objectMap["creationTime"] = wp.CreationTime + } + if wp.LastModifiedTime != nil { + objectMap["lastModifiedTime"] = wp.LastModifiedTime + } + if wp.LastModifiedBy != nil { + objectMap["lastModifiedBy"] = wp.LastModifiedBy + } + if wp.Description != nil { + objectMap["description"] = wp.Description + } + return json.Marshal(objectMap) +} + +// WebhookUpdateParameters the parameters supplied to the update webhook operation. +type WebhookUpdateParameters struct { + // Name - Gets or sets the name of the webhook. + Name *string `json:"name,omitempty"` + // WebhookUpdateProperties - Gets or sets the value of the webhook. + *WebhookUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateParameters. +func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Name != nil { + objectMap["name"] = wup.Name + } + if wup.WebhookUpdateProperties != nil { + objectMap["properties"] = wup.WebhookUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. +func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wup.Name = &name + } + case "properties": + if v != nil { + var webhookUpdateProperties WebhookUpdateProperties + err = json.Unmarshal(*v, &webhookUpdateProperties) + if err != nil { + return err + } + wup.WebhookUpdateProperties = &webhookUpdateProperties + } + } + } + + return nil +} + +// WebhookUpdateProperties the properties of the update webhook. +type WebhookUpdateProperties struct { + // IsEnabled - Gets or sets the value of the enabled flag of webhook. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. + RunOn *string `json:"runOn,omitempty"` + // Parameters - Gets or sets the parameters of the job. + Parameters map[string]*string `json:"parameters"` + // Description - Gets or sets the description of the webhook. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateProperties. +func (wup WebhookUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.IsEnabled != nil { + objectMap["isEnabled"] = wup.IsEnabled + } + if wup.RunOn != nil { + objectMap["runOn"] = wup.RunOn + } + if wup.Parameters != nil { + objectMap["parameters"] = wup.Parameters + } + if wup.Description != nil { + objectMap["description"] = wup.Description + } + return json.Marshal(objectMap) +} + +// WindowsProperties windows specific update configuration. +type WindowsProperties struct { + // IncludedUpdateClassifications - Update classification included in the software update configuration. A comma separated string with required values. Possible values include: 'WindowsUpdateClassesUnclassified', 'WindowsUpdateClassesCritical', 'WindowsUpdateClassesSecurity', 'WindowsUpdateClassesUpdateRollup', 'WindowsUpdateClassesFeaturePack', 'WindowsUpdateClassesServicePack', 'WindowsUpdateClassesDefinition', 'WindowsUpdateClassesTools', 'WindowsUpdateClassesUpdates' + IncludedUpdateClassifications WindowsUpdateClasses `json:"includedUpdateClassifications,omitempty"` + // ExcludedKbNumbers - KB numbers excluded from the software update configuration. + ExcludedKbNumbers *[]string `json:"excludedKbNumbers,omitempty"` + // IncludedKbNumbers - KB numbers included from the software update configuration. + IncludedKbNumbers *[]string `json:"includedKbNumbers,omitempty"` + // RebootSetting - Reboot setting for the software update configuration. + RebootSetting *string `json:"rebootSetting,omitempty"` +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/module.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/module.go new file mode 100644 index 000000000000..7a675e3861fc --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/module.go @@ -0,0 +1,516 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ModuleClient is the automation Client +type ModuleClient struct { + BaseClient +} + +// NewModuleClient creates an instance of the ModuleClient client. +func NewModuleClient(subscriptionID string) ModuleClient { + return NewModuleClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewModuleClientWithBaseURI creates an instance of the ModuleClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewModuleClientWithBaseURI(baseURI string, subscriptionID string) ModuleClient { + return ModuleClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the create or update parameters for module. +func (client ModuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (result Module, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ModuleCreateOrUpdateProperties.ContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ModuleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ModuleClient) CreateOrUpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the module by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. +func (client ModuleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ModuleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ModuleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the module name. +func (client ModuleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (result Module, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, moduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ModuleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ModuleClient) GetResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of modules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ModuleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.mlr.Response.Response != nil { + sc = result.mlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.mlr.hasNextLink() && result.mlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ModuleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ModuleClient) ListByAutomationAccountResponder(resp *http.Response) (result ModuleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ModuleClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ModuleListResult) (result ModuleListResult, err error) { + req, err := lastResults.moduleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ModuleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the module identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// parameters - the update parameters for module. +func (client ModuleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (result Module, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ModuleClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ModuleClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, moduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ModuleClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ModuleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, parameters ModuleUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ModuleClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ModuleClient) UpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/nodecountinformation.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/nodecountinformation.go new file mode 100644 index 000000000000..340068634da7 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/nodecountinformation.go @@ -0,0 +1,119 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NodeCountInformationClient is the automation Client +type NodeCountInformationClient struct { + BaseClient +} + +// NewNodeCountInformationClient creates an instance of the NodeCountInformationClient client. +func NewNodeCountInformationClient(subscriptionID string) NodeCountInformationClient { + return NewNodeCountInformationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNodeCountInformationClientWithBaseURI creates an instance of the NodeCountInformationClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewNodeCountInformationClientWithBaseURI(baseURI string, subscriptionID string) NodeCountInformationClient { + return NodeCountInformationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve counts for Dsc Nodes. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// countType - the type of counts to retrieve +func (client NodeCountInformationClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, countType CountType) (result NodeCounts, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NodeCountInformationClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeCountInformationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, countType) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeCountInformationClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client NodeCountInformationClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, countType CountType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "countType": autorest.Encode("path", countType), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodecounts/{countType}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NodeCountInformationClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NodeCountInformationClient) GetResponder(resp *http.Response) (result NodeCounts, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/nodereports.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/nodereports.go new file mode 100644 index 000000000000..eeb955153da9 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/nodereports.go @@ -0,0 +1,340 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NodeReportsClient is the automation Client +type NodeReportsClient struct { + BaseClient +} + +// NewNodeReportsClient creates an instance of the NodeReportsClient client. +func NewNodeReportsClient(subscriptionID string) NodeReportsClient { + return NewNodeReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNodeReportsClientWithBaseURI creates an instance of the NodeReportsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewNodeReportsClientWithBaseURI(baseURI string, subscriptionID string) NodeReportsClient { + return NodeReportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the Dsc node report data by node id and report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. +func (client NodeReportsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result DscNodeReport, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client NodeReportsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "reportId": autorest.Encode("path", reportID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) GetResponder(resp *http.Response) (result DscNodeReport, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the Dsc node reports by node id and report id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the Dsc node id. +// reportID - the report id. +func (client NodeReportsClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.GetContent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, nodeID, reportID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "GetContent", resp, "Failure responding to request") + return + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client NodeReportsClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, reportID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "reportId": autorest.Encode("path", reportID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) GetContentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) GetContentResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByNode retrieve the Dsc node report list by node id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// nodeID - the parameters supplied to the list operation. +// filter - the filter to apply on the operation. +func (client NodeReportsClient) ListByNode(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.ListByNode") + defer func() { + sc := -1 + if result.dnrlr.Response.Response != nil { + sc = result.dnrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.NodeReportsClient", "ListByNode", err.Error()) + } + + result.fn = client.listByNodeNextResults + req, err := client.ListByNodePreparer(ctx, resourceGroupName, automationAccountName, nodeID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", nil, "Failure preparing request") + return + } + + resp, err := client.ListByNodeSender(req) + if err != nil { + result.dnrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure sending request") + return + } + + result.dnrlr, err = client.ListByNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "ListByNode", resp, "Failure responding to request") + return + } + if result.dnrlr.hasNextLink() && result.dnrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByNodePreparer prepares the ListByNode request. +func (client NodeReportsClient) ListByNodePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "nodeId": autorest.Encode("path", nodeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByNodeSender sends the ListByNode request. The method will close the +// http.Response Body if it receives an error. +func (client NodeReportsClient) ListByNodeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByNodeResponder handles the response to the ListByNode request. The method always +// closes the http.Response Body. +func (client NodeReportsClient) ListByNodeResponder(resp *http.Response) (result DscNodeReportListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByNodeNextResults retrieves the next set of results, if any. +func (client NodeReportsClient) listByNodeNextResults(ctx context.Context, lastResults DscNodeReportListResult) (result DscNodeReportListResult, err error) { + req, err := lastResults.dscNodeReportListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByNodeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByNodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.NodeReportsClient", "listByNodeNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByNodeComplete enumerates all values, automatically crossing page boundaries as required. +func (client NodeReportsClient) ListByNodeComplete(ctx context.Context, resourceGroupName string, automationAccountName string, nodeID string, filter string) (result DscNodeReportListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NodeReportsClient.ListByNode") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByNode(ctx, resourceGroupName, automationAccountName, nodeID, filter) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/objectdatatypes.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/objectdatatypes.go new file mode 100644 index 000000000000..a36c6719a2a3 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/objectdatatypes.go @@ -0,0 +1,206 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ObjectDataTypesClient is the automation Client +type ObjectDataTypesClient struct { + BaseClient +} + +// NewObjectDataTypesClient creates an instance of the ObjectDataTypesClient client. +func NewObjectDataTypesClient(subscriptionID string) ObjectDataTypesClient { + return NewObjectDataTypesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewObjectDataTypesClientWithBaseURI creates an instance of the ObjectDataTypesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewObjectDataTypesClientWithBaseURI(baseURI string, subscriptionID string) ObjectDataTypesClient { + return ObjectDataTypesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListFieldsByModuleAndType retrieve a list of fields of a given type identified by module name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// moduleName - the name of module. +// typeName - the name of type. +func (client ObjectDataTypesClient) ListFieldsByModuleAndType(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (result TypeFieldListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectDataTypesClient.ListFieldsByModuleAndType") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", err.Error()) + } + + req, err := client.ListFieldsByModuleAndTypePreparer(ctx, resourceGroupName, automationAccountName, moduleName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", nil, "Failure preparing request") + return + } + + resp, err := client.ListFieldsByModuleAndTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure sending request") + return + } + + result, err = client.ListFieldsByModuleAndTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByModuleAndType", resp, "Failure responding to request") + return + } + + return +} + +// ListFieldsByModuleAndTypePreparer prepares the ListFieldsByModuleAndType request. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, moduleName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "moduleName": autorest.Encode("path", moduleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFieldsByModuleAndTypeSender sends the ListFieldsByModuleAndType request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFieldsByModuleAndTypeResponder handles the response to the ListFieldsByModuleAndType request. The method always +// closes the http.Response Body. +func (client ObjectDataTypesClient) ListFieldsByModuleAndTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListFieldsByType retrieve a list of fields of a given type across all accessible modules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// typeName - the name of type. +func (client ObjectDataTypesClient) ListFieldsByType(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (result TypeFieldListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ObjectDataTypesClient.ListFieldsByType") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ObjectDataTypesClient", "ListFieldsByType", err.Error()) + } + + req, err := client.ListFieldsByTypePreparer(ctx, resourceGroupName, automationAccountName, typeName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", nil, "Failure preparing request") + return + } + + resp, err := client.ListFieldsByTypeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure sending request") + return + } + + result, err = client.ListFieldsByTypeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ObjectDataTypesClient", "ListFieldsByType", resp, "Failure responding to request") + return + } + + return +} + +// ListFieldsByTypePreparer prepares the ListFieldsByType request. +func (client ObjectDataTypesClient) ListFieldsByTypePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, typeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "typeName": autorest.Encode("path", typeName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFieldsByTypeSender sends the ListFieldsByType request. The method will close the +// http.Response Body if it receives an error. +func (client ObjectDataTypesClient) ListFieldsByTypeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFieldsByTypeResponder handles the response to the ListFieldsByType request. The method always +// closes the http.Response Body. +func (client ObjectDataTypesClient) ListFieldsByTypeResponder(resp *http.Response) (result TypeFieldListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/operations.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/operations.go new file mode 100644 index 000000000000..42612f852cdb --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/operations.go @@ -0,0 +1,98 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the automation Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Automation REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.OperationsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Automation/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/privateendpointconnections.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/privateendpointconnections.go new file mode 100644 index 000000000000..438a13e8b8d9 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/privateendpointconnections.go @@ -0,0 +1,382 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the automation Client +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate approve or reject a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, privateEndpointConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a private endpoint connection with a given name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a private endpoint connection. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount list all private endpoint connections on a Automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client PrivateEndpointConnectionsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result PrivateEndpointConnectionListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateEndpointConnectionsClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client PrivateEndpointConnectionsClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListByAutomationAccountResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/privatelinkresources.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/privatelinkresources.go new file mode 100644 index 000000000000..983e886c1af0 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/privatelinkresources.go @@ -0,0 +1,117 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the automation Client +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Method gets the private link resources that need to be created for Automation account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client PrivateLinkResourcesClient) Method(ctx context.Context, resourceGroupName string, automationAccountName string) (result PrivateLinkResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Method") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.PrivateLinkResourcesClient", "Method", err.Error()) + } + + req, err := client.MethodPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateLinkResourcesClient", "Method", nil, "Failure preparing request") + return + } + + resp, err := client.MethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.PrivateLinkResourcesClient", "Method", resp, "Failure sending request") + return + } + + result, err = client.MethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.PrivateLinkResourcesClient", "Method", resp, "Failure responding to request") + return + } + + return +} + +// MethodPreparer prepares the Method request. +func (client PrivateLinkResourcesClient) MethodPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MethodSender sends the Method request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) MethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// MethodResponder handles the response to the Method request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) MethodResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/python2package.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/python2package.go new file mode 100644 index 000000000000..4faa6b476c5b --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/python2package.go @@ -0,0 +1,516 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// Python2PackageClient is the automation Client +type Python2PackageClient struct { + BaseClient +} + +// NewPython2PackageClient creates an instance of the Python2PackageClient client. +func NewPython2PackageClient(subscriptionID string) Python2PackageClient { + return NewPython2PackageClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPython2PackageClientWithBaseURI creates an instance of the Python2PackageClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewPython2PackageClientWithBaseURI(baseURI string, subscriptionID string) Python2PackageClient { + return Python2PackageClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update the python 2 package identified by package name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// packageName - the name of python package. +// parameters - the create or update parameters for python package. +func (client Python2PackageClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageCreateParameters) (result Module, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties.ContentLink", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties.ContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.PythonPackageCreateProperties.ContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.PythonPackageCreateProperties.ContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.Python2PackageClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, packageName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client Python2PackageClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "packageName": autorest.Encode("path", packageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client Python2PackageClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client Python2PackageClient) CreateOrUpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the python 2 package by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// packageName - the python package name. +func (client Python2PackageClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.Python2PackageClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, packageName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client Python2PackageClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "packageName": autorest.Encode("path", packageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client Python2PackageClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client Python2PackageClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the python 2 package identified by package name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// packageName - the python package name. +func (client Python2PackageClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (result Module, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.Python2PackageClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, packageName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client Python2PackageClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "packageName": autorest.Encode("path", packageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client Python2PackageClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client Python2PackageClient) GetResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of python 2 packages. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client Python2PackageClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.mlr.Response.Response != nil { + sc = result.mlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.Python2PackageClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.mlr.hasNextLink() && result.mlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client Python2PackageClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client Python2PackageClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client Python2PackageClient) ListByAutomationAccountResponder(resp *http.Response) (result ModuleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client Python2PackageClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ModuleListResult) (result ModuleListResult, err error) { + req, err := lastResults.moduleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.Python2PackageClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.Python2PackageClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client Python2PackageClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ModuleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the python 2 package identified by package name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// packageName - the name of python package. +// parameters - the update parameters for python package. +func (client Python2PackageClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageUpdateParameters) (result Module, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Python2PackageClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.Python2PackageClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, packageName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.Python2PackageClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client Python2PackageClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, packageName string, parameters PythonPackageUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "packageName": autorest.Encode("path", packageName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client Python2PackageClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client Python2PackageClient) UpdateResponder(resp *http.Response) (result Module, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/runbook.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/runbook.go new file mode 100644 index 000000000000..d6727e0dbcc5 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/runbook.go @@ -0,0 +1,698 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RunbookClient is the automation Client +type RunbookClient struct { + BaseClient +} + +// NewRunbookClient creates an instance of the RunbookClient client. +func NewRunbookClient(subscriptionID string) RunbookClient { + return NewRunbookClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRunbookClientWithBaseURI creates an instance of the RunbookClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRunbookClientWithBaseURI(baseURI string, subscriptionID string) RunbookClient { + return RunbookClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the create or update parameters for runbook. Provide either content link for a published +// runbook or draft, not both. +func (client RunbookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (result Runbook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RunbookCreateOrUpdateProperties.Draft.DraftContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}, + {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Algorithm", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.RunbookCreateOrUpdateProperties.PublishContentLink.ContentHash.Value", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RunbookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RunbookClient) CreateOrUpdateResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the runbook by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RunbookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RunbookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result Runbook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RunbookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RunbookClient) GetResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the content of runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.GetContent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "GetContent", resp, "Failure responding to request") + return + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client RunbookClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) GetContentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client RunbookClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of runbooks. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client RunbookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client RunbookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client RunbookClient) ListByAutomationAccountResponder(resp *http.Response) (result RunbookListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client RunbookClient) listByAutomationAccountNextResults(ctx context.Context, lastResults RunbookListResult) (result RunbookListResult, err error) { + req, err := lastResults.runbookListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client RunbookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result RunbookListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Publish publish runbook draft. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the publish runbook operation. +func (client RunbookClient) Publish(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookPublishFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Publish") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Publish", err.Error()) + } + + req, err := client.PublishPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Publish", nil, "Failure preparing request") + return + } + + result, err = client.PublishSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Publish", result.Response(), "Failure sending request") + return + } + + return +} + +// PublishPreparer prepares the Publish request. +func (client RunbookClient) PublishPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/publish", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PublishSender sends the Publish request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) PublishSender(req *http.Request) (future RunbookPublishFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PublishResponder handles the response to the Publish request. The method always +// closes the http.Response Body. +func (client RunbookClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update the runbook identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// parameters - the update parameters for runbook. +func (client RunbookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (result Runbook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RunbookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters RunbookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RunbookClient) UpdateResponder(resp *http.Response) (result Runbook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/runbookdraft.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/runbookdraft.go new file mode 100644 index 000000000000..221d6347b4ef --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/runbookdraft.go @@ -0,0 +1,382 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "io" + "net/http" +) + +// RunbookDraftClient is the automation Client +type RunbookDraftClient struct { + BaseClient +} + +// NewRunbookDraftClient creates an instance of the RunbookDraftClient client. +func NewRunbookDraftClient(subscriptionID string) RunbookDraftClient { + return NewRunbookDraftClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRunbookDraftClientWithBaseURI creates an instance of the RunbookDraftClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRunbookDraftClientWithBaseURI(baseURI string, subscriptionID string) RunbookDraftClient { + return RunbookDraftClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve the runbook draft identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraft, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RunbookDraftClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) GetResponder(resp *http.Response) (result RunbookDraft, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContent retrieve the content of runbook draft identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) GetContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.GetContent") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "GetContent", err.Error()) + } + + req, err := client.GetContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", nil, "Failure preparing request") + return + } + + resp, err := client.GetContentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure sending request") + return + } + + result, err = client.GetContentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "GetContent", resp, "Failure responding to request") + return + } + + return +} + +// GetContentPreparer prepares the GetContent request. +func (client RunbookDraftClient) GetContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContentSender sends the GetContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) GetContentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContentResponder handles the response to the GetContent request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) GetContentResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// ReplaceContent replaces the runbook draft content. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// runbookContent - the runbook draft content. +func (client RunbookDraftClient) ReplaceContent(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (result RunbookDraftReplaceContentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.ReplaceContent") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "ReplaceContent", err.Error()) + } + + req, err := client.ReplaceContentPreparer(ctx, resourceGroupName, automationAccountName, runbookName, runbookContent) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", nil, "Failure preparing request") + return + } + + result, err = client.ReplaceContentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "ReplaceContent", result.Response(), "Failure sending request") + return + } + + return +} + +// ReplaceContentPreparer prepares the ReplaceContent request. +func (client RunbookDraftClient) ReplaceContentPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, runbookContent io.ReadCloser) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("text/powershell"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), + autorest.WithFile(runbookContent), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReplaceContentSender sends the ReplaceContent request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) ReplaceContentSender(req *http.Request) (future RunbookDraftReplaceContentFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReplaceContentResponder handles the response to the ReplaceContent request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) ReplaceContentResponder(resp *http.Response) (result ReadCloser, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UndoEdit undo draft edit to last known published state identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client RunbookDraftClient) UndoEdit(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result RunbookDraftUndoEditResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunbookDraftClient.UndoEdit") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.RunbookDraftClient", "UndoEdit", err.Error()) + } + + req, err := client.UndoEditPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", nil, "Failure preparing request") + return + } + + resp, err := client.UndoEditSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure sending request") + return + } + + result, err = client.UndoEditResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftClient", "UndoEdit", resp, "Failure responding to request") + return + } + + return +} + +// UndoEditPreparer prepares the UndoEdit request. +func (client RunbookDraftClient) UndoEditPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UndoEditSender sends the UndoEdit request. The method will close the +// http.Response Body if it receives an error. +func (client RunbookDraftClient) UndoEditSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UndoEditResponder handles the response to the UndoEdit request. The method always +// closes the http.Response Body. +func (client RunbookDraftClient) UndoEditResponder(resp *http.Response) (result RunbookDraftUndoEditResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/schedule.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/schedule.go new file mode 100644 index 000000000000..68ab28b63a2c --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/schedule.go @@ -0,0 +1,511 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ScheduleClient is the automation Client +type ScheduleClient struct { + BaseClient +} + +// NewScheduleClient creates an instance of the ScheduleClient client. +func NewScheduleClient(subscriptionID string) ScheduleClient { + return NewScheduleClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewScheduleClientWithBaseURI creates an instance of the ScheduleClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewScheduleClientWithBaseURI(baseURI string, subscriptionID string) ScheduleClient { + return ScheduleClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a schedule. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the create or update schedule operation. +func (client ScheduleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ScheduleCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ScheduleCreateOrUpdateProperties.StartTime", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ScheduleClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ScheduleClient) CreateOrUpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusConflict), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +func (client ScheduleClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ScheduleClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ScheduleClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +func (client ScheduleClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ScheduleClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ScheduleClient) GetResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of schedules. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client ScheduleClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.slr.hasNextLink() && result.slr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client ScheduleClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client ScheduleClient) ListByAutomationAccountResponder(resp *http.Response) (result ScheduleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client ScheduleClient) listByAutomationAccountNextResults(ctx context.Context, lastResults ScheduleListResult) (result ScheduleListResult, err error) { + req, err := lastResults.scheduleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ScheduleClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result ScheduleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update the schedule identified by schedule name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// scheduleName - the schedule name. +// parameters - the parameters supplied to the update schedule operation. +func (client ScheduleClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.ScheduleClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, scheduleName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.ScheduleClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ScheduleClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, scheduleName string, parameters ScheduleUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ScheduleClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ScheduleClient) UpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationmachineruns.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationmachineruns.go new file mode 100644 index 000000000000..d1f3bb5a6cd1 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationmachineruns.go @@ -0,0 +1,228 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// SoftwareUpdateConfigurationMachineRunsClient is the automation Client +type SoftwareUpdateConfigurationMachineRunsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationMachineRunsClient creates an instance of the +// SoftwareUpdateConfigurationMachineRunsClient client. +func NewSoftwareUpdateConfigurationMachineRunsClient(subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { + return NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI creates an instance of the +// SoftwareUpdateConfigurationMachineRunsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSoftwareUpdateConfigurationMachineRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationMachineRunsClient { + return SoftwareUpdateConfigurationMachineRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByID get a single software update configuration machine run by Id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationMachineRunID - the Id of the software update configuration machine run. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationMachineRun, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationMachineRunsClient.GetByID") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", err.Error()) + } + + req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationMachineRunID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "GetByID", resp, "Failure responding to request") + return + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationMachineRunID uuid.UUID, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationMachineRunId": autorest.Encode("path", softwareUpdateConfigurationMachineRunID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationMachineRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRun, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List return list of software update configuration machine runs +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', +// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' +// skip - number of entries you skip before returning results +// top - maximum number of entries returned in the results collection +func (client SoftwareUpdateConfigurationMachineRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationMachineRunsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationMachineRunsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationMachineRunsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skip) > 0 { + queryParameters["$skip"] = autorest.Encode("query", skip) + } + if len(top) > 0 { + queryParameters["$top"] = autorest.Encode("query", top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationMachineRuns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationMachineRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationMachineRunListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationruns.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationruns.go new file mode 100644 index 000000000000..3f81299ed59b --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurationruns.go @@ -0,0 +1,227 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// SoftwareUpdateConfigurationRunsClient is the automation Client +type SoftwareUpdateConfigurationRunsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationRunsClient creates an instance of the SoftwareUpdateConfigurationRunsClient client. +func NewSoftwareUpdateConfigurationRunsClient(subscriptionID string) SoftwareUpdateConfigurationRunsClient { + return NewSoftwareUpdateConfigurationRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSoftwareUpdateConfigurationRunsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationRunsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewSoftwareUpdateConfigurationRunsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationRunsClient { + return SoftwareUpdateConfigurationRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByID get a single software update configuration Run by Id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationRunID - the Id of the software update configuration run. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationRunsClient) GetByID(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (result SoftwareUpdateConfigurationRun, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationRunsClient.GetByID") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "GetByID", err.Error()) + } + + req, err := client.GetByIDPreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationRunID, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "GetByID", resp, "Failure responding to request") + return + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationRunID uuid.UUID, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationRunId": autorest.Encode("path", softwareUpdateConfigurationRunID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationRunsClient) GetByIDResponder(resp *http.Response) (result SoftwareUpdateConfigurationRun, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List return list of software update configuration runs +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. You can use the following filters: 'properties/osType', +// 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' +// skip - number of entries you skip before returning results +// top - maximum number of entries returned in the results collection +func (client SoftwareUpdateConfigurationRunsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (result SoftwareUpdateConfigurationRunListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationRunsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationRunsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter, skip, top) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationRunsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string, skip string, top string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if len(skip) > 0 { + queryParameters["$skip"] = autorest.Encode("query", skip) + } + if len(top) > 0 { + queryParameters["$top"] = autorest.Encode("query", top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurationRuns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationRunsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationRunsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationRunListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurations.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurations.go new file mode 100644 index 000000000000..145e3cfdc4e9 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/softwareupdateconfigurations.go @@ -0,0 +1,409 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SoftwareUpdateConfigurationsClient is the automation Client +type SoftwareUpdateConfigurationsClient struct { + BaseClient +} + +// NewSoftwareUpdateConfigurationsClient creates an instance of the SoftwareUpdateConfigurationsClient client. +func NewSoftwareUpdateConfigurationsClient(subscriptionID string) SoftwareUpdateConfigurationsClient { + return NewSoftwareUpdateConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSoftwareUpdateConfigurationsClientWithBaseURI creates an instance of the SoftwareUpdateConfigurationsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewSoftwareUpdateConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SoftwareUpdateConfigurationsClient { + return SoftwareUpdateConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a new software update configuration with the name given in the URI. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// parameters - request body. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SoftwareUpdateConfigurationProperties.UpdateConfiguration", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SoftwareUpdateConfigurationProperties.ScheduleInfo", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, parameters, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SoftwareUpdateConfigurationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, parameters SoftwareUpdateConfiguration, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Name = nil + parameters.ID = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) CreateResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a specific software update configuration. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SoftwareUpdateConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetByName get a single software update configuration by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// softwareUpdateConfigurationName - the name of the software update configuration to be created. +// clientRequestID - identifies this specific client request. +func (client SoftwareUpdateConfigurationsClient) GetByName(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (result SoftwareUpdateConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.GetByName") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "GetByName", err.Error()) + } + + req, err := client.GetByNamePreparer(ctx, resourceGroupName, automationAccountName, softwareUpdateConfigurationName, clientRequestID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", nil, "Failure preparing request") + return + } + + resp, err := client.GetByNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure sending request") + return + } + + result, err = client.GetByNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "GetByName", resp, "Failure responding to request") + return + } + + return +} + +// GetByNamePreparer prepares the GetByName request. +func (client SoftwareUpdateConfigurationsClient) GetByNamePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, softwareUpdateConfigurationName string, clientRequestID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "softwareUpdateConfigurationName": autorest.Encode("path", softwareUpdateConfigurationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByNameSender sends the GetByName request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) GetByNameSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByNameResponder handles the response to the GetByName request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) GetByNameResponder(resp *http.Response) (result SoftwareUpdateConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get all software update configurations for the account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// clientRequestID - identifies this specific client request. +// filter - the filter to apply on the operation. +func (client SoftwareUpdateConfigurationsClient) List(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (result SoftwareUpdateConfigurationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SoftwareUpdateConfigurationsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SoftwareUpdateConfigurationsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, automationAccountName, clientRequestID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SoftwareUpdateConfigurationsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SoftwareUpdateConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, clientRequestID string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if len(clientRequestID) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("clientRequestId", autorest.String(clientRequestID))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SoftwareUpdateConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SoftwareUpdateConfigurationsClient) ListResponder(resp *http.Response) (result SoftwareUpdateConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrol.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrol.go new file mode 100644 index 000000000000..7b8f6d2f374b --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrol.go @@ -0,0 +1,528 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SourceControlClient is the automation Client +type SourceControlClient struct { + BaseClient +} + +// NewSourceControlClient creates an instance of the SourceControlClient client. +func NewSourceControlClient(subscriptionID string) SourceControlClient { + return NewSourceControlClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSourceControlClientWithBaseURI creates an instance of the SourceControlClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSourceControlClientWithBaseURI(baseURI string, subscriptionID string) SourceControlClient { + return SourceControlClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// parameters - the parameters supplied to the create or update source control operation. +func (client SourceControlClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (result SourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.AccessToken", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.AccessToken", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.RefreshToken", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken.RefreshToken", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + }}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.MaxLength, Rule: 512, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SourceControlClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SourceControlClient) CreateOrUpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the name of source control. +func (client SourceControlClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SourceControlClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SourceControlClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the source control identified by source control name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the name of source control. +func (client SourceControlClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (result SourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlClient) GetResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source controls. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client SourceControlClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.sclr.Response.Response != nil { + sc = result.sclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.sclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.sclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.sclr.hasNextLink() && result.sclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlClient) listByAutomationAccountNextResults(ctx context.Context, lastResults SourceControlListResult) (result SourceControlListResult, err error) { + req, err := lastResults.sourceControlListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result SourceControlListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// parameters - the parameters supplied to the update source control operation. +func (client SourceControlClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (result SourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SourceControlClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SourceControlClient) UpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjob.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjob.go new file mode 100644 index 000000000000..b981c516366c --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjob.go @@ -0,0 +1,350 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// SourceControlSyncJobClient is the automation Client +type SourceControlSyncJobClient struct { + BaseClient +} + +// NewSourceControlSyncJobClient creates an instance of the SourceControlSyncJobClient client. +func NewSourceControlSyncJobClient(subscriptionID string) SourceControlSyncJobClient { + return NewSourceControlSyncJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSourceControlSyncJobClientWithBaseURI creates an instance of the SourceControlSyncJobClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewSourceControlSyncJobClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobClient { + return SourceControlSyncJobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates the sync job for a source control. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// parameters - the parameters supplied to the create source control sync job operation. +func (client SourceControlSyncJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (result SourceControlSyncJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties.CommitID", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SourceControlSyncJobCreateProperties.CommitID", Name: validation.MinLength, Rule: 0, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SourceControlSyncJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, parameters SourceControlSyncJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) CreateResponder(resp *http.Response) (result SourceControlSyncJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the source control sync job identified by job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +func (client SourceControlSyncJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (result SourceControlSyncJobByID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlSyncJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) GetResponder(resp *http.Response) (result SourceControlSyncJobByID, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source control sync jobs. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// filter - the filter to apply on the operation. +func (client SourceControlSyncJobClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.scsjlr.Response.Response != nil { + sc = result.scsjlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.scsjlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.scsjlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.scsjlr.hasNextLink() && result.scsjlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlSyncJobClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlSyncJobListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlSyncJobClient) listByAutomationAccountNextResults(ctx context.Context, lastResults SourceControlSyncJobListResult) (result SourceControlSyncJobListResult, err error) { + req, err := lastResults.sourceControlSyncJobListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlSyncJobClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, sourceControlName, filter) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjobstreams.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjobstreams.go new file mode 100644 index 000000000000..a33a2b8e3cfb --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/sourcecontrolsyncjobstreams.go @@ -0,0 +1,258 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "net/http" +) + +// SourceControlSyncJobStreamsClient is the automation Client +type SourceControlSyncJobStreamsClient struct { + BaseClient +} + +// NewSourceControlSyncJobStreamsClient creates an instance of the SourceControlSyncJobStreamsClient client. +func NewSourceControlSyncJobStreamsClient(subscriptionID string) SourceControlSyncJobStreamsClient { + return NewSourceControlSyncJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSourceControlSyncJobStreamsClientWithBaseURI creates an instance of the SourceControlSyncJobStreamsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSourceControlSyncJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) SourceControlSyncJobStreamsClient { + return SourceControlSyncJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve a sync job stream identified by stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// streamID - the id of the sync job stream. +func (client SourceControlSyncJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (result SourceControlSyncJobStreamByID, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, streamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlSyncJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, streamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "streamId": autorest.Encode("path", streamID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobStreamsClient) GetResponder(resp *http.Response) (result SourceControlSyncJobStreamByID, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySyncJob retrieve a list of sync job streams identified by sync job id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// sourceControlName - the source control name. +// sourceControlSyncJobID - the source control sync job id. +// filter - the filter to apply on the operation. +func (client SourceControlSyncJobStreamsClient) ListBySyncJob(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsClient.ListBySyncJob") + defer func() { + sc := -1 + if result.scsjslbsj.Response.Response != nil { + sc = result.scsjslbsj.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", err.Error()) + } + + result.fn = client.listBySyncJobNextResults + req, err := client.ListBySyncJobPreparer(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySyncJobSender(req) + if err != nil { + result.scsjslbsj.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure sending request") + return + } + + result.scsjslbsj, err = client.ListBySyncJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "ListBySyncJob", resp, "Failure responding to request") + return + } + if result.scsjslbsj.hasNextLink() && result.scsjslbsj.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySyncJobPreparer prepares the ListBySyncJob request. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySyncJobSender sends the ListBySyncJob request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySyncJobResponder handles the response to the ListBySyncJob request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobResponder(resp *http.Response) (result SourceControlSyncJobStreamsListBySyncJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySyncJobNextResults retrieves the next set of results, if any. +func (client SourceControlSyncJobStreamsClient) listBySyncJobNextResults(ctx context.Context, lastResults SourceControlSyncJobStreamsListBySyncJob) (result SourceControlSyncJobStreamsListBySyncJob, err error) { + req, err := lastResults.sourceControlSyncJobStreamsListBySyncJobPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySyncJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySyncJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobStreamsClient", "listBySyncJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySyncJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlSyncJobStreamsClient) ListBySyncJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID, filter string) (result SourceControlSyncJobStreamsListBySyncJobIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsClient.ListBySyncJob") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySyncJob(ctx, resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobID, filter) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/statistics.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/statistics.go new file mode 100644 index 000000000000..4baf146cb0c9 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/statistics.go @@ -0,0 +1,120 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// StatisticsClient is the automation Client +type StatisticsClient struct { + BaseClient +} + +// NewStatisticsClient creates an instance of the StatisticsClient client. +func NewStatisticsClient(subscriptionID string) StatisticsClient { + return NewStatisticsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStatisticsClientWithBaseURI creates an instance of the StatisticsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewStatisticsClientWithBaseURI(baseURI string, subscriptionID string) StatisticsClient { + return StatisticsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAutomationAccount retrieve the statistics for the account. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client StatisticsClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result StatisticsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StatisticsClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.StatisticsClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.StatisticsClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client StatisticsClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/statistics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client StatisticsClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client StatisticsClient) ListByAutomationAccountResponder(resp *http.Response) (result StatisticsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/testjob.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/testjob.go new file mode 100644 index 000000000000..661e65bdee11 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/testjob.go @@ -0,0 +1,462 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TestJobClient is the automation Client +type TestJobClient struct { + BaseClient +} + +// NewTestJobClient creates an instance of the TestJobClient client. +func NewTestJobClient(subscriptionID string) TestJobClient { + return NewTestJobClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTestJobClientWithBaseURI creates an instance of the TestJobClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewTestJobClientWithBaseURI(baseURI string, subscriptionID string) TestJobClient { + return TestJobClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a test job of the runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the parameters supplied to the create test job operation. +// parameters - the parameters supplied to the create test job operation. +func (client TestJobClient) Create(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (result TestJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, automationAccountName, runbookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Create", resp, "Failure responding to request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TestJobClient) CreatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, parameters TestJobCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TestJobClient) CreateResponder(resp *http.Response) (result TestJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the test job for the specified runbook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result TestJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client TestJobClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TestJobClient) GetResponder(resp *http.Response) (result TestJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Resume resume the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Resume(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Resume") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Resume", err.Error()) + } + + req, err := client.ResumePreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", nil, "Failure preparing request") + return + } + + resp, err := client.ResumeSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure sending request") + return + } + + result, err = client.ResumeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Resume", resp, "Failure responding to request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client TestJobClient) ResumePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/resume", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) ResumeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client TestJobClient) ResumeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stop the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Stop") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Stop", resp, "Failure responding to request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client TestJobClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) StopSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client TestJobClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Suspend suspend the test job. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +func (client TestJobClient) Suspend(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobClient.Suspend") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobClient", "Suspend", err.Error()) + } + + req, err := client.SuspendPreparer(ctx, resourceGroupName, automationAccountName, runbookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", nil, "Failure preparing request") + return + } + + resp, err := client.SuspendSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure sending request") + return + } + + result, err = client.SuspendResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobClient", "Suspend", resp, "Failure responding to request") + return + } + + return +} + +// SuspendPreparer prepares the Suspend request. +func (client TestJobClient) SuspendPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/suspend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuspendSender sends the Suspend request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobClient) SuspendSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SuspendResponder handles the response to the Suspend request. The method always +// closes the http.Response Body. +func (client TestJobClient) SuspendResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/testjobstreams.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/testjobstreams.go new file mode 100644 index 000000000000..0fe6f2525e87 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/testjobstreams.go @@ -0,0 +1,252 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TestJobStreamsClient is the automation Client +type TestJobStreamsClient struct { + BaseClient +} + +// NewTestJobStreamsClient creates an instance of the TestJobStreamsClient client. +func NewTestJobStreamsClient(subscriptionID string) TestJobStreamsClient { + return NewTestJobStreamsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTestJobStreamsClientWithBaseURI creates an instance of the TestJobStreamsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewTestJobStreamsClientWithBaseURI(baseURI string, subscriptionID string) TestJobStreamsClient { + return TestJobStreamsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get retrieve a test job stream of the test job identified by runbook name and stream id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// jobStreamID - the job stream id. +func (client TestJobStreamsClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (result JobStream, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobStreamsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, runbookName, jobStreamID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client TestJobStreamsClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, jobStreamID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "jobStreamId": autorest.Encode("path", jobStreamID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobStreamsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TestJobStreamsClient) GetResponder(resp *http.Response) (result JobStream, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByTestJob retrieve a list of test job streams identified by runbook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// runbookName - the runbook name. +// filter - the filter to apply on the operation. +func (client TestJobStreamsClient) ListByTestJob(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobStreamsClient.ListByTestJob") + defer func() { + sc := -1 + if result.jslr.Response.Response != nil { + sc = result.jslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.TestJobStreamsClient", "ListByTestJob", err.Error()) + } + + result.fn = client.listByTestJobNextResults + req, err := client.ListByTestJobPreparer(ctx, resourceGroupName, automationAccountName, runbookName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTestJobSender(req) + if err != nil { + result.jslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure sending request") + return + } + + result.jslr, err = client.ListByTestJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "ListByTestJob", resp, "Failure responding to request") + return + } + if result.jslr.hasNextLink() && result.jslr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByTestJobPreparer prepares the ListByTestJob request. +func (client TestJobStreamsClient) ListByTestJobPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runbookName": autorest.Encode("path", runbookName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTestJobSender sends the ListByTestJob request. The method will close the +// http.Response Body if it receives an error. +func (client TestJobStreamsClient) ListByTestJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTestJobResponder handles the response to the ListByTestJob request. The method always +// closes the http.Response Body. +func (client TestJobStreamsClient) ListByTestJobResponder(resp *http.Response) (result JobStreamListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTestJobNextResults retrieves the next set of results, if any. +func (client TestJobStreamsClient) listByTestJobNextResults(ctx context.Context, lastResults JobStreamListResult) (result JobStreamListResult, err error) { + req, err := lastResults.jobStreamListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTestJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTestJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.TestJobStreamsClient", "listByTestJobNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTestJobComplete enumerates all values, automatically crossing page boundaries as required. +func (client TestJobStreamsClient) ListByTestJobComplete(ctx context.Context, resourceGroupName string, automationAccountName string, runbookName string, filter string) (result JobStreamListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TestJobStreamsClient.ListByTestJob") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByTestJob(ctx, resourceGroupName, automationAccountName, runbookName, filter) + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/usages.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/usages.go new file mode 100644 index 000000000000..9d0713805968 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/usages.go @@ -0,0 +1,116 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UsagesClient is the automation Client +type UsagesClient struct { + BaseClient +} + +// NewUsagesClient creates an instance of the UsagesClient client. +func NewUsagesClient(subscriptionID string) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAutomationAccount retrieve the usage for the account id. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client UsagesClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result UsageListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.UsagesClient", "ListByAutomationAccount", err.Error()) + } + + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.UsagesClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client UsagesClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client UsagesClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client UsagesClient) ListByAutomationAccountResponder(resp *http.Response) (result UsageListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/variable.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/variable.go new file mode 100644 index 000000000000..a235e357262e --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/variable.go @@ -0,0 +1,510 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VariableClient is the automation Client +type VariableClient struct { + BaseClient +} + +// NewVariableClient creates an instance of the VariableClient client. +func NewVariableClient(subscriptionID string) VariableClient { + return NewVariableClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVariableClientWithBaseURI creates an instance of the VariableClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVariableClientWithBaseURI(baseURI string, subscriptionID string) VariableClient { + return VariableClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the create or update variable operation. +func (client VariableClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (result Variable, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.VariableCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VariableClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VariableClient) CreateOrUpdateResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. +func (client VariableClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, variableName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client VariableClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VariableClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the variable identified by variable name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the name of variable. +func (client VariableClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (result Variable, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, variableName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VariableClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VariableClient) GetResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of variables. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client VariableClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.vlr.Response.Response != nil { + sc = result.vlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.vlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.vlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.vlr.hasNextLink() && result.vlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client VariableClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client VariableClient) ListByAutomationAccountResponder(resp *http.Response) (result VariableListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client VariableClient) listByAutomationAccountNextResults(ctx context.Context, lastResults VariableListResult) (result VariableListResult, err error) { + req, err := lastResults.variableListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client VariableClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string) (result VariableListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName) + return +} + +// Update update a variable. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// variableName - the variable name. +// parameters - the parameters supplied to the update variable operation. +func (client VariableClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (result Variable, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VariableClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.VariableClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, variableName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.VariableClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client VariableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, variableName string, parameters VariableUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "variableName": autorest.Encode("path", variableName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VariableClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VariableClient) UpdateResponder(resp *http.Response) (result Variable, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/version.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/version.go new file mode 100644 index 000000000000..2327deaca531 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/version.go @@ -0,0 +1,19 @@ +package automation + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " automation/2020-01-13-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/watcher.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/watcher.go new file mode 100644 index 000000000000..92ee2c0c5221 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/watcher.go @@ -0,0 +1,681 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// WatcherClient is the automation Client +type WatcherClient struct { + BaseClient +} + +// NewWatcherClient creates an instance of the WatcherClient client. +func NewWatcherClient(subscriptionID string) WatcherClient { + return NewWatcherClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWatcherClientWithBaseURI creates an instance of the WatcherClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWatcherClientWithBaseURI(baseURI string, subscriptionID string) WatcherClient { + return WatcherClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +// parameters - the create or update parameters for watcher. +func (client WatcherClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters Watcher) (result Watcher, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, watcherName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WatcherClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters Watcher) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WatcherClient) CreateOrUpdateResponder(resp *http.Response) (result Watcher, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the watcher by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WatcherClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WatcherClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result Watcher, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client WatcherClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WatcherClient) GetResponder(resp *http.Response) (result Watcher, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of watchers. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client WatcherClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WatcherListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.wlr.hasNextLink() && result.wlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client WatcherClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client WatcherClient) ListByAutomationAccountResponder(resp *http.Response) (result WatcherListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client WatcherClient) listByAutomationAccountNextResults(ctx context.Context, lastResults WatcherListResult) (result WatcherListResult, err error) { + req, err := lastResults.watcherListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client WatcherClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WatcherListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Start resume the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Start(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Start") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", nil, "Failure preparing request") + return + } + + resp, err := client.StartSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", resp, "Failure sending request") + return + } + + result, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Start", resp, "Failure responding to request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client WatcherClient) StartPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) StartSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client WatcherClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop resume the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +func (client WatcherClient) Stop(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Stop") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, automationAccountName, watcherName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Stop", resp, "Failure responding to request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client WatcherClient) StopPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) StopSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client WatcherClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update update the watcher identified by watcher name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// watcherName - the watcher name. +// parameters - the update parameters for watcher. +func (client WatcherClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters WatcherUpdateParameters) (result Watcher, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WatcherClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WatcherClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, watcherName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WatcherClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WatcherClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, watcherName string, parameters WatcherUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "watcherName": autorest.Encode("path", watcherName), + } + + const APIVersion = "2020-01-13-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WatcherClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WatcherClient) UpdateResponder(resp *http.Response) (result Watcher, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/automation/mgmt/2020-01-13-preview/automation/webhook.go b/services/preview/automation/mgmt/2020-01-13-preview/automation/webhook.go new file mode 100644 index 000000000000..302cfc5d2402 --- /dev/null +++ b/services/preview/automation/mgmt/2020-01-13-preview/automation/webhook.go @@ -0,0 +1,598 @@ +package automation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// WebhookClient is the automation Client +type WebhookClient struct { + BaseClient +} + +// NewWebhookClient creates an instance of the WebhookClient client. +func NewWebhookClient(subscriptionID string) WebhookClient { + return NewWebhookClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWebhookClientWithBaseURI creates an instance of the WebhookClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWebhookClientWithBaseURI(baseURI string, subscriptionID string) WebhookClient { + return WebhookClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the create or update parameters for webhook. +func (client WebhookClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (result Webhook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.WebhookCreateOrUpdateProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WebhookClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WebhookClient) CreateOrUpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the webhook by name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +func (client WebhookClient) Delete(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, automationAccountName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WebhookClient) DeletePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WebhookClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateURI generates a Uri for use in creating a webhook. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +func (client WebhookClient) GenerateURI(ctx context.Context, resourceGroupName string, automationAccountName string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.GenerateURI") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "GenerateURI", err.Error()) + } + + req, err := client.GenerateURIPreparer(ctx, resourceGroupName, automationAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateURISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure sending request") + return + } + + result, err = client.GenerateURIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "GenerateURI", resp, "Failure responding to request") + return + } + + return +} + +// GenerateURIPreparer prepares the GenerateURI request. +func (client WebhookClient) GenerateURIPreparer(ctx context.Context, resourceGroupName string, automationAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateURISender sends the GenerateURI request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) GenerateURISender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateURIResponder handles the response to the GenerateURI request. The method always +// closes the http.Response Body. +func (client WebhookClient) GenerateURIResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +func (client WebhookClient) Get(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (result Webhook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, automationAccountName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client WebhookClient) GetPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WebhookClient) GetResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of webhooks. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// filter - the filter to apply on the operation. +func (client WebhookClient) ListByAutomationAccount(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "ListByAutomationAccount", err.Error()) + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, resourceGroupName, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "ListByAutomationAccount", resp, "Failure responding to request") + return + } + if result.wlr.hasNextLink() && result.wlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client WebhookClient) ListByAutomationAccountPreparer(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client WebhookClient) ListByAutomationAccountResponder(resp *http.Response) (result WebhookListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client WebhookClient) listByAutomationAccountNextResults(ctx context.Context, lastResults WebhookListResult) (result WebhookListResult, err error) { + req, err := lastResults.webhookListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client WebhookClient) ListByAutomationAccountComplete(ctx context.Context, resourceGroupName string, automationAccountName string, filter string) (result WebhookListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.ListByAutomationAccount") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAutomationAccount(ctx, resourceGroupName, automationAccountName, filter) + return +} + +// Update update the webhook identified by webhook name. +// Parameters: +// resourceGroupName - name of an Azure Resource group. +// automationAccountName - the name of the automation account. +// webhookName - the webhook name. +// parameters - the update parameters for webhook. +func (client WebhookClient) Update(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (result Webhook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("automation.WebhookClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, automationAccountName, webhookName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.WebhookClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WebhookClient) UpdatePreparer(ctx context.Context, resourceGroupName string, automationAccountName string, webhookName string, parameters WebhookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WebhookClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WebhookClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/version/version.go b/version/version.go index eb714a979398..7330fc5bda4f 100644 --- a/version/version.go +++ b/version/version.go @@ -4,4 +4,4 @@ package version // Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v61.0.0" +const Number = "v61.1.0" From d1141dadf276856331101770483726ca933f3ba6 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Thu, 6 Jan 2022 14:27:00 -0800 Subject: [PATCH 17/36] Handle skipping docker build when PushImages is set and there is no dockerfile (#16555) Co-authored-by: Ben Broderick Phillips --- .../scripts/stress-testing/stress-test-deployment-lib.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index 5ab1597043fd..da3bb3fd5d5c 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -156,9 +156,10 @@ function DeployStressPackage( } $imageTag += "/$($pkg.Namespace)/$($pkg.ReleaseName):${deployId}" - if ($pushImages) { + $dockerFilePath = "$($pkg.Directory)/Dockerfile" + if ($pushImages -and (Test-Path $dockerFilePath)) { Write-Host "Building and pushing stress test docker image '$imageTag'" - $dockerFile = Get-ChildItem "$($pkg.Directory)/Dockerfile" + $dockerFile = Get-ChildItem $dockerFilePath Run docker build -t $imageTag -f $dockerFile.FullName $dockerFile.DirectoryName if ($LASTEXITCODE) { return } Run docker push $imageTag From 6ddd572390e82a603c1531b9fe89e65a52206294 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Fri, 7 Jan 2022 15:43:46 +0800 Subject: [PATCH 18/36] add new config (#16774) --- eng/generate_options.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/generate_options.json b/eng/generate_options.json index c99626ba888d..2f03286f7de4 100644 --- a/eng/generate_options.json +++ b/eng/generate_options.json @@ -7,7 +7,8 @@ "--multiapi", "--use-onever", "--version=V2", - "--go.license-header=MICROSOFT_MIT_NO_VERSION" + "--go.license-header=MICROSOFT_MIT_NO_VERSION", + "--pass-thru:schema-validator-swagger" ], "additionalOptions": [ "--enum-prefix" From 2aba54c61835b349518286fd56bf830774db3f3d Mon Sep 17 00:00:00 2001 From: Charles Lowell <10964656+chlowell@users.noreply.github.com> Date: Fri, 7 Jan 2022 10:01:05 -0800 Subject: [PATCH 19/36] Add offline test for Azure Arc managed identity (#16771) --- sdk/azidentity/azidentity_test.go | 15 +- .../managed_identity_credential_test.go | 229 ++++++++---------- 2 files changed, 119 insertions(+), 125 deletions(-) diff --git a/sdk/azidentity/azidentity_test.go b/sdk/azidentity/azidentity_test.go index e7b6d0c736b3..5e5f501284ba 100644 --- a/sdk/azidentity/azidentity_test.go +++ b/sdk/azidentity/azidentity_test.go @@ -30,9 +30,15 @@ const ( // Set environment variables for the duration of a test. Restore their prior values // after the test completes. Obviated by 1.17's T.Setenv func setEnvironmentVariables(t *testing.T, vars map[string]string) { + unsetSentinel := "variables having no initial value must be unset after the test" priorValues := make(map[string]string, len(vars)) for k, v := range vars { - priorValues[k] = os.Getenv(k) + priorValue, ok := os.LookupEnv(k) + if ok { + priorValues[k] = priorValue + } else { + priorValues[k] = unsetSentinel + } err := os.Setenv(k, v) if err != nil { t.Fatalf("Unexpected error setting %s: %v", k, err) @@ -41,7 +47,12 @@ func setEnvironmentVariables(t *testing.T, vars map[string]string) { t.Cleanup(func() { for k, v := range priorValues { - err := os.Setenv(k, v) + var err error + if v == unsetSentinel { + err = os.Unsetenv(k) + } else { + err = os.Setenv(k, v) + } if err != nil { t.Fatalf("Unexpected error resetting %s: %v", k, err) } diff --git a/sdk/azidentity/managed_identity_credential_test.go b/sdk/azidentity/managed_identity_credential_test.go index 994803a4cc71..6d0a85d2c33a 100644 --- a/sdk/azidentity/managed_identity_credential_test.go +++ b/sdk/azidentity/managed_identity_credential_test.go @@ -11,6 +11,7 @@ import ( "net/http" "net/url" "os" + "path/filepath" "strings" "testing" "time" @@ -54,80 +55,118 @@ func (m *mockIMDS) Do(req *http.Request) (*http.Response, error) { panic("no more responses") } -func TestManagedIdentityCredential_GetTokenInAzureArcLive(t *testing.T) { - if len(os.Getenv(arcIMDSEndpoint)) == 0 { - t.Skip() - } - msiCred, err := NewManagedIdentityCredential(nil) +func TestManagedIdentityCredential_AzureArc(t *testing.T) { + file, err := os.Create(filepath.Join(t.TempDir(), "arc.key")) if err != nil { - t.Fatalf("unexpected error: %v", err) + t.Fatal(err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) - if err != nil { - t.Fatalf("Received an error when attempting to retrieve a token") + defer file.Close() + expectedKey := "expected-key" + n, err := file.WriteString(expectedKey) + if n != len(expectedKey) || err != nil { + t.Fatalf("failed to write key file: %v", err) } -} -func TestManagedIdentityCredential_GetTokenInCloudShellLive(t *testing.T) { - if len(os.Getenv("MSI_ENDPOINT")) == 0 { - t.Skip() - } - msiCred, err := NewManagedIdentityCredential(nil) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) - if err != nil { - t.Fatalf("Received an error when attempting to retrieve a token") + expectedPath := "/foo/token" + validateReq := func(req *http.Request) bool { + if req.URL.Path != expectedPath { + t.Fatalf("unexpected path: %s", req.URL.Path) + } + if p := req.URL.Query().Get("api-version"); p != azureArcAPIVersion { + t.Fatalf("unexpected api-version: %s", p) + } + if p := req.URL.Query().Get("resource"); p != strings.TrimSuffix(liveTestScope, defaultSuffix) { + t.Fatalf("unexpected resource: %s", p) + } + if h := req.Header.Get("metadata"); h != "true" { + t.Fatalf("unexpected metadata header: %s", h) + } + if h := req.Header.Get("Authorization"); h != "Basic "+expectedKey { + t.Fatalf("unexpected Authorization: %s", h) + } + return true } -} -func TestManagedIdentityCredential_GetTokenInCloudShellMock(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() - srv.AppendResponse(mock.WithBody([]byte(accessTokenRespSuccess))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - defer clearEnvVars("MSI_ENDPOINT") - options := ManagedIdentityCredentialOptions{} - options.Transport = srv - msiCred, err := NewManagedIdentityCredential(&options) + srv.AppendResponse(mock.WithHeader("WWW-Authenticate", "Basic realm="+file.Name()), mock.WithStatusCode(401)) + srv.AppendResponse(mock.WithPredicate(validateReq), mock.WithBody([]byte(accessTokenRespSuccess))) + srv.AppendResponse() + + setEnvironmentVariables(t, map[string]string{ + arcIMDSEndpoint: srv.URL(), + identityEndpoint: srv.URL() + expectedPath, + }) + opts := ManagedIdentityCredentialOptions{ClientOptions: azcore.ClientOptions{Transport: srv}} + cred, err := NewManagedIdentityCredential(&opts) if err != nil { - t.Fatalf("unexpected error: %v", err) + t.Fatal(err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { - t.Fatalf("Received an error when attempting to retrieve a token") + t.Fatal(err) + } + if tk.Token != tokenValue { + t.Fatalf("unexpected token: %s", tk.Token) + } + if tk.ExpiresOn.Before(time.Now().UTC()) { + t.Fatal("GetToken returned an invalid expiration time") } } -func TestManagedIdentityCredential_GetTokenInCloudShellMockFail(t *testing.T) { - resetEnvironmentVarsForTest() +func TestManagedIdentityCredential_CloudShell(t *testing.T) { + validateReq := func(req *http.Request) bool { + err := req.ParseForm() + if err != nil { + t.Fatal(err) + } + if v := req.FormValue("resource"); v != strings.TrimSuffix(liveTestScope, defaultSuffix) { + t.Fatalf("unexpected resource: %s", v) + } + if h := req.Header.Get("metadata"); h != "true" { + t.Fatalf("unexpected metadata header: %s", h) + } + return true + } srv, close := mock.NewServer() defer close() - srv.AppendResponse(mock.WithStatusCode(http.StatusUnauthorized)) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - defer clearEnvVars("MSI_ENDPOINT") + srv.AppendResponse(mock.WithPredicate(validateReq), mock.WithBody([]byte(accessTokenRespSuccess))) + srv.AppendResponse() + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL()}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) if err != nil { - t.Fatalf("unexpected error: %v", err) + t.Fatal(err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) + if err != nil { + t.Fatal(err) + } + if tk.Token != tokenValue { + t.Fatalf("unexpected token value: %s", tk.Token) + } + srv.AppendResponse(mock.WithPredicate(validateReq), mock.WithStatusCode(http.StatusUnauthorized)) + srv.AppendResponse() + _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err == nil { - t.Fatalf("Expected an error but did not receive one") + t.Fatal("expected an error but didn't receive one") } } func TestManagedIdentityCredential_GetTokenInAppServiceV20170901Mock_windows(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() - srv.AppendResponse(mock.WithBody([]byte(appServiceWindowsSuccessResp))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + expectedSecret := "expected-secret" + pred := func(req *http.Request) bool { + if secret := req.Header.Get("Secret"); secret != expectedSecret { + t.Fatalf(`unexpected Secret header "%s"`, secret) + } + return true + } + srv.AppendResponse(mock.WithPredicate(pred), mock.WithBody([]byte(appServiceWindowsSuccessResp))) + srv.AppendResponse() + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: expectedSecret}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -147,13 +186,10 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20170901Mock_windows(t * } func TestManagedIdentityCredential_GetTokenInAppServiceV20170901Mock_linux(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(appServiceLinuxSuccessResp))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "secret"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -173,13 +209,10 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20170901Mock_linux(t *te } func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_windows(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(appServiceWindowsSuccessResp))) - _ = os.Setenv("IDENTITY_ENDPOINT", srv.URL()) - _ = os.Setenv("IDENTITY_HEADER", "header") - defer clearEnvVars("IDENTITY_ENDPOINT", "IDENTITY_HEADER") + setEnvironmentVariables(t, map[string]string{identityEndpoint: srv.URL(), identityHeader: "header"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -199,13 +232,10 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_windows(t * } func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_linux(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(appServiceLinuxSuccessResp))) - _ = os.Setenv("IDENTITY_ENDPOINT", srv.URL()) - _ = os.Setenv("IDENTITY_HEADER", "header") - defer clearEnvVars("IDENTITY_ENDPOINT", "IDENTITY_HEADER") + setEnvironmentVariables(t, map[string]string{identityEndpoint: srv.URL(), identityHeader: "header"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -227,16 +257,11 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_linux(t *te // Azure Functions on linux environments currently doesn't properly support the identity header, // therefore, preference must be given to the legacy MSI_ENDPOINT variable. func TestManagedIdentityCredential_GetTokenInAzureFunctions_linux(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(appServiceWindowsSuccessResp))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") - _ = os.Setenv("IDENTITY_ENDPOINT", srv.URL()) - _ = os.Setenv("IDENTITY_HEADER", "header") - defer clearEnvVars("IDENTITY_ENDPOINT", "IDENTITY_HEADER") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "secret"}) + setEnvironmentVariables(t, map[string]string{identityEndpoint: srv.URL(), identityHeader: "header"}) msiCred, err := NewManagedIdentityCredential(&ManagedIdentityCredentialOptions{ClientOptions: azcore.ClientOptions{Transport: srv}}) if err != nil { t.Fatalf("unexpected error: %v", err) @@ -256,9 +281,7 @@ func TestManagedIdentityCredential_GetTokenInAzureFunctions_linux(t *testing.T) func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20190801(t *testing.T) { // setting a dummy value for MSI_ENDPOINT in order to be able to get a ManagedIdentityCredential type in order // to test App Service authentication request creation. - _ = os.Setenv("IDENTITY_ENDPOINT", "somevalue") - _ = os.Setenv("IDENTITY_HEADER", "header") - defer clearEnvVars("IDENTITY_ENDPOINT", "IDENTITY_HEADER") + setEnvironmentVariables(t, map[string]string{identityEndpoint: "somevalue", identityHeader: "header"}) cred, err := NewManagedIdentityCredential(nil) if err != nil { t.Fatalf("unexpected error: %v", err) @@ -289,9 +312,7 @@ func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20190801(t *testi func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20170901(t *testing.T) { // setting a dummy value for MSI_ENDPOINT in order to be able to get a ManagedIdentityCredential type in order // to test App Service authentication request creation. - _ = os.Setenv("MSI_ENDPOINT", "somevalue") - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + setEnvironmentVariables(t, map[string]string{msiEndpoint: "somevalue", msiSecret: "secret"}) cred, err := NewManagedIdentityCredential(nil) if err != nil { t.Fatalf("unexpected error: %v", err) @@ -320,13 +341,10 @@ func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20170901(t *testi } func TestManagedIdentityCredential_CreateAccessTokenExpiresOnStringInt(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(expiresOnIntResp))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "secret"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -340,13 +358,10 @@ func TestManagedIdentityCredential_CreateAccessTokenExpiresOnStringInt(t *testin } func TestManagedIdentityCredential_GetTokenInAppServiceMockFail(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithStatusCode(http.StatusUnauthorized)) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "secret"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -360,7 +375,6 @@ func TestManagedIdentityCredential_GetTokenInAppServiceMockFail(t *testing.T) { } func TestManagedIdentityCredential_GetTokenIMDS400(t *testing.T) { - resetEnvironmentVarsForTest() options := ManagedIdentityCredentialOptions{} res1 := http.Response{ StatusCode: http.StatusBadRequest, @@ -385,12 +399,10 @@ func TestManagedIdentityCredential_GetTokenIMDS400(t *testing.T) { } func TestManagedIdentityCredential_NewManagedIdentityCredentialFail(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithStatusCode(http.StatusUnauthorized)) - _ = os.Setenv("MSI_ENDPOINT", "https://t .com") - defer clearEnvVars("MSI_ENDPOINT") + setEnvironmentVariables(t, map[string]string{msiEndpoint: "https://t .com"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv cred, err := NewManagedIdentityCredential(&options) @@ -404,12 +416,10 @@ func TestManagedIdentityCredential_NewManagedIdentityCredentialFail(t *testing.T } func TestManagedIdentityCredential_GetTokenUnexpectedJSON(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(accessTokenRespMalformed))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - defer clearEnvVars("MSI_ENDPOINT") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL()}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -425,8 +435,7 @@ func TestManagedIdentityCredential_GetTokenUnexpectedJSON(t *testing.T) { func TestManagedIdentityCredential_CreateIMDSAuthRequest(t *testing.T) { // setting a dummy value for MSI_ENDPOINT in order to be able to get a ManagedIdentityCredential type in order // to test IMDS authentication request creation. - _ = os.Setenv("MSI_ENDPOINT", "somevalue") - defer clearEnvVars("MSI_ENDPOINT") + setEnvironmentVariables(t, map[string]string{msiEndpoint: "somevalue", msiSecret: "secret"}) cred, err := NewManagedIdentityCredential(nil) if err != nil { t.Fatalf("unexpected error: %v", err) @@ -461,16 +470,10 @@ func TestManagedIdentityCredential_CreateIMDSAuthRequest(t *testing.T) { } func TestManagedIdentityCredential_GetTokenEnvVar(t *testing.T) { - resetEnvironmentVarsForTest() - err := os.Setenv("AZURE_CLIENT_ID", "test_client_id") - if err != nil { - t.Fatal(err) - } srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(accessTokenRespSuccess))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - defer clearEnvVars("MSI_ENDPOINT") + setEnvironmentVariables(t, map[string]string{"AZURE_CLIENT_ID": "test_client_id", msiEndpoint: srv.URL(), msiSecret: "secret"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -487,12 +490,10 @@ func TestManagedIdentityCredential_GetTokenEnvVar(t *testing.T) { } func TestManagedIdentityCredential_GetTokenNilResource(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithStatusCode(http.StatusUnauthorized)) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - defer clearEnvVars("MSI_ENDPOINT") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL()}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -509,12 +510,10 @@ func TestManagedIdentityCredential_GetTokenNilResource(t *testing.T) { } func TestManagedIdentityCredential_ScopesImmutable(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(expiresOnIntResp))) - _ = os.Setenv(msiEndpoint, srv.URL()) - defer clearEnvVars(msiEndpoint) + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL()}) options := ManagedIdentityCredentialOptions{ClientOptions: azcore.ClientOptions{Transport: srv}} cred, err := NewManagedIdentityCredential(&options) if err != nil { @@ -532,12 +531,10 @@ func TestManagedIdentityCredential_ScopesImmutable(t *testing.T) { } func TestManagedIdentityCredential_GetTokenMultipleResources(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithStatusCode(http.StatusUnauthorized)) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - defer clearEnvVars("MSI_ENDPOINT") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL()}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -554,13 +551,10 @@ func TestManagedIdentityCredential_GetTokenMultipleResources(t *testing.T) { } func TestManagedIdentityCredential_UseResourceID(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(appServiceWindowsSuccessResp))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "secret"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv options.ID = ResourceID("sample/resource/id") @@ -578,11 +572,7 @@ func TestManagedIdentityCredential_UseResourceID(t *testing.T) { } func TestManagedIdentityCredential_ResourceID_AppService(t *testing.T) { - // setting a dummy value for IDENTITY_ENDPOINT in order to be able to get a ManagedIdentityCredential type in order - // to test App Service authentication request creation. - _ = os.Setenv("IDENTITY_ENDPOINT", "somevalue") - _ = os.Setenv("IDENTITY_HEADER", "header") - defer clearEnvVars("IDENTITY_ENDPOINT", "IDENTITY_HEADER") + setEnvironmentVariables(t, map[string]string{identityEndpoint: "somevalue", identityHeader: "header"}) resID := "sample/resource/id" cred, err := NewManagedIdentityCredential(&ManagedIdentityCredentialOptions{ID: ResourceID(resID)}) if err != nil { @@ -613,8 +603,7 @@ func TestManagedIdentityCredential_ResourceID_AppService(t *testing.T) { func TestManagedIdentityCredential_ResourceID_IMDS(t *testing.T) { // setting a dummy value for MSI_ENDPOINT in order to avoid failure in the constructor - _ = os.Setenv("MSI_ENDPOINT", "http://foo.com/") - defer clearEnvVars("MSI_ENDPOINT") + setEnvironmentVariables(t, map[string]string{msiEndpoint: "http://foo.com"}) resID := "sample/resource/id" cred, err := NewManagedIdentityCredential(&ManagedIdentityCredentialOptions{ID: ResourceID(resID)}) if err != nil { @@ -642,13 +631,10 @@ func TestManagedIdentityCredential_ResourceID_IMDS(t *testing.T) { } func TestManagedIdentityCredential_CreateAccessTokenExpiresOnInt(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(expiresOnNonStringIntResp))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "secret"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) @@ -663,13 +649,10 @@ func TestManagedIdentityCredential_CreateAccessTokenExpiresOnInt(t *testing.T) { // adding an incorrect string value in expires_on func TestManagedIdentityCredential_CreateAccessTokenExpiresOnFail(t *testing.T) { - resetEnvironmentVarsForTest() srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(`{"access_token": "new_token", "refresh_token": "", "expires_in": "", "expires_on": "15609740s28", "not_before": "1560970130", "resource": "https://vault.azure.net", "token_type": "Bearer"}`))) - _ = os.Setenv("MSI_ENDPOINT", srv.URL()) - _ = os.Setenv("MSI_SECRET", "secret") - defer clearEnvVars("MSI_ENDPOINT", "MSI_SECRET") + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "secret"}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) From 9944fdb4a6380f8c0c2872e3c85198ac500614ae Mon Sep 17 00:00:00 2001 From: Ben Broderick Phillips Date: Fri, 7 Jan 2022 14:40:38 -0500 Subject: [PATCH 20/36] Rename armmanagedapplications ci.yml files to avoid pipeline name definition collisions (#16770) --- .../resources/armmanagedapplications/{ci.yml => ci.resources.yml} | 0 .../solutions/armmanagedapplications/{ci.yml => ci.solutions.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename sdk/resourcemanager/resources/armmanagedapplications/{ci.yml => ci.resources.yml} (100%) rename sdk/resourcemanager/solutions/armmanagedapplications/{ci.yml => ci.solutions.yml} (100%) diff --git a/sdk/resourcemanager/resources/armmanagedapplications/ci.yml b/sdk/resourcemanager/resources/armmanagedapplications/ci.resources.yml similarity index 100% rename from sdk/resourcemanager/resources/armmanagedapplications/ci.yml rename to sdk/resourcemanager/resources/armmanagedapplications/ci.resources.yml diff --git a/sdk/resourcemanager/solutions/armmanagedapplications/ci.yml b/sdk/resourcemanager/solutions/armmanagedapplications/ci.solutions.yml similarity index 100% rename from sdk/resourcemanager/solutions/armmanagedapplications/ci.yml rename to sdk/resourcemanager/solutions/armmanagedapplications/ci.solutions.yml From c2859158bc3dc2923a274e03f6d6e87e87488fc2 Mon Sep 17 00:00:00 2001 From: Charles Lowell <10964656+chlowell@users.noreply.github.com> Date: Fri, 7 Jan 2022 16:50:19 -0800 Subject: [PATCH 21/36] Refactor IMDS discovery to remove probing, stop caching failures (#16267) --- sdk/azidentity/CHANGELOG.md | 4 + sdk/azidentity/default_azure_credential.go | 2 + sdk/azidentity/logging.go | 43 ---- sdk/azidentity/managed_identity_client.go | 170 ++++++------- .../managed_identity_client_test.go | 72 +++--- sdk/azidentity/managed_identity_credential.go | 12 +- .../managed_identity_credential_test.go | 223 +++++++++++------- ...edIdentityCredential_IMDSClientIDLive.json | 38 +-- ...estManagedIdentityCredential_IMDSLive.json | 34 +-- ...IdentityCredential_IMDSResourceIDLive.json | 38 +-- 10 files changed, 277 insertions(+), 359 deletions(-) diff --git a/sdk/azidentity/CHANGELOG.md b/sdk/azidentity/CHANGELOG.md index ce5be9f15710..6afba175220e 100644 --- a/sdk/azidentity/CHANGELOG.md +++ b/sdk/azidentity/CHANGELOG.md @@ -9,6 +9,10 @@ ### Bugs Fixed ### Other Changes +* `ManagedIdentityCredential` no longer probes IMDS before requesting a token + from it. Also, an error response from IMDS no longer disables a credential + instance. Following an error, a credential instance will continue to send + requests to IMDS as necessary. ## 0.12.0 (2021-11-02) ### Breaking Changes diff --git a/sdk/azidentity/default_azure_credential.go b/sdk/azidentity/default_azure_credential.go index 5283555222c1..0d4ac8d1a8ea 100644 --- a/sdk/azidentity/default_azure_credential.go +++ b/sdk/azidentity/default_azure_credential.go @@ -6,6 +6,7 @@ package azidentity import ( "context" "errors" + "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" @@ -56,6 +57,7 @@ func NewDefaultAzureCredential(options *DefaultAzureCredentialOptions) (*Default msiCred, err := NewManagedIdentityCredential(&ManagedIdentityCredentialOptions{ClientOptions: options.ClientOptions}) if err == nil { creds = append(creds, msiCred) + msiCred.client.imdsTimeout = time.Second } else { errMsg += err.Error() } diff --git a/sdk/azidentity/logging.go b/sdk/azidentity/logging.go index 1a56f331c2b1..4689adc32bac 100644 --- a/sdk/azidentity/logging.go +++ b/sdk/azidentity/logging.go @@ -5,7 +5,6 @@ package azidentity import ( "fmt" - "os" "strings" "github.com/Azure/azure-sdk-for-go/sdk/azcore" @@ -19,30 +18,6 @@ import ( // used when obtaining credentials and the type of credential used. const EventAuthentication log.Event = "Authentication" -// log environment variables that can be used for credential types -func logEnvVars() { - if !log.Should(EventAuthentication) { - return - } - // Log available environment variables - envVars := []string{} - if envCheck := os.Getenv("AZURE_TENANT_ID"); len(envCheck) > 0 { - envVars = append(envVars, "AZURE_TENANT_ID") - } - if envCheck := os.Getenv("AZURE_CLIENT_ID"); len(envCheck) > 0 { - envVars = append(envVars, "AZURE_CLIENT_ID") - } - if envCheck := os.Getenv("AZURE_CLIENT_SECRET"); len(envCheck) > 0 { - envVars = append(envVars, "AZURE_CLIENT_SECRET") - } - if envCheck := os.Getenv(azureAuthorityHost); len(envCheck) > 0 { - envVars = append(envVars, azureAuthorityHost) - } - if len(envVars) > 0 { - log.Writef(EventAuthentication, "Azure Identity => Found the following environment variables:\n\t%s", strings.Join(envVars, ", ")) - } -} - func logGetTokenSuccess(cred azcore.TokenCredential, opts policy.TokenRequestOptions) { if !log.Should(EventAuthentication) { return @@ -56,24 +31,6 @@ func logCredentialError(credName string, err error) { log.Writef(EventAuthentication, "Azure Identity => ERROR in %s: %s", credName, err.Error()) } -func logMSIEnv(msi msiType) { - if !log.Should(EventAuthentication) { - return - } - var msg string - switch msi { - case msiTypeIMDS: - msg = "Azure Identity => Managed Identity environment: IMDS" - case msiTypeAppServiceV20170901, msiTypeCloudShell, msiTypeAppServiceV20190801: - msg = "Azure Identity => Managed Identity environment: MSI_ENDPOINT" - case msiTypeUnavailable: - msg = "Azure Identity => Managed Identity environment: Unavailable" - default: - msg = "Azure Identity => Managed Identity environment: Unknown" - } - log.Write(EventAuthentication, msg) -} - func addGetTokenFailureLogs(credName string, err error, includeStack bool) { if !log.Should(EventAuthentication) { return diff --git a/sdk/azidentity/managed_identity_client.go b/sdk/azidentity/managed_identity_client.go index fbc300b9782d..40b594de08f4 100644 --- a/sdk/azidentity/managed_identity_client.go +++ b/sdk/azidentity/managed_identity_client.go @@ -20,11 +20,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" -) - -const ( - headerMetadata = "Metadata" - imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" + "github.com/Azure/azure-sdk-for-go/sdk/internal/log" ) const ( @@ -32,6 +28,8 @@ const ( identityEndpoint = "IDENTITY_ENDPOINT" identityHeader = "IDENTITY_HEADER" identityServerThumbprint = "IDENTITY_SERVER_THUMBPRINT" + headerMetadata = "Metadata" + imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" msiEndpoint = "MSI_ENDPOINT" msiSecret = "MSI_SECRET" imdsAPIVersion = "2018-02-01" @@ -45,26 +43,22 @@ const ( type msiType int const ( - msiTypeUnknown msiType = 0 - msiTypeIMDS msiType = 1 - msiTypeAppServiceV20170901 msiType = 2 - msiTypeCloudShell msiType = 3 - msiTypeUnavailable msiType = 4 - msiTypeAppServiceV20190801 msiType = 5 - msiTypeAzureArc msiType = 6 - msiTypeServiceFabric msiType = 7 + msiTypeAppServiceV20170901 msiType = iota + msiTypeAppServiceV20190801 + msiTypeAzureArc + msiTypeCloudShell + msiTypeIMDS + msiTypeServiceFabric ) // managedIdentityClient provides the base for authenticating in managed identity environments // This type includes an runtime.Pipeline and TokenCredentialOptions. type managedIdentityClient struct { - pipeline runtime.Pipeline - imdsAPIVersion string - imdsAvailableTimeout time.Duration - msiType msiType - endpoint string - id ManagedIDKind - unavailableMessage string + pipeline runtime.Pipeline + msiType msiType + endpoint string + id ManagedIDKind + imdsTimeout time.Duration } type wrappedNumber json.Number @@ -77,8 +71,8 @@ func (n *wrappedNumber) UnmarshalJSON(b []byte) error { return json.Unmarshal(b, (*json.Number)(n)) } -// setRetryOptionDefaults sets zero-valued fields to default values appropriate for IMDS -func setRetryOptionDefaults(o *policy.RetryOptions) { +// setIMDSRetryOptionDefaults sets zero-valued fields to default values appropriate for IMDS +func setIMDSRetryOptionDefaults(o *policy.RetryOptions) { if o.MaxRetries == 0 { o.MaxRetries = 5 } @@ -111,27 +105,49 @@ func setRetryOptionDefaults(o *policy.RetryOptions) { } } -// newDefaultMSIPipeline creates a pipeline using the specified pipeline options needed -// for a Managed Identity, such as a MSI specific retry policy. -func newDefaultMSIPipeline(o ManagedIdentityCredentialOptions) runtime.Pipeline { - cp := o.ClientOptions - setRetryOptionDefaults(&cp.Retry) - return runtime.NewPipeline(component, version, runtime.PipelineOptions{}, &cp) -} - // newManagedIdentityClient creates a new instance of the ManagedIdentityClient with the ManagedIdentityCredentialOptions // that are passed into it along with a default pipeline. // options: ManagedIdentityCredentialOptions configure policies for the pipeline and the authority host that // will be used to retrieve tokens and authenticate -func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) *managedIdentityClient { - logEnvVars() - return &managedIdentityClient{ - id: options.ID, - pipeline: newDefaultMSIPipeline(*options), // a pipeline that includes the specific requirements for MSI authentication, such as custom retry policy options - imdsAPIVersion: imdsAPIVersion, // this field will be set to whatever value exists in the constant and is used when creating requests to IMDS - imdsAvailableTimeout: 500 * time.Millisecond, // we allow a timeout of 500 ms since the endpoint might be slow to respond - msiType: msiTypeUnknown, // when creating a new managedIdentityClient, the current MSI type is unknown and will be tested for and replaced once authenticate() is called from GetToken on the credential side +func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*managedIdentityClient, error) { + if options == nil { + options = &ManagedIdentityCredentialOptions{} + } + cp := options.ClientOptions + c := managedIdentityClient{id: options.ID, endpoint: imdsEndpoint, msiType: msiTypeIMDS} + env := "IMDS" + if endpoint, ok := os.LookupEnv(msiEndpoint); ok { + if _, ok := os.LookupEnv(msiSecret); ok { + env = "App Service" + c.endpoint = endpoint + c.msiType = msiTypeAppServiceV20170901 + } else { + env = "Cloud Shell" + c.endpoint = endpoint + c.msiType = msiTypeCloudShell + } + } else if endpoint, ok := os.LookupEnv(identityEndpoint); ok { + if _, ok := os.LookupEnv(identityHeader); ok { + if _, ok := os.LookupEnv(identityServerThumbprint); ok { + env = "Service Fabric" + c.endpoint = endpoint + c.msiType = msiTypeServiceFabric + } + } else if _, ok := os.LookupEnv(arcIMDSEndpoint); ok { + env = "Azure Arc" + c.endpoint = endpoint + c.msiType = msiTypeAzureArc + } + } else { + setIMDSRetryOptionDefaults(&cp.Retry) + } + c.pipeline = runtime.NewPipeline(component, version, runtime.PipelineOptions{}, &cp) + + if log.Should(EventAuthentication) { + log.Writef(EventAuthentication, "Azure Identity => Managed Identity Credential will use %s managed identity", env) } + + return &c, nil } // authenticate creates an authentication request for a Managed Identity and returns the resulting Access Token if successful. @@ -139,8 +155,10 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) *manage // clientID: The client (application) ID of the service principal. // scopes: The scopes required for the token. func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKind, scopes []string) (*azcore.AccessToken, error) { - if len(c.unavailableMessage) > 0 { - return nil, newCredentialUnavailableError("Managed Identity Credential", c.unavailableMessage) + var cancel context.CancelFunc + if c.imdsTimeout > 0 && c.msiType == msiTypeIMDS { + ctx, cancel = context.WithTimeout(ctx, c.imdsTimeout) + defer cancel() } msg, err := c.createAuthRequest(ctx, id, scopes) @@ -150,9 +168,15 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi resp, err := c.pipeline.Do(msg) if err != nil { - return nil, err + if cancel != nil && errors.Is(err, context.DeadlineExceeded) { + return nil, newCredentialUnavailableError("Managed Identity Credential", "IMDS token request timed out") + } + return nil, newAuthenticationFailedError(err, nil) } + // got a response, remove the IMDS timeout so future requests use the transport's configuration + c.imdsTimeout = 0 + if runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return c.createAccessToken(resp) } @@ -161,8 +185,7 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi if id != nil { return nil, newAuthenticationFailedError(errors.New("the requested identity isn't assigned to this resource"), resp) } - c.unavailableMessage = "No default identity is assigned to this resource." - return nil, newCredentialUnavailableError("Managed Identity Credential", c.unavailableMessage) + return nil, newCredentialUnavailableError("Managed Identity Credential", "no default identity is assigned to this resource") } return nil, newAuthenticationFailedError(errors.New("authentication failed"), resp) @@ -229,15 +252,7 @@ func (c *managedIdentityClient) createAuthRequest(ctx context.Context, id Manage case msiTypeCloudShell: return c.createCloudShellAuthRequest(ctx, id, scopes) default: - errorMsg := "" - switch c.msiType { - case msiTypeUnavailable: - errorMsg = "unavailable" - default: - errorMsg = "unknown" - } - c.unavailableMessage = "managed identity support is " + errorMsg - return nil, newCredentialUnavailableError("Managed Identity Credential", c.unavailableMessage) + return nil, newCredentialUnavailableError("Managed Identity Credential", "managed identity isn't supported in this environment") } } @@ -248,7 +263,7 @@ func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id Ma } request.Raw().Header.Set(headerMetadata, "true") q := request.Raw().URL.Query() - q.Add("api-version", c.imdsAPIVersion) + q.Add("api-version", imdsAPIVersion) q.Add("resource", strings.Join(scopes, " ")) if id != nil { if id.idKind() == miResourceID { @@ -383,52 +398,3 @@ func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, } return request, nil } - -func (c *managedIdentityClient) getMSIType() (msiType, error) { - if c.msiType == msiTypeUnknown { // if we haven't already determined the msiType - if endpointEnvVar := os.Getenv(msiEndpoint); endpointEnvVar != "" { // if the env var MSI_ENDPOINT is set - c.endpoint = endpointEnvVar - if secretEnvVar := os.Getenv(msiSecret); secretEnvVar != "" { // if BOTH the env vars MSI_ENDPOINT and MSI_SECRET are set the msiType is AppService - c.msiType = msiTypeAppServiceV20170901 - } else { // if ONLY the env var MSI_ENDPOINT is set the msiType is CloudShell - c.msiType = msiTypeCloudShell - } - } else if endpointEnvVar := os.Getenv(identityEndpoint); endpointEnvVar != "" { // check for IDENTITY_ENDPOINT - c.endpoint = endpointEnvVar - if header := os.Getenv(identityHeader); header != "" { // if BOTH the env vars IDENTITY_ENDPOINT and IDENTITY_HEADER are set the msiType is AppService - c.msiType = msiTypeAppServiceV20190801 - if thumbprint := os.Getenv(identityServerThumbprint); thumbprint != "" { // if IDENTITY_SERVER_THUMBPRINT is set the environment is Service Fabric - c.msiType = msiTypeServiceFabric - } - } else if arcIMDS := os.Getenv(arcIMDSEndpoint); arcIMDS != "" { - c.msiType = msiTypeAzureArc - } else { - c.msiType = msiTypeUnavailable - return c.msiType, newCredentialUnavailableError("Managed Identity Credential", "this environment is not supported") - } - } else if c.imdsAvailable() { // if MSI_ENDPOINT is NOT set AND the IMDS endpoint is available the msiType is IMDS. This will timeout after 500 milliseconds - c.endpoint = imdsEndpoint - c.msiType = msiTypeIMDS - } else { // if MSI_ENDPOINT is NOT set and IMDS endpoint is not available Managed Identity is not available - c.msiType = msiTypeUnavailable - return c.msiType, newCredentialUnavailableError("Managed Identity Credential", "no managed identity endpoint is available") - } - } - return c.msiType, nil -} - -// performs an I/O request that has a timeout of 500 milliseconds -func (c *managedIdentityClient) imdsAvailable() bool { - tempCtx, cancel := context.WithTimeout(context.Background(), c.imdsAvailableTimeout) - defer cancel() - // this should never fail - request, _ := runtime.NewRequest(tempCtx, http.MethodGet, imdsEndpoint) - q := request.Raw().URL.Query() - q.Add("api-version", c.imdsAPIVersion) - request.Raw().URL.RawQuery = q.Encode() - resp, err := c.pipeline.Do(request) - if err == nil { - runtime.Drain(resp) - } - return err == nil -} diff --git a/sdk/azidentity/managed_identity_client_test.go b/sdk/azidentity/managed_identity_client_test.go index 95a80a3697ed..24e5c9be863d 100644 --- a/sdk/azidentity/managed_identity_client_test.go +++ b/sdk/azidentity/managed_identity_client_test.go @@ -11,10 +11,26 @@ import ( "testing" "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/internal/mock" ) +type userAgentValidatingPolicy struct { + t *testing.T + appID string +} + +func (p userAgentValidatingPolicy) Do(req *policy.Request) (*http.Response, error) { + expected := "azsdk-go-" + component + "/" + version + if p.appID != "" { + expected = p.appID + " " + expected + } + if ua := req.Raw().Header.Get("User-Agent"); !strings.HasPrefix(ua, expected) { + p.t.Fatalf("unexpected User-Agent %s", ua) + } + return req.Next() +} + func TestIMDSEndpointParse(t *testing.T) { _, err := url.Parse(imdsEndpoint) if err != nil { @@ -22,48 +38,50 @@ func TestIMDSEndpointParse(t *testing.T) { } } -func TestMSITelemetryDefaultUserAgent(t *testing.T) { +func TestManagedIdentityClient_UserAgent(t *testing.T) { srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(accessTokenRespSuccess))) - options := ManagedIdentityCredentialOptions{ClientOptions: azcore.ClientOptions{Transport: srv}} - pipeline := newDefaultMSIPipeline(options) - req, err := runtime.NewRequest(context.Background(), http.MethodGet, srv.URL()) - if err != nil { - t.Fatalf("Unexpected error: %v", err) + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "..."}) + options := ManagedIdentityCredentialOptions{ + ClientOptions: azcore.ClientOptions{ + Transport: srv, PerCallPolicies: []policy.Policy{userAgentValidatingPolicy{t: t}}, + }, } - resp, err := pipeline.Do(req) + client, err := newManagedIdentityClient(&options) if err != nil { - t.Fatalf("Unexpected error: %v", err) + t.Fatal(err) } - if resp.StatusCode != http.StatusOK { - t.Fatalf("unexpected status code: %d", resp.StatusCode) + _, err = client.authenticate(context.Background(), nil, []string{liveTestScope}) + if err != nil { + t.Fatal(err) } - if ua := resp.Request.Header.Get("User-Agent"); !strings.HasPrefix(ua, "azsdk-go-"+component+"/"+version) { - t.Fatalf("unexpected User-Agent %s", ua) + if count := srv.Requests(); count != 1 { + t.Fatalf("expected 1 token request, got %d", count) } } -func TestMSITelemetryCustom(t *testing.T) { - customTelemetry := "customvalue" +func TestManagedIdentityClient_ApplicationID(t *testing.T) { srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(accessTokenRespSuccess))) - options := ManagedIdentityCredentialOptions{ClientOptions: azcore.ClientOptions{Transport: srv}} - options.Telemetry.ApplicationID = customTelemetry - pipeline := newDefaultMSIPipeline(options) - req, err := runtime.NewRequest(context.Background(), http.MethodGet, srv.URL()) - if err != nil { - t.Fatalf("Unexpected error: %v", err) + setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL(), msiSecret: "..."}) + appID := "customvalue" + options := ManagedIdentityCredentialOptions{ + ClientOptions: azcore.ClientOptions{ + Transport: srv, PerCallPolicies: []policy.Policy{userAgentValidatingPolicy{t: t, appID: appID}}, + }, } - resp, err := pipeline.Do(req) + options.Telemetry.ApplicationID = appID + client, err := newManagedIdentityClient(&options) if err != nil { - t.Fatalf("Unexpected error: %v", err) + t.Fatal(err) } - if resp.StatusCode != http.StatusOK { - t.Fatalf("unexpected status code: %d", resp.StatusCode) + _, err = client.authenticate(context.Background(), nil, []string{liveTestScope}) + if err != nil { + t.Fatal(err) } - if ua := resp.Request.Header.Get("User-Agent"); !strings.HasPrefix(ua, customTelemetry+" "+"azsdk-go-"+component+"/"+version) { - t.Fatalf("unexpected User-Agent %s", ua) + if count := srv.Requests(); count != 1 { + t.Fatalf("expected 1 token request, got %d", count) } } diff --git a/sdk/azidentity/managed_identity_credential.go b/sdk/azidentity/managed_identity_credential.go index 70fe3b636d64..45de47b7cf7b 100644 --- a/sdk/azidentity/managed_identity_credential.go +++ b/sdk/azidentity/managed_identity_credential.go @@ -75,13 +75,11 @@ func NewManagedIdentityCredential(options *ManagedIdentityCredentialOptions) (*M if options == nil { options = &ManagedIdentityCredentialOptions{} } - client := newManagedIdentityClient(options) - msiType, err := client.getMSIType() + client, err := newManagedIdentityClient(options) if err != nil { logCredentialError("Managed Identity Credential", err) return nil, err } - client.msiType = msiType return &ManagedIdentityCredential{id: options.ID, client: client}, nil } @@ -89,13 +87,8 @@ func NewManagedIdentityCredential(options *ManagedIdentityCredentialOptions) (*M // ctx: Context used to control the request lifetime. // opts: Options for the token request, in particular the desired scope of the access token. func (c *ManagedIdentityCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (*azcore.AccessToken, error) { - if opts.Scopes == nil { - err := errors.New("must specify a resource in order to authenticate") - addGetTokenFailureLogs("Managed Identity Credential", err, true) - return nil, err - } if len(opts.Scopes) != 1 { - err := errors.New("can only specify one resource to authenticate with ManagedIdentityCredential") + err := errors.New("ManagedIdentityCredential.GetToken() requires exactly one scope") addGetTokenFailureLogs("Managed Identity Credential", err, true) return nil, err } @@ -107,7 +100,6 @@ func (c *ManagedIdentityCredential) GetToken(ctx context.Context, opts policy.To return nil, err } logGetTokenSuccess(c, opts) - logMSIEnv(c.client.msiType) return tk, err } diff --git a/sdk/azidentity/managed_identity_credential_test.go b/sdk/azidentity/managed_identity_credential_test.go index 6d0a85d2c33a..4bd2609167b7 100644 --- a/sdk/azidentity/managed_identity_credential_test.go +++ b/sdk/azidentity/managed_identity_credential_test.go @@ -23,16 +23,16 @@ import ( ) const ( - msiScope = "https://storage.azure.com" appServiceWindowsSuccessResp = `{"access_token": "new_token", "expires_on": "9/14/2017 00:00:00 PM +00:00", "resource": "https://vault.azure.net", "token_type": "Bearer"}` appServiceLinuxSuccessResp = `{"access_token": "new_token", "expires_on": "09/14/2017 00:00:00 +00:00", "resource": "https://vault.azure.net", "token_type": "Bearer"}` expiresOnIntResp = `{"access_token": "new_token", "refresh_token": "", "expires_in": "", "expires_on": "1560974028", "not_before": "1560970130", "resource": "https://vault.azure.net", "token_type": "Bearer"}` expiresOnNonStringIntResp = `{"access_token": "new_token", "refresh_token": "", "expires_in": "", "expires_on": 1560974028, "not_before": "1560970130", "resource": "https://vault.azure.net", "token_type": "Bearer"}` ) +// TODO: replace with 1.17's T.Setenv func clearEnvVars(envVars ...string) { for _, ev := range envVars { - _ = os.Setenv(ev, "") + _ = os.Unsetenv(ev) } } @@ -55,6 +55,16 @@ func (m *mockIMDS) Do(req *http.Request) (*http.Response, error) { panic("no more responses") } +// delayPolicy adds a delay to pipeline requests. Used to test timeout behavior. +type delayPolicy struct { + delay time.Duration +} + +func (p delayPolicy) Do(req *policy.Request) (resp *http.Response, err error) { + time.Sleep(p.delay) + return req.Next() +} + func TestManagedIdentityCredential_AzureArc(t *testing.T) { file, err := os.Create(filepath.Join(t.TempDir(), "arc.key")) if err != nil { @@ -173,7 +183,7 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20170901Mock_windows(t * if err != nil { t.Fatalf("unexpected error: %v", err) } - tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatalf("Received an error when attempting to retrieve a token") } @@ -196,7 +206,7 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20170901Mock_linux(t *te if err != nil { t.Fatalf("unexpected error: %v", err) } - tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatalf("Received an error when attempting to retrieve a token") } @@ -209,6 +219,7 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20170901Mock_linux(t *te } func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_windows(t *testing.T) { + t.Skip("App Service 2019-08-01 isn't supported because it's unavailable in some Functions apps.") srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(appServiceWindowsSuccessResp))) @@ -219,7 +230,7 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_windows(t * if err != nil { t.Fatalf("unexpected error: %v", err) } - tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatalf("Received an error when attempting to retrieve a token") } @@ -232,6 +243,7 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_windows(t * } func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_linux(t *testing.T) { + t.Skip("App Service 2019-08-01 isn't supported because it's unavailable in some Functions apps.") srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithBody([]byte(appServiceLinuxSuccessResp))) @@ -242,7 +254,7 @@ func TestManagedIdentityCredential_GetTokenInAppServiceV20190801Mock_linux(t *te if err != nil { t.Fatalf("unexpected error: %v", err) } - tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatalf("Received an error when attempting to retrieve a token") } @@ -266,7 +278,7 @@ func TestManagedIdentityCredential_GetTokenInAzureFunctions_linux(t *testing.T) if err != nil { t.Fatalf("unexpected error: %v", err) } - tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatalf("Received an error when attempting to retrieve a token") } @@ -279,6 +291,7 @@ func TestManagedIdentityCredential_GetTokenInAzureFunctions_linux(t *testing.T) } func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20190801(t *testing.T) { + t.Skip("App Service 2019-08-01 isn't supported because it's unavailable in some Functions apps.") // setting a dummy value for MSI_ENDPOINT in order to be able to get a ManagedIdentityCredential type in order // to test App Service authentication request creation. setEnvironmentVariables(t, map[string]string{identityEndpoint: "somevalue", identityHeader: "header"}) @@ -287,7 +300,7 @@ func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20190801(t *testi t.Fatalf("unexpected error: %v", err) } cred.client.endpoint = imdsEndpoint - req, err := cred.client.createAuthRequest(context.Background(), ClientID(fakeClientID), []string{msiScope}) + req, err := cred.client.createAuthRequest(context.Background(), ClientID(fakeClientID), []string{liveTestScope}) if err != nil { t.Fatal(err) } @@ -301,7 +314,7 @@ func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20190801(t *testi if reqQueryParams["api-version"][0] != "2019-08-01" { t.Fatalf("Unexpected App Service API version") } - if reqQueryParams["resource"][0] != msiScope { + if reqQueryParams["resource"][0] != liveTestScope { t.Fatalf("Unexpected resource in resource query param") } if reqQueryParams[qpClientID][0] != fakeClientID { @@ -318,7 +331,7 @@ func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20170901(t *testi t.Fatalf("unexpected error: %v", err) } cred.client.endpoint = imdsEndpoint - req, err := cred.client.createAuthRequest(context.Background(), ClientID(fakeClientID), []string{msiScope}) + req, err := cred.client.createAuthRequest(context.Background(), ClientID(fakeClientID), []string{liveTestScope}) if err != nil { t.Fatal(err) } @@ -332,7 +345,7 @@ func TestManagedIdentityCredential_CreateAppServiceAuthRequestV20170901(t *testi if reqQueryParams["api-version"][0] != "2017-09-01" { t.Fatalf("Unexpected App Service API version") } - if reqQueryParams["resource"][0] != msiScope { + if reqQueryParams["resource"][0] != liveTestScope { t.Fatalf("Unexpected resource in resource query param") } if reqQueryParams["clientid"][0] != fakeClientID { @@ -351,7 +364,7 @@ func TestManagedIdentityCredential_CreateAccessTokenExpiresOnStringInt(t *testin if err != nil { t.Fatalf("unexpected error: %v", err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatalf("Received an error when attempting to retrieve a token") } @@ -368,32 +381,26 @@ func TestManagedIdentityCredential_GetTokenInAppServiceMockFail(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err == nil { t.Fatalf("Expected an error but did not receive one") } } func TestManagedIdentityCredential_GetTokenIMDS400(t *testing.T) { + res := http.Response{StatusCode: http.StatusBadRequest, Body: io.NopCloser(bytes.NewBufferString(""))} options := ManagedIdentityCredentialOptions{} - res1 := http.Response{ - StatusCode: http.StatusBadRequest, - Header: http.Header{}, - Body: io.NopCloser(bytes.NewBufferString("")), - } - res2 := res1 - options.Transport = newMockImds(res1, res2) + options.Transport = newMockImds(res, res, res) cred, err := NewManagedIdentityCredential(&options) if err != nil { - t.Fatalf("unexpected error: %v", err) + t.Fatal(err) } - // cred should return CredentialUnavailableError when IMDS responds 400 to a token request. - // Also, it shouldn't send another token request (mockIMDS will appropriately panic if it does). + // cred should return CredentialUnavailableError when IMDS responds 400 to a token request var expected CredentialUnavailableError for i := 0; i < 3; i++ { - _, err = cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + _, err = cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if !errors.As(err, &expected) { - t.Fatalf("Expected %T, got %T", expected, err) + t.Fatalf(`expected CredentialUnavailableError, got %T: "%s"`, err, err.Error()) } } } @@ -426,7 +433,7 @@ func TestManagedIdentityCredential_GetTokenUnexpectedJSON(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err == nil { t.Fatalf("Expected a JSON marshal error but received nil") } @@ -441,7 +448,7 @@ func TestManagedIdentityCredential_CreateIMDSAuthRequest(t *testing.T) { t.Fatalf("unexpected error: %v", err) } cred.client.endpoint = imdsEndpoint - req, err := cred.client.createIMDSAuthRequest(context.Background(), ClientID(fakeClientID), []string{msiScope}) + req, err := cred.client.createIMDSAuthRequest(context.Background(), ClientID(fakeClientID), []string{liveTestScope}) if err != nil { t.Fatal(err) } @@ -455,7 +462,7 @@ func TestManagedIdentityCredential_CreateIMDSAuthRequest(t *testing.T) { if reqQueryParams["api-version"][0] != imdsAPIVersion { t.Fatalf("Unexpected IMDS API version") } - if reqQueryParams["resource"][0] != msiScope { + if reqQueryParams["resource"][0] != liveTestScope { t.Fatalf("Unexpected resource in resource query param") } if reqQueryParams["client_id"][0] != fakeClientID { @@ -469,43 +476,24 @@ func TestManagedIdentityCredential_CreateIMDSAuthRequest(t *testing.T) { } } -func TestManagedIdentityCredential_GetTokenEnvVar(t *testing.T) { - srv, close := mock.NewServer() - defer close() - srv.AppendResponse(mock.WithBody([]byte(accessTokenRespSuccess))) - setEnvironmentVariables(t, map[string]string{"AZURE_CLIENT_ID": "test_client_id", msiEndpoint: srv.URL(), msiSecret: "secret"}) - options := ManagedIdentityCredentialOptions{} - options.Transport = srv - msiCred, err := NewManagedIdentityCredential(&options) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - at, err := msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) - if err != nil { - t.Fatalf("Received an error when attempting to retrieve a token") - } - if at.Token != "new_token" { - t.Fatalf("Did not receive the correct access token") - } -} - -func TestManagedIdentityCredential_GetTokenNilResource(t *testing.T) { +func TestManagedIdentityCredential_GetTokenScopes(t *testing.T) { srv, close := mock.NewServer() defer close() srv.AppendResponse(mock.WithStatusCode(http.StatusUnauthorized)) - setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL()}) options := ManagedIdentityCredentialOptions{} options.Transport = srv msiCred, err := NewManagedIdentityCredential(&options) if err != nil { - t.Fatalf("unexpected error: %v", err) - } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: nil}) - if err == nil { - t.Fatalf("Expected an error but did not receive one") + t.Fatal(err) } - if err.Error() != "must specify a resource in order to authenticate" { - t.Fatalf("unexpected error: %v", err) + for _, scopes := range [][]string{nil, {}, {"a", "b"}} { + _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: scopes}) + if err == nil { + t.Fatal("expected an error") + } + if !strings.Contains(err.Error(), "scope") { + t.Fatalf(`unexpected error "%s"`, err.Error()) + } } } @@ -530,26 +518,6 @@ func TestManagedIdentityCredential_ScopesImmutable(t *testing.T) { } } -func TestManagedIdentityCredential_GetTokenMultipleResources(t *testing.T) { - srv, close := mock.NewServer() - defer close() - srv.AppendResponse(mock.WithStatusCode(http.StatusUnauthorized)) - setEnvironmentVariables(t, map[string]string{msiEndpoint: srv.URL()}) - options := ManagedIdentityCredentialOptions{} - options.Transport = srv - msiCred, err := NewManagedIdentityCredential(&options) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{"resource1", "resource2"}}) - if err == nil { - t.Fatalf("Expected an error but did not receive one") - } - if err.Error() != "can only specify one resource to authenticate with ManagedIdentityCredential" { - t.Fatalf("unexpected error: %v", err) - } -} - func TestManagedIdentityCredential_UseResourceID(t *testing.T) { srv, close := mock.NewServer() defer close() @@ -562,7 +530,7 @@ func TestManagedIdentityCredential_UseResourceID(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatal(err) } @@ -571,7 +539,8 @@ func TestManagedIdentityCredential_UseResourceID(t *testing.T) { } } -func TestManagedIdentityCredential_ResourceID_AppService(t *testing.T) { +func TestManagedIdentityCredential_ResourceID_AppServiceV20190801(t *testing.T) { + t.Skip("App Service 2019-08-01 isn't supported because it's unavailable in some Functions apps.") setEnvironmentVariables(t, map[string]string{identityEndpoint: "somevalue", identityHeader: "header"}) resID := "sample/resource/id" cred, err := NewManagedIdentityCredential(&ManagedIdentityCredentialOptions{ID: ResourceID(resID)}) @@ -579,7 +548,7 @@ func TestManagedIdentityCredential_ResourceID_AppService(t *testing.T) { t.Fatalf("unexpected error: %v", err) } cred.client.endpoint = imdsEndpoint - req, err := cred.client.createAuthRequest(context.Background(), cred.id, []string{msiScope}) + req, err := cred.client.createAuthRequest(context.Background(), cred.id, []string{liveTestScope}) if err != nil { t.Fatal(err) } @@ -593,7 +562,7 @@ func TestManagedIdentityCredential_ResourceID_AppService(t *testing.T) { if reqQueryParams["api-version"][0] != "2019-08-01" { t.Fatalf("Unexpected App Service API version") } - if reqQueryParams["resource"][0] != msiScope { + if reqQueryParams["resource"][0] != liveTestScope { t.Fatalf("Unexpected resource in resource query param") } if reqQueryParams[qpResID][0] != resID { @@ -603,7 +572,7 @@ func TestManagedIdentityCredential_ResourceID_AppService(t *testing.T) { func TestManagedIdentityCredential_ResourceID_IMDS(t *testing.T) { // setting a dummy value for MSI_ENDPOINT in order to avoid failure in the constructor - setEnvironmentVariables(t, map[string]string{msiEndpoint: "http://foo.com"}) + setEnvironmentVariables(t, map[string]string{msiEndpoint: "http://localhost"}) resID := "sample/resource/id" cred, err := NewManagedIdentityCredential(&ManagedIdentityCredentialOptions{ID: ResourceID(resID)}) if err != nil { @@ -611,7 +580,7 @@ func TestManagedIdentityCredential_ResourceID_IMDS(t *testing.T) { } cred.client.msiType = msiTypeIMDS cred.client.endpoint = imdsEndpoint - req, err := cred.client.createAuthRequest(context.Background(), cred.id, []string{msiScope}) + req, err := cred.client.createAuthRequest(context.Background(), cred.id, []string{liveTestScope}) if err != nil { t.Fatal(err) } @@ -622,7 +591,7 @@ func TestManagedIdentityCredential_ResourceID_IMDS(t *testing.T) { if reqQueryParams["api-version"][0] != "2018-02-01" { t.Fatalf("Unexpected App Service API version") } - if reqQueryParams["resource"][0] != msiScope { + if reqQueryParams["resource"][0] != liveTestScope { t.Fatalf("Unexpected resource in resource query param") } if reqQueryParams[qpResID][0] != resID { @@ -641,7 +610,7 @@ func TestManagedIdentityCredential_CreateAccessTokenExpiresOnInt(t *testing.T) { if err != nil { t.Fatalf("unexpected error: %v", err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err != nil { t.Fatalf("Received an error when attempting to retrieve a token") } @@ -659,7 +628,7 @@ func TestManagedIdentityCredential_CreateAccessTokenExpiresOnFail(t *testing.T) if err != nil { t.Fatalf("unexpected error: %v", err) } - _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{msiScope}}) + _, err = msiCred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if err == nil { t.Fatalf("expected to receive an error but received none") } @@ -749,3 +718,85 @@ func TestManagedIdentityCredential_IMDSResourceIDLive(t *testing.T) { t.Fatal("GetToken returned an invalid expiration time") } } + +func TestManagedIdentityCredential_IMDSTimeoutExceeded(t *testing.T) { + resetEnvironmentVarsForTest() + cred, err := NewManagedIdentityCredential(&ManagedIdentityCredentialOptions{ + ClientOptions: policy.ClientOptions{ + PerCallPolicies: []policy.Policy{delayPolicy{delay: time.Microsecond}}, + }, + }) + if err != nil { + t.Fatal(err) + } + cred.client.imdsTimeout = time.Nanosecond + tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) + var expected CredentialUnavailableError + if !errors.As(err, &expected) { + t.Fatalf(`expected CredentialUnavailableError, got %T: "%v"`, err, err) + } + if tk != nil { + t.Fatal("GetToken returned a token and an error") + } +} + +func TestManagedIdentityCredential_IMDSTimeoutSuccess(t *testing.T) { + resetEnvironmentVarsForTest() + res := http.Response{StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(accessTokenRespSuccess))} + options := ManagedIdentityCredentialOptions{} + options.Transport = newMockImds(res, res) + cred, err := NewManagedIdentityCredential(&options) + if err != nil { + t.Fatal(err) + } + cred.client.imdsTimeout = time.Minute + tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) + if err != nil { + t.Fatal(err) + } + if tk.Token != tokenValue { + t.Fatalf(`got unexpected token "%s"`, tk.Token) + } + if !tk.ExpiresOn.After(time.Now().UTC()) { + t.Fatal("GetToken returned an invalid expiration time") + } + if cred.client.imdsTimeout > 0 { + t.Fatal("credential didn't remove IMDS timeout after receiving a response") + } +} + +func TestManagedIdentityCredential_ServiceFabric(t *testing.T) { + resetEnvironmentVarsForTest() + expectedSecret := "expected-secret" + pred := func(req *http.Request) bool { + if secret := req.Header.Get("Secret"); secret != expectedSecret { + t.Fatalf(`unexpected Secret header "%s"`, secret) + } + if p := req.URL.Query().Get("api-version"); p != serviceFabricAPIVersion { + t.Fatalf("unexpected api-version: %s", p) + } + if p := req.URL.Query().Get("resource"); p != strings.TrimSuffix(liveTestScope, defaultSuffix) { + t.Fatalf("unexpected resource: %s", p) + } + return true + } + srv, close := mock.NewServer() + defer close() + srv.AppendResponse(mock.WithPredicate(pred), mock.WithBody([]byte(accessTokenRespSuccess))) + srv.AppendResponse() + setEnvironmentVariables(t, map[string]string{identityEndpoint: srv.URL(), identityHeader: expectedSecret, identityServerThumbprint: "..."}) + cred, err := NewManagedIdentityCredential(nil) + if err != nil { + t.Fatal(err) + } + tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) + if err != nil { + t.Fatal(err) + } + if tk.Token != tokenValue { + t.Fatalf(`got unexpected token "%s"`, tk.Token) + } + if !tk.ExpiresOn.After(time.Now().UTC()) { + t.Fatal("GetToken returned an invalid expiration time") + } +} diff --git a/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSClientIDLive.json b/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSClientIDLive.json index 670121c3e9e6..9f02518054a0 100644 --- a/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSClientIDLive.json +++ b/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSClientIDLive.json @@ -1,29 +1,5 @@ { "Entries": [ - { - "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/metadata/identity/oauth2/token?api-version=2018-02-01", - ":scheme": "https", - "Accept-Encoding": "gzip", - "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.20.0 (go1.17.3; linux)" - }, - "RequestBody": null, - "StatusCode": 400, - "ResponseHeaders": { - "Content-Length": "88", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 16 Nov 2021 17:37:54 GMT", - "Server": "IMDS/150.870.65.523" - }, - "ResponseBody": { - "error": "invalid_request", - "error_description": "Required metadata header not specified" - } - }, { "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026client_id=fake-client-id\u0026resource=https%3A%2F%2Fmanagement.core.windows.net%2F", "RequestMethod": "GET", @@ -34,23 +10,23 @@ ":scheme": "https", "Accept-Encoding": "gzip", "metadata": "true", - "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.20.0 (go1.17.3; linux)" + "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.21.0 (go1.17.3; linux)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "Content-Length": "248", + "Content-Length": "226", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 16 Nov 2021 17:37:54 GMT", + "Date": "Fri, 10 Dec 2021 23:57:32 GMT", "Server": "IMDS/150.870.65.523" }, "ResponseBody": { "access_token": "redacted", - "client_id": "b48ae5dc-70d0-488a-8ef5-f30d905cd5ec", - "expires_in": "86329", - "expires_on": "1637170604", + "client_id": "fake-client-id", + "expires_in": "84474", + "expires_on": "1639265126", "ext_expires_in": "86399", - "not_before": "1637083904", + "not_before": "1639178426", "resource": "https://management.core.windows.net/", "token_type": "Bearer" } diff --git a/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSLive.json b/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSLive.json index cc07c735178f..50837885ec31 100644 --- a/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSLive.json +++ b/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSLive.json @@ -1,29 +1,5 @@ { "Entries": [ - { - "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/metadata/identity/oauth2/token?api-version=2018-02-01", - ":scheme": "https", - "Accept-Encoding": "gzip", - "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.20.0 (go1.17.3; linux)" - }, - "RequestBody": null, - "StatusCode": 400, - "ResponseHeaders": { - "Content-Length": "88", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 16 Nov 2021 17:37:54 GMT", - "Server": "IMDS/150.870.65.523" - }, - "ResponseBody": { - "error": "invalid_request", - "error_description": "Required metadata header not specified" - } - }, { "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https%3A%2F%2Fmanagement.core.windows.net%2F", "RequestMethod": "GET", @@ -34,23 +10,23 @@ ":scheme": "https", "Accept-Encoding": "gzip", "metadata": "true", - "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.20.0 (go1.17.3; linux)" + "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.21.0 (go1.17.3; linux)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Content-Length": "248", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 16 Nov 2021 17:37:54 GMT", + "Date": "Fri, 10 Dec 2021 23:57:31 GMT", "Server": "IMDS/150.870.65.523" }, "ResponseBody": { "access_token": "redacted", "client_id": "615e6319-bf4f-4279-937c-b9eb198e511f", - "expires_in": "84513", - "expires_on": "1637168788", + "expires_in": "84473", + "expires_on": "1639265125", "ext_expires_in": "86399", - "not_before": "1637082088", + "not_before": "1639178425", "resource": "https://management.core.windows.net/", "token_type": "Bearer" } diff --git a/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSResourceIDLive.json b/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSResourceIDLive.json index e0a74cc8d789..8636ceb125bb 100644 --- a/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSResourceIDLive.json +++ b/sdk/azidentity/testdata/recordings/TestManagedIdentityCredential_IMDSResourceIDLive.json @@ -1,29 +1,5 @@ { "Entries": [ - { - "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01", - "RequestMethod": "GET", - "RequestHeaders": { - ":authority": "localhost:5001", - ":method": "GET", - ":path": "/metadata/identity/oauth2/token?api-version=2018-02-01", - ":scheme": "https", - "Accept-Encoding": "gzip", - "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.20.0 (go1.17.3; linux)" - }, - "RequestBody": null, - "StatusCode": 400, - "ResponseHeaders": { - "Content-Length": "88", - "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 16 Nov 2021 17:37:54 GMT", - "Server": "IMDS/150.870.65.523" - }, - "ResponseBody": { - "error": "invalid_request", - "error_description": "Required metadata header not specified" - } - }, { "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026mi_res_id=%2Ffake%2Fresource%2FID\u0026resource=https%3A%2F%2Fmanagement.core.windows.net%2F", "RequestMethod": "GET", @@ -34,23 +10,23 @@ ":scheme": "https", "Accept-Encoding": "gzip", "metadata": "true", - "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.20.0 (go1.17.3; linux)" + "User-Agent": "azsdk-go-azidentity/v0.12.1 azsdk-go-azcore/v0.21.0 (go1.17.3; linux)" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { - "Content-Length": "248", + "Content-Length": "226", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 16 Nov 2021 17:37:54 GMT", + "Date": "Fri, 10 Dec 2021 23:57:32 GMT", "Server": "IMDS/150.870.65.523" }, "ResponseBody": { "access_token": "redacted", - "client_id": "b48ae5dc-70d0-488a-8ef5-f30d905cd5ec", - "expires_in": "86329", - "expires_on": "1637170604", + "client_id": "fake-client-id", + "expires_in": "84474", + "expires_on": "1639265126", "ext_expires_in": "86399", - "not_before": "1637083904", + "not_before": "1639178426", "resource": "https://management.core.windows.net/", "token_type": "Bearer" } From 12851e657302ce1ea37c9cb5ca97eb98ba875c23 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Fri, 7 Jan 2022 18:48:54 -0800 Subject: [PATCH 22/36] Sync eng/common directory with azure-sdk-tools for PR 2500 (#16779) * Update pipeline generator tool feed to azure-sdk-for-net * Update pipeline generator tool version Co-authored-by: Ben Broderick Phillips --- .../pipelines/templates/steps/install-pipeline-generation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/common/pipelines/templates/steps/install-pipeline-generation.yml b/eng/common/pipelines/templates/steps/install-pipeline-generation.yml index d368d52595b3..66065be8e73e 100644 --- a/eng/common/pipelines/templates/steps/install-pipeline-generation.yml +++ b/eng/common/pipelines/templates/steps/install-pipeline-generation.yml @@ -9,8 +9,8 @@ steps: - script: > dotnet tool install Azure.Sdk.Tools.PipelineGenerator - --version 1.0.2-dev.20210621.4 - --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk/nuget/v3/index.json + --version 1.0.2-dev.20220106.2 + --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json --tool-path ${{parameters.ToolPath}} workingDirectory: $(Pipeline.Workspace)/pipeline-generator displayName: 'Install pipeline generator tool' From b2d33bdc788f1e0297bde45bbba3ac2036b1cd73 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 10 Jan 2022 10:47:54 +0800 Subject: [PATCH 23/36] feat: add generator cmd to generate or update readme.go.md file for track2 sdk param (#16780) --- eng/tools/generator/cmd/root.go | 2 + .../generator/cmd/v2/readme/readmeCmd.go | 76 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 eng/tools/generator/cmd/v2/readme/readmeCmd.go diff --git a/eng/tools/generator/cmd/root.go b/eng/tools/generator/cmd/root.go index 5ecf6fbb0580..83ad34c02cdb 100644 --- a/eng/tools/generator/cmd/root.go +++ b/eng/tools/generator/cmd/root.go @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/eng/tools/generator/cmd/release" "github.com/Azure/azure-sdk-for-go/eng/tools/generator/cmd/template" automation_v2 "github.com/Azure/azure-sdk-for-go/eng/tools/generator/cmd/v2/automation" + "github.com/Azure/azure-sdk-for-go/eng/tools/generator/cmd/v2/readme" refresh_v2 "github.com/Azure/azure-sdk-for-go/eng/tools/generator/cmd/v2/refresh" release_v2 "github.com/Azure/azure-sdk-for-go/eng/tools/generator/cmd/v2/release" "github.com/Azure/azure-sdk-for-go/eng/tools/generator/common" @@ -49,6 +50,7 @@ func Command() *cobra.Command { automation_v2.Command(), release_v2.Command(), refresh_v2.Command(), + readme.Command(), ) return rootCmd diff --git a/eng/tools/generator/cmd/v2/readme/readmeCmd.go b/eng/tools/generator/cmd/v2/readme/readmeCmd.go new file mode 100644 index 000000000000..d1d00c153dc5 --- /dev/null +++ b/eng/tools/generator/cmd/v2/readme/readmeCmd.go @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +package readme + +import ( + "errors" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "strings" + + "github.com/spf13/cobra" +) + +// Command returns the generate-go-readme command. +func Command() *cobra.Command { + cmd := &cobra.Command{ + Use: "generate-go-readme ", + Short: "Generate a go readme file or add go track2 part to go readme file according to base swagger readme file", + Args: cobra.ExactArgs(1), + PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + log.SetFlags(0) // remove the time stamp prefix + return nil + }, + RunE: func(cmd *cobra.Command, args []string) error { + if err := execute(args[0]); err != nil { + logError(err) + return err + } + return nil + }, + SilenceUsage: true, // this command is used for a pipeline, the usage should never show + } + + return cmd +} + +func execute(rpReadmeFilepath string) error { + if _, err := os.Stat(rpReadmeFilepath); errors.Is(err, os.ErrNotExist) { + return err + } + basePath := filepath.Dir(rpReadmeFilepath) + rpName := filepath.Base(filepath.Dir(basePath)) + + readmeGoFile := filepath.Join(basePath, "readme.go.md") + content := "" + if _, err := os.Stat(readmeGoFile); err == nil { + b, err := ioutil.ReadFile(readmeGoFile) + if err != nil { + return err + } + content = string(b) + } + + if !strings.Contains(content, "$(go) && $(track2)") { + content += fmt.Sprintf("\n\n``` yaml $(go) && $(track2)\nlicense-header: MICROSOFT_MIT_NO_VERSION\nmodule-name: sdk/resourcemanager/%s/arm%s\nmodule: github.com/Azure/azure-sdk-for-go/$(module-name)\noutput-folder: $(go-sdk-folder)/$(module-name)\nazure-arm: true\n```\n", rpName, rpName) + if err := ioutil.WriteFile(readmeGoFile, []byte(content), 0644); err != nil { + return err + } + } + + log.Printf("Succeed to generate readme.go.me file from '%s'...", rpReadmeFilepath) + + return nil +} + +func logError(err error) { + for _, line := range strings.Split(err.Error(), "\n") { + if l := strings.TrimSpace(line); l != "" { + log.Printf("[ERROR] %s", l) + } + } +} From fb836228c11dec7b15ef2098ae07569a0a38b1a9 Mon Sep 17 00:00:00 2001 From: Richard Park <51494936+richardpark-msft@users.noreply.github.com> Date: Mon, 10 Jan 2022 16:06:51 -0800 Subject: [PATCH 24/36] [azservicebus] Updating to handle breaking changes in azcore (#16776) Updating sb to handle breaking changes in azcore At the moment we're not using azcore's HTTP library, so we don't need to test for specific errors that come from azcore. --- sdk/messaging/azservicebus/CHANGELOG.md | 8 +----- .../azservicebus/admin/admin_client_test.go | 7 ------ .../azservicebus/admin/admin_client_topic.go | 2 +- sdk/messaging/azservicebus/go.mod | 8 ++++-- sdk/messaging/azservicebus/go.sum | 25 +++++++++++++------ .../internal/atom/entity_manager.go | 17 ------------- .../azservicebus/internal/atom/errors.go | 4 ++- .../internal/atom/manager_common_test.go | 5 ---- 8 files changed, 28 insertions(+), 48 deletions(-) diff --git a/sdk/messaging/azservicebus/CHANGELOG.md b/sdk/messaging/azservicebus/CHANGELOG.md index 832f2beba75a..a921ee4c9528 100644 --- a/sdk/messaging/azservicebus/CHANGELOG.md +++ b/sdk/messaging/azservicebus/CHANGELOG.md @@ -1,17 +1,11 @@ # Release History -## 0.3.3 (Unreleased) +## 0.3.3 (2022-01-12) ### Features Added - Support the pass-through of an Application ID when constructing an Azure Service Bus Client. -### Breaking Changes - -### Bugs Fixed - -### Other Changes - ## 0.3.2 (2021-12-08) ### Features Added diff --git a/sdk/messaging/azservicebus/admin/admin_client_test.go b/sdk/messaging/azservicebus/admin/admin_client_test.go index c063a2d46cd2..8ff788c909fe 100644 --- a/sdk/messaging/azservicebus/admin/admin_client_test.go +++ b/sdk/messaging/azservicebus/admin/admin_client_test.go @@ -5,7 +5,6 @@ package admin import ( "context" - "errors" "fmt" "net/http" "os" @@ -14,7 +13,6 @@ import ( "testing" "time" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus/internal/atom" @@ -799,11 +797,6 @@ func TestAdminClient_LackPermissions_Topic(t *testing.T) { _, err = testData.Client.DeleteTopic(ctx, testData.TopicName, nil) require.Contains(t, err.Error(), "error code: 401, Details: Authorization failed for specified action: Manage,EntityDelete.") - - // sanity check that the http response is getting bundled into these errors, should it be needed. - var httpResponse azcore.HTTPResponse - require.True(t, errors.As(err, &httpResponse)) - require.EqualValues(t, http.StatusUnauthorized, httpResponse.RawResponse().StatusCode) } func TestAdminClient_LackPermissions_Subscription(t *testing.T) { diff --git a/sdk/messaging/azservicebus/admin/admin_client_topic.go b/sdk/messaging/azservicebus/admin/admin_client_topic.go index 137e5a09924d..ae11bb9358be 100644 --- a/sdk/messaging/azservicebus/admin/admin_client_topic.go +++ b/sdk/messaging/azservicebus/admin/admin_client_topic.go @@ -131,7 +131,7 @@ func (ac *Client) GetTopic(ctx context.Context, topicName string, options *GetTo props, err := newTopicProperties(&atomResp.Content.TopicDescription) if err != nil { - return nil, atom.NewResponseError(err, resp) + return nil, err } return &GetTopicResponse{ diff --git a/sdk/messaging/azservicebus/go.mod b/sdk/messaging/azservicebus/go.mod index 628052efccb6..6ffc908f5f7f 100644 --- a/sdk/messaging/azservicebus/go.mod +++ b/sdk/messaging/azservicebus/go.mod @@ -3,8 +3,8 @@ module github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus go 1.16 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 + // github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 + // github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.2 github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.0.0-20211208010914-2b10e91d237e github.com/Azure/go-amqp v0.17.0 @@ -19,3 +19,7 @@ require ( golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect nhooyr.io/websocket v1.8.6 ) + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.1-0.20211217200426-f2d5927fe220 + +require github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.1-0.20211217202854-9673a656af22 diff --git a/sdk/messaging/azservicebus/go.sum b/sdk/messaging/azservicebus/go.sum index 1352278398fb..900631118043 100644 --- a/sdk/messaging/azservicebus/go.sum +++ b/sdk/messaging/azservicebus/go.sum @@ -1,17 +1,15 @@ code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c h1:5eeuG0BHx1+DHeT3AP+ISKZ2ht1UjGhm581ljqYpVeQ= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0/go.mod h1:GJzjM4SR9T0KyX5gKCVyz1ytD8FeWeUPCwtFCt1AyfE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.1-0.20211217200426-f2d5927fe220 h1:IJmlas1doMoLMhG5LbKdyhLI8dkjTNY5AD8VfFKGuRE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.1-0.20211217200426-f2d5927fe220/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.1-0.20211217202854-9673a656af22 h1:6Lz1iIvWRwfsx4NiKF4KfIMlmJ+BlPTBy6JsTXKiK8w= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.1-0.20211217202854-9673a656af22/go.mod h1:tfA+sP6iTxAiHcYPghAg0dNQ5qGwUc3aYal9XWVPJw4= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.2 h1:rImM7Yjz9yUgpdxp3A4cZLm1JZuo4XbtIp2LrUZnwYw= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.2/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.0.0-20211208010914-2b10e91d237e h1:9n9b/dngBY5hfevx1jmEMbGvZGCcx1zAUaeYF8dk9Co= github.com/Azure/azure-sdk-for-go/sdk/messaging/internal v0.0.0-20211208010914-2b10e91d237e/go.mod h1:7hMUlcqiMXDUJtU1EWQlhhkC4BfIr6pEsiyuRYq4xLQ= -github.com/Azure/go-amqp v0.16.0/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg= -github.com/Azure/go-amqp v0.16.5-0.20211207190606-01b4c6402182 h1:E1rCzk/cEGhcedyB0l3ImnNNRCztZq51ataskdhCno8= -github.com/Azure/go-amqp v0.16.5-0.20211207190606-01b4c6402182/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg= github.com/Azure/go-amqp v0.17.0 h1:HHXa3149nKrI0IZwyM7DRcRy5810t9ZICDutn4BYzj4= github.com/Azure/go-amqp v0.17.0/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -22,11 +20,14 @@ github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSY github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/devigned/tab v0.1.1 h1:3mD6Kb1mUOYeLpJvTVSDwSg5ZsfSxfvxGRTxRsJsITA= github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= +github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= @@ -51,6 +52,8 @@ github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= @@ -60,6 +63,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -76,6 +81,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= @@ -87,11 +94,12 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -124,6 +132,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211001092434-39dca1131b70 h1:pGleJoyD1yA5HfvuaksHxD0404gsEkNDerKsQ0N0y1s= diff --git a/sdk/messaging/azservicebus/internal/atom/entity_manager.go b/sdk/messaging/azservicebus/internal/atom/entity_manager.go index f8b9e157befd..179b5b60d678 100644 --- a/sdk/messaging/azservicebus/internal/atom/entity_manager.go +++ b/sdk/messaging/azservicebus/internal/atom/entity_manager.go @@ -386,7 +386,6 @@ func TraceReqAndResponseMiddleware() MiddlewareFunc { } type feedEmptyError struct { - azcore.HTTPResponse response *http.Response } @@ -404,25 +403,9 @@ func NotFound(err error) (bool, *http.Response) { return true, feedEmptyError.RawResponse() } - var httpResponse azcore.HTTPResponse - - if errors.As(err, &httpResponse) { - return httpResponse.RawResponse().StatusCode == 404, httpResponse.RawResponse() - } - return false, nil } -func AsHTTPResponse(err error) *http.Response { - var httpResponse azcore.HTTPResponse - - if errors.As(err, &httpResponse) { - return httpResponse.RawResponse() - } - - return nil -} - func isEmptyFeed(b []byte) bool { var emptyFeed QueueFeed feedErr := xml.Unmarshal(b, &emptyFeed) diff --git a/sdk/messaging/azservicebus/internal/atom/errors.go b/sdk/messaging/azservicebus/internal/atom/errors.go index 25bbe9d534b0..e8182a433746 100644 --- a/sdk/messaging/azservicebus/internal/atom/errors.go +++ b/sdk/messaging/azservicebus/internal/atom/errors.go @@ -12,7 +12,9 @@ func NewResponseError(inner error, resp *http.Response) error { return ResponseError{inner, resp} } -// ResponseError conforms to the azcore.HTTPResponse +// ResponseError conforms to the older azcore.HTTPResponse +// NOTE: after breaking changes have been incorporated we'll move +// to the newer azcore.HTTPResponseError type ResponseError struct { inner error resp *http.Response diff --git a/sdk/messaging/azservicebus/internal/atom/manager_common_test.go b/sdk/messaging/azservicebus/internal/atom/manager_common_test.go index d7e5e7628855..9945fff0b8ec 100644 --- a/sdk/messaging/azservicebus/internal/atom/manager_common_test.go +++ b/sdk/messaging/azservicebus/internal/atom/manager_common_test.go @@ -11,15 +11,10 @@ import ( "strings" "testing" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/stretchr/testify/require" ) func TestResponseError(t *testing.T) { - // sanity check to make sure my error conforms to azcore's interface - var err azcore.HTTPResponse = ResponseError{} - require.NotNil(t, err) - require.EqualValues(t, "this is now the error message: 409", NewResponseError(nil, &http.Response{ StatusCode: http.StatusConflict, Status: "this is now the error message", From 7be27cd2f0e42b9eb85b4de780e282352b28b807 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:30:34 -0500 Subject: [PATCH 25/36] [Core] Bump version of internal (#16793) - [ ] The purpose of this PR is explained in this or a referenced issue. - [ ] The PR does not update generated files. - These files are managed by the codegen framework at [Azure/autorest.go][]. - [ ] Tests are included and/or updated for code changes. - [ ] Updates to [CHANGELOG.md][] are included. - [ ] MIT license headers are included in each file. [Azure/autorest.go]: https://github.com/Azure/autorest.go [CHANGELOG.md]: https://github.com/Azure/azure-sdk-for-go/blob/main/CHANGELOG.md --- sdk/azcore/go.mod | 2 +- sdk/azcore/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/azcore/go.mod b/sdk/azcore/go.mod index 37a7b259bd80..63bb381ef057 100644 --- a/sdk/azcore/go.mod +++ b/sdk/azcore/go.mod @@ -1,7 +1,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/azcore require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 github.com/stretchr/testify v1.7.0 golang.org/x/net v0.0.0-20210610132358-84b48f89b13b ) diff --git a/sdk/azcore/go.sum b/sdk/azcore/go.sum index 13994bd5ccce..f2d37fc64a4e 100644 --- a/sdk/azcore/go.sum +++ b/sdk/azcore/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= From 58f04dc634141f421d99ff721085d22e6181a54f Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:58:41 -0500 Subject: [PATCH 26/36] [Core] Update Changelog.md (#16794) Update changelog for release --- sdk/azcore/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/azcore/CHANGELOG.md b/sdk/azcore/CHANGELOG.md index c216f4c5e6eb..e617347b9cb7 100644 --- a/sdk/azcore/CHANGELOG.md +++ b/sdk/azcore/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 0.21.0 (Unreleased) +## 0.21.0 (2022-01-11) ### Features Added * Added `AllowedHeaders` and `AllowedQueryParams` to `policy.LogOptions` to control which headers and query parameters are written to the logger. From 46dd24376856fa5338b76f18412b838270a02eb2 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 11 Jan 2022 12:25:44 -0500 Subject: [PATCH 27/36] Update CHANGELOG.md (#16795) --- sdk/azcore/CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdk/azcore/CHANGELOG.md b/sdk/azcore/CHANGELOG.md index e617347b9cb7..d2691dbc2ce4 100644 --- a/sdk/azcore/CHANGELOG.md +++ b/sdk/azcore/CHANGELOG.md @@ -14,10 +14,6 @@ * `arm.NewPoller()` and `runtime.NewPoller()` no longer require an `eu` parameter * `runtime.NewResponseError()` no longer requires an `error` parameter -### Bugs Fixed - -### Other Changes - ## 0.20.0 (2021-10-22) ### Breaking Changes From 6094839554ae5a313b245154799660dc4b379457 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 11 Jan 2022 10:11:22 -0800 Subject: [PATCH 28/36] Increment version for azcore releases (#16798) Increment package version after release of azcore --- sdk/azcore/CHANGELOG.md | 10 ++++++++++ sdk/azcore/internal/shared/constants.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/azcore/CHANGELOG.md b/sdk/azcore/CHANGELOG.md index d2691dbc2ce4..8ee406aab16a 100644 --- a/sdk/azcore/CHANGELOG.md +++ b/sdk/azcore/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 0.21.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 0.21.0 (2022-01-11) ### Features Added diff --git a/sdk/azcore/internal/shared/constants.go b/sdk/azcore/internal/shared/constants.go index 50e07ccab19c..54b04f68b079 100644 --- a/sdk/azcore/internal/shared/constants.go +++ b/sdk/azcore/internal/shared/constants.go @@ -35,5 +35,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v0.21.0" + Version = "v0.21.1" ) From def060927e554218268e03e2550a74f9e5e8da74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Rodr=C3=ADguez?= Date: Tue, 11 Jan 2022 13:53:18 -0500 Subject: [PATCH 29/36] [azidentity] Making ChainedTokenCredential re-use the first successful credential (#16392) This PR makes it so instances of `ChainedTokenCredential` will now re-use the first successful credential on `GetToken` calls. Fixed #16268 --- sdk/azidentity/CHANGELOG.md | 6 ++ sdk/azidentity/chained_token_credential.go | 23 +++- .../chained_token_credential_test.go | 101 +++++++++++++++--- 3 files changed, 113 insertions(+), 17 deletions(-) diff --git a/sdk/azidentity/CHANGELOG.md b/sdk/azidentity/CHANGELOG.md index 6afba175220e..a8908b91261b 100644 --- a/sdk/azidentity/CHANGELOG.md +++ b/sdk/azidentity/CHANGELOG.md @@ -6,6 +6,12 @@ ### Breaking Changes +* Instances of `ChainedTokenCredential` will now skip looping through the list of source credentials and re-use the first successful credential on subsequent calls to `GetToken`. + * If `ChainedTokenCredentialOptions.RetrySources` is true, `ChainedTokenCredential` will continue to try all of the originally provided credentials each time the `GetToken` method is called. + * `ChainedTokenCredential.successfulCredential` will contain a reference to the last successful credential. + * `DefaultAzureCredenial` will also re-use the first successful credential on subsequent calls to `GetToken`. + * `DefaultAzureCredential.chain.successfulCredential` will also contain a reference to the last successful credential. + ### Bugs Fixed ### Other Changes diff --git a/sdk/azidentity/chained_token_credential.go b/sdk/azidentity/chained_token_credential.go index 7e3c8aefbaaf..fe833d637674 100644 --- a/sdk/azidentity/chained_token_credential.go +++ b/sdk/azidentity/chained_token_credential.go @@ -14,12 +14,20 @@ import ( // ChainedTokenCredentialOptions contains optional parameters for ChainedTokenCredential. type ChainedTokenCredentialOptions struct { - // placeholder for future options + // RetrySources configures how the credential uses its sources. + // When true, the credential will always request a token from each source in turn, + // stopping when one provides a token. When false, the credential requests a token + // only from the source that previously retrieved a token--it never again tries the sources which failed. + RetrySources bool } // ChainedTokenCredential is a chain of credentials that enables fallback behavior when a credential can't authenticate. +// By default, this credential will assume that the first successful credential should be the only credential used on future requests. +// If the `RetrySources` option is set to true, it will always try to get a token using all of the originally provided credentials. type ChainedTokenCredential struct { - sources []azcore.TokenCredential + sources []azcore.TokenCredential + successfulCredential azcore.TokenCredential + retrySources bool } // NewChainedTokenCredential creates a ChainedTokenCredential. @@ -36,7 +44,10 @@ func NewChainedTokenCredential(sources []azcore.TokenCredential, options *Chaine } cp := make([]azcore.TokenCredential, len(sources)) copy(cp, sources) - return &ChainedTokenCredential{sources: cp}, nil + if options == nil { + options = &ChainedTokenCredentialOptions{} + } + return &ChainedTokenCredential{sources: cp, retrySources: options.RetrySources}, nil } // GetToken calls GetToken on the chained credentials in turn, stopping when one returns a token. This method is called automatically by Azure SDK clients. @@ -44,6 +55,10 @@ func NewChainedTokenCredential(sources []azcore.TokenCredential, options *Chaine // opts: Options for the token request, in particular the desired scope of the access token. func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (token *azcore.AccessToken, err error) { var errList []CredentialUnavailableError + + if c.successfulCredential != nil && !c.retrySources { + return c.successfulCredential.GetToken(ctx, opts) + } for _, cred := range c.sources { token, err = cred.GetToken(ctx, opts) var credErr CredentialUnavailableError @@ -59,9 +74,11 @@ func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.Token return nil, err } else { logGetTokenSuccess(c, opts) + c.successfulCredential = cred return token, nil } } + // if we reach this point it means that all of the credentials in the chain returned CredentialUnavailableError credErr := newCredentialUnavailableError("Chained Token Credential", createChainedErrorMessage(errList)) // skip adding the stack trace here as it was already logged by other calls to GetToken() diff --git a/sdk/azidentity/chained_token_credential_test.go b/sdk/azidentity/chained_token_credential_test.go index c0ad339139ed..1863df3d2189 100644 --- a/sdk/azidentity/chained_token_credential_test.go +++ b/sdk/azidentity/chained_token_credential_test.go @@ -113,30 +113,103 @@ func TestChainedTokenCredential_GetTokenFail(t *testing.T) { } } -type unavailableCredential struct{} +// TestCredential response +type testCredentialResponse struct { + token *azcore.AccessToken + err error +} -func (*unavailableCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (token *azcore.AccessToken, err error) { - return nil, newCredentialUnavailableError("unavailableCredential", "is unavailable") +// Credential used for testing +type TestCredential struct { + getTokenCalls int + responses []testCredentialResponse } -func TestChainedTokenCredential_GetTokenWithUnavailableCredentialInChain(t *testing.T) { - secCred, err := NewClientSecretCredential(fakeTenantID, fakeClientID, secret, nil) +func (c *TestCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (token *azcore.AccessToken, err error) { + index := c.getTokenCalls + c.getTokenCalls += 1 + response := c.responses[index] + return response.token, response.err +} + +func testGoodGetTokenResponse(t *testing.T, token *azcore.AccessToken, err error) { if err != nil { - t.Fatalf("Unable to create credential. Received: %v", err) + t.Fatalf("Received an error when attempting to get a token but expected none") + } + if token.Token != tokenValue { + t.Fatalf("Received an incorrect access token") } - secCred.client = fakeConfidentialClient{ar: confidential.AuthResult{AccessToken: tokenValue, ExpiresOn: time.Now().Add(time.Hour)}} - cred, err := NewChainedTokenCredential([]azcore.TokenCredential{&unavailableCredential{}, secCred}, nil) + if token.ExpiresOn.IsZero() { + t.Fatalf("Received an incorrect time in the response") + } +} + +func TestChainedTokenCredential_RepeatedGetTokenWithSuccessfulCredential(t *testing.T) { + failedCredential := &TestCredential{responses: []testCredentialResponse{ + {err: newCredentialUnavailableError("MockCredential", "Mocking a credential unavailable error")}, + {err: newCredentialUnavailableError("MockCredential", "Mocking a credential unavailable error")}, + }} + successfulCredential := &TestCredential{responses: []testCredentialResponse{ + {token: &azcore.AccessToken{Token: tokenValue, ExpiresOn: time.Now()}}, + {token: &azcore.AccessToken{Token: tokenValue, ExpiresOn: time.Now()}}, + }} + + cred, err := NewChainedTokenCredential([]azcore.TokenCredential{failedCredential, successfulCredential}, nil) if err != nil { t.Fatalf("unexpected error: %v", err) } - tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) + + getTokenOptions := policy.TokenRequestOptions{Scopes: []string{liveTestScope}} + + tk, err := cred.GetToken(context.Background(), getTokenOptions) + testGoodGetTokenResponse(t, tk, err) + if failedCredential.getTokenCalls != 1 { + t.Fatal("The failed credential getToken should have been called once") + } + if successfulCredential.getTokenCalls != 1 { + t.Fatalf("The successful credential getToken should have been called once") + } + tk2, err2 := cred.GetToken(context.Background(), getTokenOptions) + testGoodGetTokenResponse(t, tk2, err2) + if failedCredential.getTokenCalls != 1 { + t.Fatalf("The failed credential getToken should not have been called again") + } + if successfulCredential.getTokenCalls != 2 { + t.Fatalf("The successful credential getToken should have been called twice") + } +} + +func TestChainedTokenCredential_RepeatedGetTokenWithSuccessfulCredentialWithRetrySources(t *testing.T) { + failedCredential := &TestCredential{responses: []testCredentialResponse{ + {err: newCredentialUnavailableError("MockCredential", "Mocking a credential unavailable error")}, + {err: newCredentialUnavailableError("MockCredential", "Mocking a credential unavailable error")}, + }} + successfulCredential := &TestCredential{responses: []testCredentialResponse{ + {token: &azcore.AccessToken{Token: tokenValue, ExpiresOn: time.Now()}}, + {token: &azcore.AccessToken{Token: tokenValue, ExpiresOn: time.Now()}}, + }} + + cred, err := NewChainedTokenCredential([]azcore.TokenCredential{failedCredential, successfulCredential}, &ChainedTokenCredentialOptions{RetrySources: true}) if err != nil { - t.Fatalf("Received an error when attempting to get a token but expected none") + t.Fatalf("unexpected error: %v", err) } - if tk.Token != tokenValue { - t.Fatalf("Received an incorrect access token") + + getTokenOptions := policy.TokenRequestOptions{Scopes: []string{liveTestScope}} + + tk, err := cred.GetToken(context.Background(), getTokenOptions) + testGoodGetTokenResponse(t, tk, err) + if failedCredential.getTokenCalls != 1 { + t.Fatalf("The failed credential getToken should have been called once") } - if tk.ExpiresOn.IsZero() { - t.Fatalf("Received an incorrect time in the response") + if successfulCredential.getTokenCalls != 1 { + t.Fatalf("The successful credential getToken should have been called once") + } + tk2, err2 := cred.GetToken(context.Background(), getTokenOptions) + testGoodGetTokenResponse(t, tk2, err2) + if failedCredential.getTokenCalls != 2 { + t.Fatalf("The failed credential getToken should have been called twice") + } + if successfulCredential.getTokenCalls != 2 { + t.Fatalf("The successful credential getToken should have been called twice") } } From 584a7b0c347dbaf97c0b0d5758a1e35cedee0b4c Mon Sep 17 00:00:00 2001 From: Charles Lowell <10964656+chlowell@users.noreply.github.com> Date: Tue, 11 Jan 2022 11:22:55 -0800 Subject: [PATCH 30/36] Align authentication errors with azcore.ResponseError (#16777) --- sdk/azidentity/CHANGELOG.md | 11 ++- sdk/azidentity/chained_token_credential.go | 9 +-- .../client_certificate_credential_test.go | 4 +- .../client_secret_credential_test.go | 4 +- sdk/azidentity/environment_credential_test.go | 8 +- sdk/azidentity/errors.go | 78 ++++++++++--------- sdk/azidentity/go.mod | 6 +- sdk/azidentity/go.sum | 7 +- sdk/azidentity/live_test.go | 4 +- .../managed_identity_credential_test.go | 10 +-- .../username_password_credential_test.go | 4 +- sdk/azidentity/version.go | 2 +- 12 files changed, 75 insertions(+), 72 deletions(-) diff --git a/sdk/azidentity/CHANGELOG.md b/sdk/azidentity/CHANGELOG.md index a8908b91261b..11ab8b1caab0 100644 --- a/sdk/azidentity/CHANGELOG.md +++ b/sdk/azidentity/CHANGELOG.md @@ -1,24 +1,23 @@ # Release History -## 0.12.1 (Unreleased) - -### Features Added +## 0.13.0 (2022-01-11) ### Breaking Changes - +* Replaced `AuthenticationFailedError.RawResponse()` with a field having the same name +* Unexported `CredentialUnavailableError` * Instances of `ChainedTokenCredential` will now skip looping through the list of source credentials and re-use the first successful credential on subsequent calls to `GetToken`. * If `ChainedTokenCredentialOptions.RetrySources` is true, `ChainedTokenCredential` will continue to try all of the originally provided credentials each time the `GetToken` method is called. * `ChainedTokenCredential.successfulCredential` will contain a reference to the last successful credential. * `DefaultAzureCredenial` will also re-use the first successful credential on subsequent calls to `GetToken`. * `DefaultAzureCredential.chain.successfulCredential` will also contain a reference to the last successful credential. -### Bugs Fixed - ### Other Changes * `ManagedIdentityCredential` no longer probes IMDS before requesting a token from it. Also, an error response from IMDS no longer disables a credential instance. Following an error, a credential instance will continue to send requests to IMDS as necessary. +* Adopted MSAL for user and service principal authentication +* Updated `azcore` requirement to 0.21.0 ## 0.12.0 (2021-11-02) ### Breaking Changes diff --git a/sdk/azidentity/chained_token_credential.go b/sdk/azidentity/chained_token_credential.go index fe833d637674..4815898b7c9b 100644 --- a/sdk/azidentity/chained_token_credential.go +++ b/sdk/azidentity/chained_token_credential.go @@ -54,21 +54,20 @@ func NewChainedTokenCredential(sources []azcore.TokenCredential, options *Chaine // ctx: Context controlling the request lifetime. // opts: Options for the token request, in particular the desired scope of the access token. func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (token *azcore.AccessToken, err error) { - var errList []CredentialUnavailableError - if c.successfulCredential != nil && !c.retrySources { return c.successfulCredential.GetToken(ctx, opts) } + var errList []credentialUnavailableError for _, cred := range c.sources { token, err = cred.GetToken(ctx, opts) - var credErr CredentialUnavailableError + var credErr credentialUnavailableError if errors.As(err, &credErr) { errList = append(errList, credErr) } else if err != nil { var authFailed AuthenticationFailedError if errors.As(err, &authFailed) { err = fmt.Errorf("Authentication failed:\n%s\n%s"+createChainedErrorMessage(errList), err) - authErr := newAuthenticationFailedError(err, authFailed.RawResponse()) + authErr := newAuthenticationFailedError(err, authFailed.RawResponse) return nil, authErr } return nil, err @@ -86,7 +85,7 @@ func (c *ChainedTokenCredential) GetToken(ctx context.Context, opts policy.Token return nil, credErr } -func createChainedErrorMessage(errList []CredentialUnavailableError) string { +func createChainedErrorMessage(errList []credentialUnavailableError) string { msg := "" for _, err := range errList { msg += err.Error() diff --git a/sdk/azidentity/client_certificate_credential_test.go b/sdk/azidentity/client_certificate_credential_test.go index 177813d7d190..a7d2c4be5e6c 100644 --- a/sdk/azidentity/client_certificate_credential_test.go +++ b/sdk/azidentity/client_certificate_credential_test.go @@ -177,7 +177,7 @@ func TestClientCertificateCredential_InvalidCertLive(t *testing.T) { if !errors.As(err, &e) { t.Fatal("expected AuthenticationFailedError") } - if e.RawResponse() == nil { - t.Fatal("expected RawResponse() to return a non-nil *http.Response") + if e.RawResponse == nil { + t.Fatal("expected a non-nil RawResponse") } } diff --git a/sdk/azidentity/client_secret_credential_test.go b/sdk/azidentity/client_secret_credential_test.go index f929b39066fe..00e93b9fb83e 100644 --- a/sdk/azidentity/client_secret_credential_test.go +++ b/sdk/azidentity/client_secret_credential_test.go @@ -62,7 +62,7 @@ func TestClientSecretCredential_InvalidSecretLive(t *testing.T) { if !errors.As(err, &e) { t.Fatal("expected AuthenticationFailedError") } - if e.RawResponse() == nil { - t.Fatal("expected RawResponse() to return a non-nil *http.Response") + if e.RawResponse == nil { + t.Fatal("expected a non-nil RawResponse") } } diff --git a/sdk/azidentity/environment_credential_test.go b/sdk/azidentity/environment_credential_test.go index 951f173a85e8..16aef6f31592 100644 --- a/sdk/azidentity/environment_credential_test.go +++ b/sdk/azidentity/environment_credential_test.go @@ -210,8 +210,8 @@ func TestEnvironmentCredential_InvalidClientSecretLive(t *testing.T) { if !errors.As(err, &e) { t.Fatal("expected AuthenticationFailedError") } - if e.RawResponse() == nil { - t.Fatal("expected RawResponse() to return a non-nil *http.Response") + if e.RawResponse == nil { + t.Fatal("expected a non-nil RawResponse") } } @@ -254,7 +254,7 @@ func TestEnvironmentCredential_InvalidPasswordLive(t *testing.T) { if !errors.As(err, &e) { t.Fatal("expected AuthenticationFailedError") } - if e.RawResponse() == nil { - t.Fatal("expected RawResponse() to return a non-nil *http.Response") + if e.RawResponse == nil { + t.Fatal("expected a non-nil RawResponse") } } diff --git a/sdk/azidentity/errors.go b/sdk/azidentity/errors.go index 777d0d663b8a..138ac629cbd9 100644 --- a/sdk/azidentity/errors.go +++ b/sdk/azidentity/errors.go @@ -4,7 +4,11 @@ package azidentity import ( + "bytes" + "encoding/json" "errors" + "fmt" + "io" "net/http" "github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo" @@ -12,58 +16,66 @@ import ( ) // AuthenticationFailedError indicates an authentication request has failed. -type AuthenticationFailedError interface { - errorinfo.NonRetriable - RawResponse() *http.Response - authenticationFailed() -} +type AuthenticationFailedError struct { + err error -type authenticationFailedError struct { - error - resp *http.Response + // RawResponse is the HTTP response motivating the error, if available. + RawResponse *http.Response } func newAuthenticationFailedError(err error, resp *http.Response) AuthenticationFailedError { if resp == nil { var e msal.CallErr if errors.As(err, &e) { - return authenticationFailedError{err, e.Resp} + return AuthenticationFailedError{err: e, RawResponse: e.Resp} } } - return authenticationFailedError{err, resp} + return AuthenticationFailedError{err: err, RawResponse: resp} } -// NonRetriable indicates that this error should not be retried. -func (authenticationFailedError) NonRetriable() { - // marker method +// Error implements the error interface for type ResponseError. +// Note that the message contents are not contractual and can change over time. +func (e AuthenticationFailedError) Error() string { + if e.RawResponse == nil { + return e.err.Error() + } + msg := &bytes.Buffer{} + fmt.Fprintf(msg, "%s %s://%s%s\n", e.RawResponse.Request.Method, e.RawResponse.Request.URL.Scheme, e.RawResponse.Request.URL.Host, e.RawResponse.Request.URL.Path) + fmt.Fprintln(msg, "--------------------------------------------------------------------------------") + fmt.Fprintf(msg, "RESPONSE %s\n", e.RawResponse.Status) + fmt.Fprintln(msg, "--------------------------------------------------------------------------------") + body, err := io.ReadAll(e.RawResponse.Body) + e.RawResponse.Body.Close() + if err != nil { + fmt.Fprintf(msg, "Error reading response body: %v", err) + } else if len(body) > 0 { + e.RawResponse.Body = io.NopCloser(bytes.NewReader(body)) + if err := json.Indent(msg, body, "", " "); err != nil { + // failed to pretty-print so just dump it verbatim + fmt.Fprint(msg, string(body)) + } + } else { + fmt.Fprint(msg, "Response contained no body") + } + fmt.Fprintln(msg, "\n--------------------------------------------------------------------------------") + return msg.String() } -// AuthenticationFailed indicates that an authentication attempt failed -func (authenticationFailedError) authenticationFailed() { +// NonRetriable indicates that this error should not be retried. +func (AuthenticationFailedError) NonRetriable() { // marker method } -// RawResponse returns the HTTP response motivating the error, if available. -func (e authenticationFailedError) RawResponse() *http.Response { - return e.resp -} - -var _ AuthenticationFailedError = (*authenticationFailedError)(nil) -var _ errorinfo.NonRetriable = (*authenticationFailedError)(nil) - -// CredentialUnavailableError indicates a credential can't attempt authenticate -// because it lacks required data or state. -type CredentialUnavailableError interface { - errorinfo.NonRetriable - credentialUnavailable() -} +var _ errorinfo.NonRetriable = (*AuthenticationFailedError)(nil) +// credentialUnavailableError indicates a credential can't attempt +// authentication because it lacks required data or state. type credentialUnavailableError struct { credType string message string } -func newCredentialUnavailableError(credType, message string) CredentialUnavailableError { +func newCredentialUnavailableError(credType, message string) credentialUnavailableError { return credentialUnavailableError{credType: credType, message: message} } @@ -76,10 +88,4 @@ func (e credentialUnavailableError) NonRetriable() { // marker method } -// CredentialUnavailable indicates that the credential didn't attempt to authenticate -func (e credentialUnavailableError) credentialUnavailable() { - // marker method -} - -var _ CredentialUnavailableError = (*credentialUnavailableError)(nil) var _ errorinfo.NonRetriable = (*credentialUnavailableError)(nil) diff --git a/sdk/azidentity/go.mod b/sdk/azidentity/go.mod index b1a21a0f0f05..9829e90382f5 100644 --- a/sdk/azidentity/go.mod +++ b/sdk/azidentity/go.mod @@ -2,11 +2,9 @@ module github.com/Azure/azure-sdk-for-go/sdk/azidentity go 1.16 -replace github.com/Azure/azure-sdk-for-go/sdk/azcore => ../azcore - require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 - github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 diff --git a/sdk/azidentity/go.sum b/sdk/azidentity/go.sum index ace9e01be592..9a943f908cb2 100644 --- a/sdk/azidentity/go.sum +++ b/sdk/azidentity/go.sum @@ -1,6 +1,7 @@ -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.2 h1:rImM7Yjz9yUgpdxp3A4cZLm1JZuo4XbtIp2LrUZnwYw= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.2/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/sdk/azidentity/live_test.go b/sdk/azidentity/live_test.go index 1077fdb6b723..fb81d63e6c64 100644 --- a/sdk/azidentity/live_test.go +++ b/sdk/azidentity/live_test.go @@ -106,7 +106,7 @@ func TestMain(m *testing.M) { // TODO: reset matcher case recording.RecordingMode: // remove default sanitizers such as the OAuth response sanitizer - err := recording.ResetSanitizers(nil) + err := recording.ResetProxy(nil) if err != nil { panic(err) } @@ -151,7 +151,7 @@ func TestMain(m *testing.M) { } } defer func() { - err := recording.ResetSanitizers(nil) + err := recording.ResetProxy(nil) if err != nil { panic(err) } diff --git a/sdk/azidentity/managed_identity_credential_test.go b/sdk/azidentity/managed_identity_credential_test.go index 4bd2609167b7..e3b21bebdeaf 100644 --- a/sdk/azidentity/managed_identity_credential_test.go +++ b/sdk/azidentity/managed_identity_credential_test.go @@ -395,12 +395,12 @@ func TestManagedIdentityCredential_GetTokenIMDS400(t *testing.T) { if err != nil { t.Fatal(err) } - // cred should return CredentialUnavailableError when IMDS responds 400 to a token request - var expected CredentialUnavailableError + // cred should return credentialUnavailableError when IMDS responds 400 to a token request + var expected credentialUnavailableError for i := 0; i < 3; i++ { _, err = cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) if !errors.As(err, &expected) { - t.Fatalf(`expected CredentialUnavailableError, got %T: "%s"`, err, err.Error()) + t.Fatalf(`expected credentialUnavailableError, got %T: "%s"`, err, err.Error()) } } } @@ -731,9 +731,9 @@ func TestManagedIdentityCredential_IMDSTimeoutExceeded(t *testing.T) { } cred.client.imdsTimeout = time.Nanosecond tk, err := cred.GetToken(context.Background(), policy.TokenRequestOptions{Scopes: []string{liveTestScope}}) - var expected CredentialUnavailableError + var expected credentialUnavailableError if !errors.As(err, &expected) { - t.Fatalf(`expected CredentialUnavailableError, got %T: "%v"`, err, err) + t.Fatalf(`expected credentialUnavailableError, got %T: "%v"`, err, err) } if tk != nil { t.Fatal("GetToken returned a token and an error") diff --git a/sdk/azidentity/username_password_credential_test.go b/sdk/azidentity/username_password_credential_test.go index b0e9f24a2650..7a88a8d58661 100644 --- a/sdk/azidentity/username_password_credential_test.go +++ b/sdk/azidentity/username_password_credential_test.go @@ -60,7 +60,7 @@ func TestUsernamePasswordCredential_InvalidPasswordLive(t *testing.T) { if !errors.As(err, &e) { t.Fatal("expected AuthenticationFailedError") } - if e.RawResponse() == nil { - t.Fatal("expected RawResponse() to return a non-nil *http.Response") + if e.RawResponse == nil { + t.Fatal("expected a non-nil RawResponse") } } diff --git a/sdk/azidentity/version.go b/sdk/azidentity/version.go index 83e7d514ab08..61c7d1404671 100644 --- a/sdk/azidentity/version.go +++ b/sdk/azidentity/version.go @@ -11,5 +11,5 @@ const ( component = "azidentity" // Version is the semantic version (see http://semver.org) of this module. - version = "v0.12.1" + version = "v0.13.0" ) From ec9c0329e9101624f2bac094dc8209e853c83c2f Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 11 Jan 2022 12:14:56 -0800 Subject: [PATCH 31/36] Increment version for azidentity releases (#16799) Increment package version after release of azidentity --- sdk/azidentity/CHANGELOG.md | 10 ++++++++++ sdk/azidentity/version.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/azidentity/CHANGELOG.md b/sdk/azidentity/CHANGELOG.md index 11ab8b1caab0..1046c98eb8b1 100644 --- a/sdk/azidentity/CHANGELOG.md +++ b/sdk/azidentity/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 0.13.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 0.13.0 (2022-01-11) ### Breaking Changes diff --git a/sdk/azidentity/version.go b/sdk/azidentity/version.go index 61c7d1404671..83132d22b6b7 100644 --- a/sdk/azidentity/version.go +++ b/sdk/azidentity/version.go @@ -11,5 +11,5 @@ const ( component = "azidentity" // Version is the semantic version (see http://semver.org) of this module. - version = "v0.13.0" + version = "v0.13.1" ) From 8f0d0953d3db9db926d3da5cf115ac185e0296bb Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:06:30 -0500 Subject: [PATCH 32/36] [KeyVault] release ready for keyvault keys (#16731) * release ready for keyvault keys * updating the api surface to latest azcore * updating to ResponseError * update with latest codegen * fixing ci * formatting * bumping azcore to v0.21.0 * updating azidentity and autorest version * updating go.sum * final upgrade for changelog Co-authored-by: Joel Hendrix --- sdk/keyvault/azkeys/CHANGELOG.md | 7 +- sdk/keyvault/azkeys/autorest.md | 2 +- sdk/keyvault/azkeys/client.go | 23 +- sdk/keyvault/azkeys/client_test.go | 6 +- sdk/keyvault/azkeys/constants.go | 2 +- sdk/keyvault/azkeys/constants_test.go | 3 +- sdk/keyvault/azkeys/crypto/crypto_client.go | 5 +- sdk/keyvault/azkeys/go.mod | 4 +- sdk/keyvault/azkeys/go.sum | 29 +- .../azkeys/internal/generated/connection.go | 37 - .../azkeys/internal/generated/constants.go | 63 +- .../generated/hsmsecuritydomain_client.go | 210 ++--- ...ultclient_client.go => keyvault_client.go} | 734 ++++++------------ .../azkeys/internal/generated/models.go | 327 ++++---- .../azkeys/internal/generated/pagers.go | 54 +- .../azkeys/internal/generated/pollers.go | 38 +- .../internal/generated/response_types.go | 168 ++-- .../generated/roleassignments_client.go | 170 ++-- .../generated/roledefinitions_client.go | 170 ++-- .../azkeys/internal/generated/time_unix.go | 2 +- sdk/keyvault/azkeys/models.go | 31 +- 21 files changed, 869 insertions(+), 1216 deletions(-) delete mode 100644 sdk/keyvault/azkeys/internal/generated/connection.go rename sdk/keyvault/azkeys/internal/generated/{keyvaultclient_client.go => keyvault_client.go} (70%) diff --git a/sdk/keyvault/azkeys/CHANGELOG.md b/sdk/keyvault/azkeys/CHANGELOG.md index f466da6f6d91..b9b69eb04448 100644 --- a/sdk/keyvault/azkeys/CHANGELOG.md +++ b/sdk/keyvault/azkeys/CHANGELOG.md @@ -1,15 +1,12 @@ # Release History -## 0.1.1 (Unreleased) - -### Features Added - -### Breaking Changes +## 0.2.0 (2022-01-12) ### Bugs Fixed * Fixes a bug in `crypto.NewClient` where the key version was required in the path, it is no longer required but is recommended. ### Other Changes +* Updates `azcore` dependency from `v0.20.0` to `v0.21.0` ## 0.1.0 (2021-11-09) * This is the initial release of the `azkeys` library diff --git a/sdk/keyvault/azkeys/autorest.md b/sdk/keyvault/azkeys/autorest.md index 574f3caae415..e530df9fc0ae 100644 --- a/sdk/keyvault/azkeys/autorest.md +++ b/sdk/keyvault/azkeys/autorest.md @@ -17,7 +17,7 @@ module: azkeys openapi-type: "data-plane" security: "AADToken" security-scopes: "https://vault.azure.net/.default" -use: "@autorest/go@4.0.0-preview.30" +use: "@autorest/go@4.0.0-preview.35" module-version: 0.1.0 export-clients: true ``` diff --git a/sdk/keyvault/azkeys/client.go b/sdk/keyvault/azkeys/client.go index e3fe61820646..bd1e6819af14 100644 --- a/sdk/keyvault/azkeys/client.go +++ b/sdk/keyvault/azkeys/client.go @@ -14,7 +14,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - generated "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/internal/generated" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/internal/generated" shared "github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal" ) @@ -58,9 +59,9 @@ func NewClient(vaultUrl string, credential azcore.TokenCredential, options *Clie shared.NewKeyVaultChallengePolicy(credential), ) - conn := generated.NewConnection(genOptions) + pl := runtime.NewPipeline(generated.ModuleName, generated.ModuleVersion, runtime.PipelineOptions{}, genOptions) return &Client{ - kvClient: generated.NewKeyVaultClient(conn), + kvClient: generated.NewKeyVaultClient(pl), vaultUrl: vaultUrl, }, nil } @@ -603,9 +604,9 @@ func (s *startDeleteKeyPoller) Poll(ctx context.Context) (*http.Response, error) return resp.RawResponse, nil } - var httpResponseErr azcore.HTTPResponse + var httpResponseErr *azcore.ResponseError if errors.As(err, &httpResponseErr) { - if httpResponseErr.RawResponse().StatusCode == http.StatusNotFound { + if httpResponseErr.StatusCode == http.StatusNotFound { // This is the expected result return s.deleteResponse.RawResponse, nil } @@ -660,9 +661,9 @@ func (c *Client) BeginDeleteKey(ctx context.Context, keyName string, options *Be } getResp, err := c.kvClient.GetDeletedKey(ctx, c.vaultUrl, keyName, nil) - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError if errors.As(err, &httpErr) { - if httpErr.RawResponse().StatusCode != http.StatusNotFound { + if httpErr.StatusCode != http.StatusNotFound { return DeleteKeyPollerResponse{}, err } } @@ -765,9 +766,9 @@ func (b *beginRecoverPoller) Done() bool { func (b *beginRecoverPoller) Poll(ctx context.Context) (*http.Response, error) { resp, err := b.client.GetKey(ctx, b.vaultUrl, b.keyName, "", nil) b.lastResponse = resp - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError if errors.As(err, &httpErr) { - return httpErr.RawResponse(), err + return httpErr.RawResponse, err } return resp.RawResponse, nil } @@ -845,9 +846,9 @@ func (c *Client) BeginRecoverDeletedKey(ctx context.Context, keyName string, opt } getResp, err := c.kvClient.GetKey(ctx, c.vaultUrl, keyName, "", nil) - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError if errors.As(err, &httpErr) { - if httpErr.RawResponse().StatusCode != http.StatusNotFound { + if httpErr.StatusCode != http.StatusNotFound { return RecoverDeletedKeyPollerResponse{}, err } } diff --git a/sdk/keyvault/azkeys/client_test.go b/sdk/keyvault/azkeys/client_test.go index aec011af9979..5c24096a1355 100644 --- a/sdk/keyvault/azkeys/client_test.go +++ b/sdk/keyvault/azkeys/client_test.go @@ -263,13 +263,13 @@ func TestBackupKey(t *testing.T) { require.NoError(t, err) _, err = client.GetKey(ctx, key, nil) - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError require.True(t, errors.As(err, &httpErr)) - require.Equal(t, httpErr.RawResponse().StatusCode, http.StatusNotFound) + require.Equal(t, httpErr.RawResponse.StatusCode, http.StatusNotFound) _, err = client.GetDeletedKey(ctx, key, nil) require.True(t, errors.As(err, &httpErr)) - require.Equal(t, httpErr.RawResponse().StatusCode, http.StatusNotFound) + require.Equal(t, httpErr.RawResponse.StatusCode, http.StatusNotFound) time.Sleep(30 * delay()) // Poll this operation manually diff --git a/sdk/keyvault/azkeys/constants.go b/sdk/keyvault/azkeys/constants.go index 43d515ecda16..fbd73635f5bc 100644 --- a/sdk/keyvault/azkeys/constants.go +++ b/sdk/keyvault/azkeys/constants.go @@ -6,7 +6,7 @@ package azkeys -import generated "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/internal/generated" +import "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/internal/generated" // DeletionRecoveryLevel - Reflects the deletion recovery level currently in effect for certificates in the current vault. If it contains 'Purgeable', the // certificate can be permanently deleted by a privileged user; otherwise, diff --git a/sdk/keyvault/azkeys/constants_test.go b/sdk/keyvault/azkeys/constants_test.go index 1dbff8a86cb7..e65db25a5f02 100644 --- a/sdk/keyvault/azkeys/constants_test.go +++ b/sdk/keyvault/azkeys/constants_test.go @@ -29,7 +29,6 @@ func TestToPtrMethods(t *testing.T) { //nolint func TestToGeneratedMethods(t *testing.T) { // If done incorrectly, this will have a nil pointer reference - var l *ListKeyVersionsOptions - l = nil + var l *ListKeyVersionsOptions = nil _ = l.toGenerated() } diff --git a/sdk/keyvault/azkeys/crypto/crypto_client.go b/sdk/keyvault/azkeys/crypto/crypto_client.go index 7a41f23e29ee..1fad6b2ea461 100644 --- a/sdk/keyvault/azkeys/crypto/crypto_client.go +++ b/sdk/keyvault/azkeys/crypto/crypto_client.go @@ -15,6 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" generated "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/internal/generated" shared "github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal" ) @@ -97,7 +98,7 @@ func NewClient(keyURL string, credential azcore.TokenCredential, options *Client genOptions.PerRetryPolicies, shared.NewKeyVaultChallengePolicy(credential), ) - conn := generated.NewConnection(genOptions) + pl := runtime.NewPipeline(generated.ModuleName, generated.ModuleVersion, runtime.PipelineOptions{}, genOptions) vaultURL, err := parseVaultURL(keyURL) if err != nil { @@ -110,7 +111,7 @@ func NewClient(keyURL string, credential azcore.TokenCredential, options *Client } return &Client{ - kvClient: generated.NewKeyVaultClient(conn), + kvClient: generated.NewKeyVaultClient(pl), vaultURL: vaultURL, keyID: keyID, keyVersion: keyVersion, diff --git a/sdk/keyvault/azkeys/go.mod b/sdk/keyvault/azkeys/go.mod index fef837cbac0e..1354980c6092 100644 --- a/sdk/keyvault/azkeys/go.mod +++ b/sdk/keyvault/azkeys/go.mod @@ -5,8 +5,8 @@ go 1.16 replace github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal => ../internal require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.1.0 github.com/stretchr/testify v1.7.0 diff --git a/sdk/keyvault/azkeys/go.sum b/sdk/keyvault/azkeys/go.sum index dd600c7a5375..ff950c29186f 100644 --- a/sdk/keyvault/azkeys/go.sum +++ b/sdk/keyvault/azkeys/go.sum @@ -1,18 +1,28 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0/go.mod h1:GJzjM4SR9T0KyX5gKCVyz1ytD8FeWeUPCwtFCt1AyfE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -24,18 +34,23 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/sdk/keyvault/azkeys/internal/generated/connection.go b/sdk/keyvault/azkeys/internal/generated/connection.go deleted file mode 100644 index c7fa89a3946d..000000000000 --- a/sdk/keyvault/azkeys/internal/generated/connection.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package internal - -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -// Connection - The key vault client performs cryptographic key operations and vault operations against the Key Vault service. -type Connection struct { - p runtime.Pipeline -} - -// NewConnection creates an instance of the Connection type with the specified endpoint. -// Pass nil to accept the default options; this is the same as passing a zero-value options. -func NewConnection(options *azcore.ClientOptions) *Connection { - cp := azcore.ClientOptions{} - if options != nil { - cp = *options - } - client := &Connection{ - p: runtime.NewPipeline(module, version, nil, nil, &cp), - } - return client -} - -// Pipeline returns the connection's pipeline. -func (c *Connection) Pipeline() runtime.Pipeline { - return c.p -} diff --git a/sdk/keyvault/azkeys/internal/generated/constants.go b/sdk/keyvault/azkeys/internal/generated/constants.go index 4f715fe6b0f2..ea281999817f 100644 --- a/sdk/keyvault/azkeys/internal/generated/constants.go +++ b/sdk/keyvault/azkeys/internal/generated/constants.go @@ -6,11 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated const ( - module = "internal" - version = "v0.1.1" + ModuleName = "generated" + ModuleVersion = "v0.2.0" ) // ActionType - The type of the action. @@ -19,7 +19,8 @@ type ActionType string const ( // ActionTypeRotate - Rotate the key based on the key policy. ActionTypeRotate ActionType = "rotate" - // ActionTypeNotify - Trigger event grid events. For preview, the notification time is not configurable and it is default to 30 days before expiry. + // ActionTypeNotify - Trigger event grid events. For preview, the notification time is not configurable and it is default + // to 30 days before expiry. ActionTypeNotify ActionType = "notify" ) @@ -155,40 +156,43 @@ func (c DataAction) ToPtr() *DataAction { return &c } -// DeletionRecoveryLevel - Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can -// be permanently deleted by a privileged user; otherwise, only the system +// DeletionRecoveryLevel - Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains +// 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system // can purge the key, at the end of the retention interval. type DeletionRecoveryLevel string const ( - // DeletionRecoveryLevelCustomizedRecoverable - Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent - // deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval - // and while the subscription is still available. + // DeletionRecoveryLevelCustomizedRecoverable - Denotes a vault state in which deletion is recoverable without the possibility + // for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability + // of the deleted entity during the retention interval and while the subscription is still available. DeletionRecoveryLevelCustomizedRecoverable DeletionRecoveryLevel = "CustomizedRecoverable" - // DeletionRecoveryLevelCustomizedRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion is recoverable, immediate - // and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays - // < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription - // itself cannot be cancelled. + // DeletionRecoveryLevelCustomizedRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion + // is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot + // be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted + // entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled. DeletionRecoveryLevelCustomizedRecoverableProtectedSubscription DeletionRecoveryLevel = "CustomizedRecoverable+ProtectedSubscription" - // DeletionRecoveryLevelCustomizedRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent - // deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, - // unless a Purge operation is requested, or the subscription is cancelled. + // DeletionRecoveryLevelCustomizedRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which + // also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees + // the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription + // is cancelled. DeletionRecoveryLevelCustomizedRecoverablePurgeable DeletionRecoveryLevel = "CustomizedRecoverable+Purgeable" - // DeletionRecoveryLevelPurgeable - Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level - // corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity - // level or higher (vault, resource group, subscription etc.) + // DeletionRecoveryLevelPurgeable - Denotes a vault state in which deletion is an irreversible operation, without the possibility + // for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably + // lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.) DeletionRecoveryLevelPurgeable DeletionRecoveryLevel = "Purgeable" - // DeletionRecoveryLevelRecoverable - Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion - // (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still - // available. System wil permanently delete it after 90 days, if not recovered + // DeletionRecoveryLevelRecoverable - Denotes a vault state in which deletion is recoverable without the possibility for immediate + // and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention + // interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not + // recovered DeletionRecoveryLevelRecoverable DeletionRecoveryLevel = "Recoverable" - // DeletionRecoveryLevelRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion is recoverable within retention interval - // (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System - // wil permanently delete it after 90 days, if not recovered + // DeletionRecoveryLevelRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion is recoverable + // within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription + // itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered DeletionRecoveryLevelRecoverableProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription" - // DeletionRecoveryLevelRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion - // (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, - // or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered + // DeletionRecoveryLevelRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which also permits + // immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the + // retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently + // delete it after 90 days, if not recovered DeletionRecoveryLevelRecoverablePurgeable DeletionRecoveryLevel = "Recoverable+Purgeable" ) @@ -319,7 +323,8 @@ func (c JSONWebKeyOperation) ToPtr() *JSONWebKeyOperation { return &c } -// JSONWebKeySignatureAlgorithm - The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. +// JSONWebKeySignatureAlgorithm - The signing/verification algorithm identifier. For more information on possible algorithm +// types, see JsonWebKeySignatureAlgorithm. type JSONWebKeySignatureAlgorithm string const ( diff --git a/sdk/keyvault/azkeys/internal/generated/hsmsecuritydomain_client.go b/sdk/keyvault/azkeys/internal/generated/hsmsecuritydomain_client.go index e59e6d0c5247..a352892e2d55 100644 --- a/sdk/keyvault/azkeys/internal/generated/hsmsecuritydomain_client.go +++ b/sdk/keyvault/azkeys/internal/generated/hsmsecuritydomain_client.go @@ -6,11 +6,10 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "context" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -20,53 +19,64 @@ import ( // HSMSecurityDomainClient contains the methods for the HSMSecurityDomain group. // Don't use this type directly, use NewHSMSecurityDomainClient() instead. type HSMSecurityDomainClient struct { - con *Connection + pl runtime.Pipeline } // NewHSMSecurityDomainClient creates a new instance of HSMSecurityDomainClient with the specified values. -func NewHSMSecurityDomainClient(con *Connection) *HSMSecurityDomainClient { - return &HSMSecurityDomainClient{con: con} +// pl - the pipeline used for sending requests and handling responses. +func NewHSMSecurityDomainClient(pl runtime.Pipeline) *HSMSecurityDomainClient { + client := &HSMSecurityDomainClient{ + pl: pl, + } + return client } -// BeginDownload - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned managed HSM resource. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) BeginDownload(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainBeginDownloadOptions) (HSMSecurityDomainDownloadPollerResponse, error) { +// BeginDownload - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned +// managed HSM resource. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// certificateInfoObject - The Security Domain download operation requires customer to provide N certificates (minimum 3 and +// maximum 10) containing a public key in JWK format. +// options - HSMSecurityDomainClientBeginDownloadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginDownload +// method. +func (client *HSMSecurityDomainClient) BeginDownload(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainClientBeginDownloadOptions) (HSMSecurityDomainClientDownloadPollerResponse, error) { resp, err := client.download(ctx, vaultBaseURL, certificateInfoObject, options) if err != nil { - return HSMSecurityDomainDownloadPollerResponse{}, err + return HSMSecurityDomainClientDownloadPollerResponse{}, err } - result := HSMSecurityDomainDownloadPollerResponse{ + result := HSMSecurityDomainClientDownloadPollerResponse{ RawResponse: resp, } - pt, err := runtime.NewPoller("HSMSecurityDomainClient.Download", resp, client.con.Pipeline(), client.downloadHandleError) + pt, err := runtime.NewPoller("HSMSecurityDomainClient.Download", resp, client.pl) if err != nil { - return HSMSecurityDomainDownloadPollerResponse{}, err + return HSMSecurityDomainClientDownloadPollerResponse{}, err } - result.Poller = &HSMSecurityDomainDownloadPoller{ + result.Poller = &HSMSecurityDomainClientDownloadPoller{ pt: pt, } return result, nil } -// Download - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned managed HSM resource. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) download(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainBeginDownloadOptions) (*http.Response, error) { +// Download - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned +// managed HSM resource. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *HSMSecurityDomainClient) download(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainClientBeginDownloadOptions) (*http.Response, error) { req, err := client.downloadCreateRequest(ctx, vaultBaseURL, certificateInfoObject, options) if err != nil { return nil, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, client.downloadHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // downloadCreateRequest creates the Download request. -func (client *HSMSecurityDomainClient) downloadCreateRequest(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainBeginDownloadOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) downloadCreateRequest(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainClientBeginDownloadOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/download" @@ -81,38 +91,28 @@ func (client *HSMSecurityDomainClient) downloadCreateRequest(ctx context.Context return req, runtime.MarshalAsJSON(req, certificateInfoObject) } -// downloadHandleError handles the Download error response. -func (client *HSMSecurityDomainClient) downloadHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // DownloadPending - Retrieves the Security Domain download operation status -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) DownloadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainDownloadPendingOptions) (HSMSecurityDomainDownloadPendingResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - HSMSecurityDomainClientDownloadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.DownloadPending +// method. +func (client *HSMSecurityDomainClient) DownloadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientDownloadPendingOptions) (HSMSecurityDomainClientDownloadPendingResponse, error) { req, err := client.downloadPendingCreateRequest(ctx, vaultBaseURL, options) if err != nil { - return HSMSecurityDomainDownloadPendingResponse{}, err + return HSMSecurityDomainClientDownloadPendingResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return HSMSecurityDomainDownloadPendingResponse{}, err + return HSMSecurityDomainClientDownloadPendingResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return HSMSecurityDomainDownloadPendingResponse{}, client.downloadPendingHandleError(resp) + return HSMSecurityDomainClientDownloadPendingResponse{}, runtime.NewResponseError(resp) } return client.downloadPendingHandleResponse(resp) } // downloadPendingCreateRequest creates the DownloadPending request. -func (client *HSMSecurityDomainClient) downloadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainDownloadPendingOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) downloadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientDownloadPendingOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/download/pending" @@ -125,46 +125,36 @@ func (client *HSMSecurityDomainClient) downloadPendingCreateRequest(ctx context. } // downloadPendingHandleResponse handles the DownloadPending response. -func (client *HSMSecurityDomainClient) downloadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainDownloadPendingResponse, error) { - result := HSMSecurityDomainDownloadPendingResponse{RawResponse: resp} +func (client *HSMSecurityDomainClient) downloadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainClientDownloadPendingResponse, error) { + result := HSMSecurityDomainClientDownloadPendingResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SecurityDomainOperationStatus); err != nil { - return HSMSecurityDomainDownloadPendingResponse{}, err + return HSMSecurityDomainClientDownloadPendingResponse{}, err } return result, nil } -// downloadPendingHandleError handles the DownloadPending error response. -func (client *HSMSecurityDomainClient) downloadPendingHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // TransferKey - Retrieve Security Domain transfer key -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) TransferKey(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainTransferKeyOptions) (HSMSecurityDomainTransferKeyResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - HSMSecurityDomainClientTransferKeyOptions contains the optional parameters for the HSMSecurityDomainClient.TransferKey +// method. +func (client *HSMSecurityDomainClient) TransferKey(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientTransferKeyOptions) (HSMSecurityDomainClientTransferKeyResponse, error) { req, err := client.transferKeyCreateRequest(ctx, vaultBaseURL, options) if err != nil { - return HSMSecurityDomainTransferKeyResponse{}, err + return HSMSecurityDomainClientTransferKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return HSMSecurityDomainTransferKeyResponse{}, err + return HSMSecurityDomainClientTransferKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return HSMSecurityDomainTransferKeyResponse{}, client.transferKeyHandleError(resp) + return HSMSecurityDomainClientTransferKeyResponse{}, runtime.NewResponseError(resp) } return client.transferKeyHandleResponse(resp) } // transferKeyCreateRequest creates the TransferKey request. -func (client *HSMSecurityDomainClient) transferKeyCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainTransferKeyOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) transferKeyCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientTransferKeyOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/upload" @@ -180,66 +170,57 @@ func (client *HSMSecurityDomainClient) transferKeyCreateRequest(ctx context.Cont } // transferKeyHandleResponse handles the TransferKey response. -func (client *HSMSecurityDomainClient) transferKeyHandleResponse(resp *http.Response) (HSMSecurityDomainTransferKeyResponse, error) { - result := HSMSecurityDomainTransferKeyResponse{RawResponse: resp} +func (client *HSMSecurityDomainClient) transferKeyHandleResponse(resp *http.Response) (HSMSecurityDomainClientTransferKeyResponse, error) { + result := HSMSecurityDomainClientTransferKeyResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.TransferKey); err != nil { - return HSMSecurityDomainTransferKeyResponse{}, err + return HSMSecurityDomainClientTransferKeyResponse{}, err } return result, nil } -// transferKeyHandleError handles the TransferKey error response. -func (client *HSMSecurityDomainClient) transferKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BeginUpload - Restore the provided Security Domain. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) BeginUpload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainBeginUploadOptions) (HSMSecurityDomainUploadPollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// securityDomain - The Security Domain to be restored. +// options - HSMSecurityDomainClientBeginUploadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginUpload +// method. +func (client *HSMSecurityDomainClient) BeginUpload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainClientBeginUploadOptions) (HSMSecurityDomainClientUploadPollerResponse, error) { resp, err := client.upload(ctx, vaultBaseURL, securityDomain, options) if err != nil { - return HSMSecurityDomainUploadPollerResponse{}, err + return HSMSecurityDomainClientUploadPollerResponse{}, err } - result := HSMSecurityDomainUploadPollerResponse{ + result := HSMSecurityDomainClientUploadPollerResponse{ RawResponse: resp, } - pt, err := runtime.NewPoller("HSMSecurityDomainClient.Upload", resp, client.con.Pipeline(), client.uploadHandleError) + pt, err := runtime.NewPoller("HSMSecurityDomainClient.Upload", resp, client.pl) if err != nil { - return HSMSecurityDomainUploadPollerResponse{}, err + return HSMSecurityDomainClientUploadPollerResponse{}, err } - result.Poller = &HSMSecurityDomainUploadPoller{ + result.Poller = &HSMSecurityDomainClientUploadPoller{ pt: pt, } return result, nil } // Upload - Restore the provided Security Domain. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) upload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainBeginUploadOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *HSMSecurityDomainClient) upload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainClientBeginUploadOptions) (*http.Response, error) { req, err := client.uploadCreateRequest(ctx, vaultBaseURL, securityDomain, options) if err != nil { return nil, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, client.uploadHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // uploadCreateRequest creates the Upload request. -func (client *HSMSecurityDomainClient) uploadCreateRequest(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainBeginUploadOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) uploadCreateRequest(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainClientBeginUploadOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/upload" @@ -251,38 +232,28 @@ func (client *HSMSecurityDomainClient) uploadCreateRequest(ctx context.Context, return req, runtime.MarshalAsJSON(req, securityDomain) } -// uploadHandleError handles the Upload error response. -func (client *HSMSecurityDomainClient) uploadHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // UploadPending - Get Security Domain upload operation status -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) UploadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainUploadPendingOptions) (HSMSecurityDomainUploadPendingResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - HSMSecurityDomainClientUploadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.UploadPending +// method. +func (client *HSMSecurityDomainClient) UploadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientUploadPendingOptions) (HSMSecurityDomainClientUploadPendingResponse, error) { req, err := client.uploadPendingCreateRequest(ctx, vaultBaseURL, options) if err != nil { - return HSMSecurityDomainUploadPendingResponse{}, err + return HSMSecurityDomainClientUploadPendingResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return HSMSecurityDomainUploadPendingResponse{}, err + return HSMSecurityDomainClientUploadPendingResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return HSMSecurityDomainUploadPendingResponse{}, client.uploadPendingHandleError(resp) + return HSMSecurityDomainClientUploadPendingResponse{}, runtime.NewResponseError(resp) } return client.uploadPendingHandleResponse(resp) } // uploadPendingCreateRequest creates the UploadPending request. -func (client *HSMSecurityDomainClient) uploadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainUploadPendingOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) uploadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientUploadPendingOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/upload/pending" @@ -295,23 +266,10 @@ func (client *HSMSecurityDomainClient) uploadPendingCreateRequest(ctx context.Co } // uploadPendingHandleResponse handles the UploadPending response. -func (client *HSMSecurityDomainClient) uploadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainUploadPendingResponse, error) { - result := HSMSecurityDomainUploadPendingResponse{RawResponse: resp} +func (client *HSMSecurityDomainClient) uploadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainClientUploadPendingResponse, error) { + result := HSMSecurityDomainClientUploadPendingResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SecurityDomainOperationStatus); err != nil { - return HSMSecurityDomainUploadPendingResponse{}, err + return HSMSecurityDomainClientUploadPendingResponse{}, err } return result, nil } - -// uploadPendingHandleError handles the UploadPending error response. -func (client *HSMSecurityDomainClient) uploadPendingHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azkeys/internal/generated/keyvaultclient_client.go b/sdk/keyvault/azkeys/internal/generated/keyvault_client.go similarity index 70% rename from sdk/keyvault/azkeys/internal/generated/keyvaultclient_client.go rename to sdk/keyvault/azkeys/internal/generated/keyvault_client.go index 5475a4b3e693..90ee07b40551 100644 --- a/sdk/keyvault/azkeys/internal/generated/keyvaultclient_client.go +++ b/sdk/keyvault/azkeys/internal/generated/keyvault_client.go @@ -6,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "context" "errors" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -23,36 +22,43 @@ import ( // KeyVaultClient contains the methods for the KeyVaultClient group. // Don't use this type directly, use NewKeyVaultClient() instead. type KeyVaultClient struct { - con *Connection + pl runtime.Pipeline } // NewKeyVaultClient creates a new instance of KeyVaultClient with the specified values. -func NewKeyVaultClient(con *Connection) *KeyVaultClient { - return &KeyVaultClient{con: con} -} - -// BackupKey - The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does NOT return key material in -// a form that can be used outside the Azure Key Vault system, -// the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this operation is to allow a client -// to GENERATE a key in one Azure Key Vault -// instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to export, in protected form, any -// key type from Azure Key Vault. Individual -// versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that a BACKUP from one geographical -// area cannot be restored to another -// geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This operation requires the key/backup -// permission. -// If the operation fails it returns the *KeyVaultError error type. +// pl - the pipeline used for sending requests and handling responses. +func NewKeyVaultClient(pl runtime.Pipeline) *KeyVaultClient { + client := &KeyVaultClient{ + pl: pl, + } + return client +} + +// BackupKey - The Key Backup operation exports a key from Azure Key Vault in a protected form. Note that this operation does +// NOT return key material in a form that can be used outside the Azure Key Vault system, +// the returned key material is either protected to a Azure Key Vault HSM or to Azure Key Vault itself. The intent of this +// operation is to allow a client to GENERATE a key in one Azure Key Vault +// instance, BACKUP the key, and then RESTORE it into another Azure Key Vault instance. The BACKUP operation may be used to +// export, in protected form, any key type from Azure Key Vault. Individual +// versions of a key cannot be backed up. BACKUP / RESTORE can be performed within geographical boundaries only; meaning that +// a BACKUP from one geographical area cannot be restored to another +// geographical area. For example, a backup from the US geographical area cannot be restored in an EU geographical area. This +// operation requires the key/backup permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// options - KeyVaultClientBackupKeyOptions contains the optional parameters for the KeyVaultClient.BackupKey method. func (client *KeyVaultClient) BackupKey(ctx context.Context, vaultBaseURL string, keyName string, options *KeyVaultClientBackupKeyOptions) (KeyVaultClientBackupKeyResponse, error) { req, err := client.backupKeyCreateRequest(ctx, vaultBaseURL, keyName, options) if err != nil { return KeyVaultClientBackupKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientBackupKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientBackupKeyResponse{}, client.backupKeyHandleError(resp) + return KeyVaultClientBackupKeyResponse{}, runtime.NewResponseError(resp) } return client.backupKeyHandleResponse(resp) } @@ -86,34 +92,25 @@ func (client *KeyVaultClient) backupKeyHandleResponse(resp *http.Response) (KeyV return result, nil } -// backupKeyHandleError handles the BackupKey error response. -func (client *KeyVaultClient) backupKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// CreateKey - The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates -// a new version of the key. It requires the keys/create +// CreateKey - The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, +// Azure Key Vault creates a new version of the key. It requires the keys/create // permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name for the new key. The system will generate the version name for the new key. +// parameters - The parameters to create a key. +// options - KeyVaultClientCreateKeyOptions contains the optional parameters for the KeyVaultClient.CreateKey method. func (client *KeyVaultClient) CreateKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyCreateParameters, options *KeyVaultClientCreateKeyOptions) (KeyVaultClientCreateKeyResponse, error) { req, err := client.createKeyCreateRequest(ctx, vaultBaseURL, keyName, parameters, options) if err != nil { return KeyVaultClientCreateKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientCreateKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientCreateKeyResponse{}, client.createKeyHandleError(resp) + return KeyVaultClientCreateKeyResponse{}, runtime.NewResponseError(resp) } return client.createKeyHandleResponse(resp) } @@ -147,36 +144,28 @@ func (client *KeyVaultClient) createKeyHandleResponse(resp *http.Response) (KeyV return result, nil } -// createKeyHandleError handles the CreateKey error response. -func (client *KeyVaultClient) createKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// Decrypt - The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified algorithm. This operation is -// the reverse of the ENCRYPT operation; only a single block of -// data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT operation applies to asymmetric -// and symmetric keys stored in Azure Key Vault +// Decrypt - The DECRYPT operation decrypts a well-formed block of ciphertext using the target encryption key and specified +// algorithm. This operation is the reverse of the ENCRYPT operation; only a single block of +// data may be decrypted, the size of this block is dependent on the target key and the algorithm to be used. The DECRYPT +// operation applies to asymmetric and symmetric keys stored in Azure Key Vault // since it uses the private portion of the key. This operation requires the keys/decrypt permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// keyVersion - The version of the key. +// parameters - The parameters for the decryption operation. +// options - KeyVaultClientDecryptOptions contains the optional parameters for the KeyVaultClient.Decrypt method. func (client *KeyVaultClient) Decrypt(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters, options *KeyVaultClientDecryptOptions) (KeyVaultClientDecryptResponse, error) { req, err := client.decryptCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientDecryptResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientDecryptResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientDecryptResponse{}, client.decryptHandleError(resp) + return KeyVaultClientDecryptResponse{}, runtime.NewResponseError(resp) } return client.decryptHandleResponse(resp) } @@ -214,34 +203,24 @@ func (client *KeyVaultClient) decryptHandleResponse(resp *http.Response) (KeyVau return result, nil } -// decryptHandleError handles the Decrypt error response. -func (client *KeyVaultClient) decryptHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// DeleteKey - The delete key operation cannot be used to remove individual versions of a key. This operation removes the cryptographic material associated -// with the key, which means the key is not usable for +// DeleteKey - The delete key operation cannot be used to remove individual versions of a key. This operation removes the +// cryptographic material associated with the key, which means the key is not usable for // Sign/Verify, Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the keys/delete permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key to delete. +// options - KeyVaultClientDeleteKeyOptions contains the optional parameters for the KeyVaultClient.DeleteKey method. func (client *KeyVaultClient) DeleteKey(ctx context.Context, vaultBaseURL string, keyName string, options *KeyVaultClientDeleteKeyOptions) (KeyVaultClientDeleteKeyResponse, error) { req, err := client.deleteKeyCreateRequest(ctx, vaultBaseURL, keyName, options) if err != nil { return KeyVaultClientDeleteKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientDeleteKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientDeleteKeyResponse{}, client.deleteKeyHandleError(resp) + return KeyVaultClientDeleteKeyResponse{}, runtime.NewResponseError(resp) } return client.deleteKeyHandleResponse(resp) } @@ -275,38 +254,30 @@ func (client *KeyVaultClient) deleteKeyHandleResponse(resp *http.Response) (KeyV return result, nil } -// deleteKeyHandleError handles the DeleteKey error response. -func (client *KeyVaultClient) deleteKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// Encrypt - The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure Key Vault. Note that the ENCRYPT -// operation only supports a single block of data, the size -// of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly necessary for symmetric keys -// stored in Azure Key Vault since protection with an -// asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience for callers that have -// a key-reference but do not have access to the +// Encrypt - The ENCRYPT operation encrypts an arbitrary sequence of bytes using an encryption key that is stored in Azure +// Key Vault. Note that the ENCRYPT operation only supports a single block of data, the size +// of which is dependent on the target key and the encryption algorithm to be used. The ENCRYPT operation is only strictly +// necessary for symmetric keys stored in Azure Key Vault since protection with an +// asymmetric key can be performed using public portion of the key. This operation is supported for asymmetric keys as a convenience +// for callers that have a key-reference but do not have access to the // public key material. This operation requires the keys/encrypt permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// keyVersion - The version of the key. +// parameters - The parameters for the encryption operation. +// options - KeyVaultClientEncryptOptions contains the optional parameters for the KeyVaultClient.Encrypt method. func (client *KeyVaultClient) Encrypt(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters, options *KeyVaultClientEncryptOptions) (KeyVaultClientEncryptResponse, error) { req, err := client.encryptCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientEncryptResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientEncryptResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientEncryptResponse{}, client.encryptHandleError(resp) + return KeyVaultClientEncryptResponse{}, runtime.NewResponseError(resp) } return client.encryptHandleResponse(resp) } @@ -344,32 +315,25 @@ func (client *KeyVaultClient) encryptHandleResponse(resp *http.Response) (KeyVau return result, nil } -// encryptHandleError handles the Encrypt error response. -func (client *KeyVaultClient) encryptHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// Export - The export key operation is applicable to all key types. The target key must be marked exportable. This operation requires the keys/export permission. -// If the operation fails it returns the *KeyVaultError error type. +// Export - The export key operation is applicable to all key types. The target key must be marked exportable. This operation +// requires the keys/export permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key to get. +// keyVersion - Adding the version parameter retrieves a specific version of a key. +// parameters - The parameters for the key export operation. +// options - KeyVaultClientExportOptions contains the optional parameters for the KeyVaultClient.Export method. func (client *KeyVaultClient) Export(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyExportParameters, options *KeyVaultClientExportOptions) (KeyVaultClientExportResponse, error) { req, err := client.exportCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientExportResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientExportResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientExportResponse{}, client.exportHandleError(resp) + return KeyVaultClientExportResponse{}, runtime.NewResponseError(resp) } return client.exportHandleResponse(resp) } @@ -407,34 +371,24 @@ func (client *KeyVaultClient) exportHandleResponse(resp *http.Response) (KeyVaul return result, nil } -// exportHandleError handles the Export error response. -func (client *KeyVaultClient) exportHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetDeletedKey - The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will -// return an error if invoked on a non soft-delete enabled vault. This +// GetDeletedKey - The Get Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be +// invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This // operation requires the keys/get permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// options - KeyVaultClientGetDeletedKeyOptions contains the optional parameters for the KeyVaultClient.GetDeletedKey method. func (client *KeyVaultClient) GetDeletedKey(ctx context.Context, vaultBaseURL string, keyName string, options *KeyVaultClientGetDeletedKeyOptions) (KeyVaultClientGetDeletedKeyResponse, error) { req, err := client.getDeletedKeyCreateRequest(ctx, vaultBaseURL, keyName, options) if err != nil { return KeyVaultClientGetDeletedKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientGetDeletedKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientGetDeletedKeyResponse{}, client.getDeletedKeyHandleError(resp) + return KeyVaultClientGetDeletedKeyResponse{}, runtime.NewResponseError(resp) } return client.getDeletedKeyHandleResponse(resp) } @@ -468,25 +422,14 @@ func (client *KeyVaultClient) getDeletedKeyHandleResponse(resp *http.Response) ( return result, nil } -// getDeletedKeyHandleError handles the GetDeletedKey error response. -func (client *KeyVaultClient) getDeletedKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetDeletedKeys - Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation -// includes deletion-specific information. The Get Deleted Keys -// operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a -// non soft-delete enabled vault. This operation +// GetDeletedKeys - Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part +// of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys +// operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return +// an error if invoked on a non soft-delete enabled vault. This operation // requires the keys/list permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - KeyVaultClientGetDeletedKeysOptions contains the optional parameters for the KeyVaultClient.GetDeletedKeys method. func (client *KeyVaultClient) GetDeletedKeys(vaultBaseURL string, options *KeyVaultClientGetDeletedKeysOptions) *KeyVaultClientGetDeletedKeysPager { return &KeyVaultClientGetDeletedKeysPager{ client: client, @@ -527,33 +470,25 @@ func (client *KeyVaultClient) getDeletedKeysHandleResponse(resp *http.Response) return result, nil } -// getDeletedKeysHandleError handles the GetDeletedKeys error response. -func (client *KeyVaultClient) getDeletedKeysHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetKey - The get key operation is applicable to all key types. If the requested key is symmetric, then no key material is released in the response. This -// operation requires the keys/get permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetKey - The get key operation is applicable to all key types. If the requested key is symmetric, then no key material +// is released in the response. This operation requires the keys/get permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key to get. +// keyVersion - Adding the version parameter retrieves a specific version of a key. This URI fragment is optional. If not +// specified, the latest version of the key is returned. +// options - KeyVaultClientGetKeyOptions contains the optional parameters for the KeyVaultClient.GetKey method. func (client *KeyVaultClient) GetKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, options *KeyVaultClientGetKeyOptions) (KeyVaultClientGetKeyResponse, error) { req, err := client.getKeyCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, options) if err != nil { return KeyVaultClientGetKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientGetKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientGetKeyResponse{}, client.getKeyHandleError(resp) + return KeyVaultClientGetKeyResponse{}, runtime.NewResponseError(resp) } return client.getKeyHandleResponse(resp) } @@ -591,33 +526,24 @@ func (client *KeyVaultClient) getKeyHandleResponse(resp *http.Response) (KeyVaul return result, nil } -// getKeyHandleError handles the GetKey error response. -func (client *KeyVaultClient) getKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetKeyRotationPolicy - The GetKeyRotationPolicy operation returns the specified key policy resources in the specified key vault. This operation requires -// the keys/get permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetKeyRotationPolicy - The GetKeyRotationPolicy operation returns the specified key policy resources in the specified key +// vault. This operation requires the keys/get permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key in a given key vault. +// options - KeyVaultClientGetKeyRotationPolicyOptions contains the optional parameters for the KeyVaultClient.GetKeyRotationPolicy +// method. func (client *KeyVaultClient) GetKeyRotationPolicy(ctx context.Context, vaultBaseURL string, keyName string, options *KeyVaultClientGetKeyRotationPolicyOptions) (KeyVaultClientGetKeyRotationPolicyResponse, error) { req, err := client.getKeyRotationPolicyCreateRequest(ctx, vaultBaseURL, keyName, options) if err != nil { return KeyVaultClientGetKeyRotationPolicyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientGetKeyRotationPolicyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientGetKeyRotationPolicyResponse{}, client.getKeyRotationPolicyHandleError(resp) + return KeyVaultClientGetKeyRotationPolicyResponse{}, runtime.NewResponseError(resp) } return client.getKeyRotationPolicyHandleResponse(resp) } @@ -651,21 +577,12 @@ func (client *KeyVaultClient) getKeyRotationPolicyHandleResponse(resp *http.Resp return result, nil } -// getKeyRotationPolicyHandleError handles the GetKeyRotationPolicy error response. -func (client *KeyVaultClient) getKeyRotationPolicyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetKeyVersions - The full key identifier, attributes, and tags are provided in the response. This operation requires the keys/list permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetKeyVersions - The full key identifier, attributes, and tags are provided in the response. This operation requires the +// keys/list permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// options - KeyVaultClientGetKeyVersionsOptions contains the optional parameters for the KeyVaultClient.GetKeyVersions method. func (client *KeyVaultClient) GetKeyVersions(vaultBaseURL string, keyName string, options *KeyVaultClientGetKeyVersionsOptions) *KeyVaultClientGetKeyVersionsPager { return &KeyVaultClientGetKeyVersionsPager{ client: client, @@ -710,24 +627,13 @@ func (client *KeyVaultClient) getKeyVersionsHandleResponse(resp *http.Response) return result, nil } -// getKeyVersionsHandleError handles the GetKeyVersions error response. -func (client *KeyVaultClient) getKeyVersionsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetKeys - Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is -// applicable to all key types, however only the base key -// identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the -// keys/list permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetKeys - Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored +// key. The LIST operation is applicable to all key types, however only the base key +// identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. +// This operation requires the keys/list permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - KeyVaultClientGetKeysOptions contains the optional parameters for the KeyVaultClient.GetKeys method. func (client *KeyVaultClient) GetKeys(vaultBaseURL string, options *KeyVaultClientGetKeysOptions) *KeyVaultClientGetKeysPager { return &KeyVaultClientGetKeysPager{ client: client, @@ -768,32 +674,22 @@ func (client *KeyVaultClient) getKeysHandleResponse(resp *http.Response) (KeyVau return result, nil } -// getKeysHandleError handles the GetKeys error response. -func (client *KeyVaultClient) getKeysHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetRandomBytes - Get the requested number of bytes containing random values from a managed HSM. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// parameters - The request object to get random bytes. +// options - KeyVaultClientGetRandomBytesOptions contains the optional parameters for the KeyVaultClient.GetRandomBytes method. func (client *KeyVaultClient) GetRandomBytes(ctx context.Context, vaultBaseURL string, parameters GetRandomBytesRequest, options *KeyVaultClientGetRandomBytesOptions) (KeyVaultClientGetRandomBytesResponse, error) { req, err := client.getRandomBytesCreateRequest(ctx, vaultBaseURL, parameters, options) if err != nil { return KeyVaultClientGetRandomBytesResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientGetRandomBytesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientGetRandomBytesResponse{}, client.getRandomBytesHandleError(resp) + return KeyVaultClientGetRandomBytesResponse{}, runtime.NewResponseError(resp) } return client.getRandomBytesHandleResponse(resp) } @@ -823,34 +719,25 @@ func (client *KeyVaultClient) getRandomBytesHandleResponse(resp *http.Response) return result, nil } -// getRandomBytesHandleError handles the GetRandomBytes error response. -func (client *KeyVaultClient) getRandomBytesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// ImportKey - The import key operation may be used to import any key type into an Azure Key Vault. If the named key already exists, Azure Key Vault creates -// a new version of the key. This operation requires the +// ImportKey - The import key operation may be used to import any key type into an Azure Key Vault. If the named key already +// exists, Azure Key Vault creates a new version of the key. This operation requires the // keys/import permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - Name for the imported key. +// parameters - The parameters to import a key. +// options - KeyVaultClientImportKeyOptions contains the optional parameters for the KeyVaultClient.ImportKey method. func (client *KeyVaultClient) ImportKey(ctx context.Context, vaultBaseURL string, keyName string, parameters KeyImportParameters, options *KeyVaultClientImportKeyOptions) (KeyVaultClientImportKeyResponse, error) { req, err := client.importKeyCreateRequest(ctx, vaultBaseURL, keyName, parameters, options) if err != nil { return KeyVaultClientImportKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientImportKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientImportKeyResponse{}, client.importKeyHandleError(resp) + return KeyVaultClientImportKeyResponse{}, runtime.NewResponseError(resp) } return client.importKeyHandleResponse(resp) } @@ -884,34 +771,25 @@ func (client *KeyVaultClient) importKeyHandleResponse(resp *http.Response) (KeyV return result, nil } -// importKeyHandleError handles the ImportKey error response. -func (client *KeyVaultClient) importKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// PurgeDeletedKey - The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can be invoked on any vault, it will -// return an error if invoked on a non soft-delete enabled vault. +// PurgeDeletedKey - The Purge Deleted Key operation is applicable for soft-delete enabled vaults. While the operation can +// be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. // This operation requires the keys/purge permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key +// options - KeyVaultClientPurgeDeletedKeyOptions contains the optional parameters for the KeyVaultClient.PurgeDeletedKey +// method. func (client *KeyVaultClient) PurgeDeletedKey(ctx context.Context, vaultBaseURL string, keyName string, options *KeyVaultClientPurgeDeletedKeyOptions) (KeyVaultClientPurgeDeletedKeyResponse, error) { req, err := client.purgeDeletedKeyCreateRequest(ctx, vaultBaseURL, keyName, options) if err != nil { return KeyVaultClientPurgeDeletedKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientPurgeDeletedKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return KeyVaultClientPurgeDeletedKeyResponse{}, client.purgeDeletedKeyHandleError(resp) + return KeyVaultClientPurgeDeletedKeyResponse{}, runtime.NewResponseError(resp) } return KeyVaultClientPurgeDeletedKeyResponse{RawResponse: resp}, nil } @@ -936,34 +814,26 @@ func (client *KeyVaultClient) purgeDeletedKeyCreateRequest(ctx context.Context, return req, nil } -// purgeDeletedKeyHandleError handles the PurgeDeletedKey error response. -func (client *KeyVaultClient) purgeDeletedKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// RecoverDeletedKey - The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back -// to its latest version under /keys. An attempt to recover an non-deleted -// key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission. -// If the operation fails it returns the *KeyVaultError error type. +// RecoverDeletedKey - The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It +// recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted +// key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation +// requires the keys/recover permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the deleted key. +// options - KeyVaultClientRecoverDeletedKeyOptions contains the optional parameters for the KeyVaultClient.RecoverDeletedKey +// method. func (client *KeyVaultClient) RecoverDeletedKey(ctx context.Context, vaultBaseURL string, keyName string, options *KeyVaultClientRecoverDeletedKeyOptions) (KeyVaultClientRecoverDeletedKeyResponse, error) { req, err := client.recoverDeletedKeyCreateRequest(ctx, vaultBaseURL, keyName, options) if err != nil { return KeyVaultClientRecoverDeletedKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientRecoverDeletedKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientRecoverDeletedKeyResponse{}, client.recoverDeletedKeyHandleError(resp) + return KeyVaultClientRecoverDeletedKeyResponse{}, runtime.NewResponseError(resp) } return client.recoverDeletedKeyHandleResponse(resp) } @@ -997,33 +867,25 @@ func (client *KeyVaultClient) recoverDeletedKeyHandleResponse(resp *http.Respons return result, nil } -// recoverDeletedKeyHandleError handles the RecoverDeletedKey error response. -func (client *KeyVaultClient) recoverDeletedKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// Release - The release key operation is applicable to all key types. The target key must be marked exportable. This operation requires the keys/release -// permission. -// If the operation fails it returns the *KeyVaultError error type. +// Release - The release key operation is applicable to all key types. The target key must be marked exportable. This operation +// requires the keys/release permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key to get. +// keyVersion - Adding the version parameter retrieves a specific version of a key. +// parameters - The parameters for the key release operation. +// options - KeyVaultClientReleaseOptions contains the optional parameters for the KeyVaultClient.Release method. func (client *KeyVaultClient) Release(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyReleaseParameters, options *KeyVaultClientReleaseOptions) (KeyVaultClientReleaseResponse, error) { req, err := client.releaseCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientReleaseResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientReleaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientReleaseResponse{}, client.releaseHandleError(resp) + return KeyVaultClientReleaseResponse{}, runtime.NewResponseError(resp) } return client.releaseHandleResponse(resp) } @@ -1061,40 +923,30 @@ func (client *KeyVaultClient) releaseHandleResponse(resp *http.Response) (KeyVau return result, nil } -// releaseHandleError handles the Release error response. -func (client *KeyVaultClient) releaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// RestoreKey - Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes and access control policies. -// The RESTORE operation may be used to import a previously backed -// up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as it had when it was backed up. -// If the key name is not available in the target Key -// Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier will change if the key is restored -// to a different vault. Restore will restore all -// versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault must be owned by the same Microsoft -// Azure Subscription as the source Key Vault +// RestoreKey - Imports a previously backed up key into Azure Key Vault, restoring the key, its key identifier, attributes +// and access control policies. The RESTORE operation may be used to import a previously backed +// up key. Individual versions of a key cannot be restored. The key is restored in its entirety with the same key name as +// it had when it was backed up. If the key name is not available in the target Key +// Vault, the RESTORE operation will be rejected. While the key name is retained during restore, the final key identifier +// will change if the key is restored to a different vault. Restore will restore all +// versions and preserve version identifiers. The RESTORE operation is subject to security constraints: The target Key Vault +// must be owned by the same Microsoft Azure Subscription as the source Key Vault // The user must have RESTORE permission in the target Key Vault. This operation requires the keys/restore permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// parameters - The parameters to restore the key. +// options - KeyVaultClientRestoreKeyOptions contains the optional parameters for the KeyVaultClient.RestoreKey method. func (client *KeyVaultClient) RestoreKey(ctx context.Context, vaultBaseURL string, parameters KeyRestoreParameters, options *KeyVaultClientRestoreKeyOptions) (KeyVaultClientRestoreKeyResponse, error) { req, err := client.restoreKeyCreateRequest(ctx, vaultBaseURL, parameters, options) if err != nil { return KeyVaultClientRestoreKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientRestoreKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientRestoreKeyResponse{}, client.restoreKeyHandleError(resp) + return KeyVaultClientRestoreKeyResponse{}, runtime.NewResponseError(resp) } return client.restoreKeyHandleResponse(resp) } @@ -1124,32 +976,22 @@ func (client *KeyVaultClient) restoreKeyHandleResponse(resp *http.Response) (Key return result, nil } -// restoreKeyHandleError handles the RestoreKey error response. -func (client *KeyVaultClient) restoreKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // RotateKey - The operation will rotate the key based on the key policy. It requires the keys/rotate permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of key to be rotated. The system will generate a new version in the specified key. +// options - KeyVaultClientRotateKeyOptions contains the optional parameters for the KeyVaultClient.RotateKey method. func (client *KeyVaultClient) RotateKey(ctx context.Context, vaultBaseURL string, keyName string, options *KeyVaultClientRotateKeyOptions) (KeyVaultClientRotateKeyResponse, error) { req, err := client.rotateKeyCreateRequest(ctx, vaultBaseURL, keyName, options) if err != nil { return KeyVaultClientRotateKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientRotateKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientRotateKeyResponse{}, client.rotateKeyHandleError(resp) + return KeyVaultClientRotateKeyResponse{}, runtime.NewResponseError(resp) } return client.rotateKeyHandleResponse(resp) } @@ -1183,33 +1025,25 @@ func (client *KeyVaultClient) rotateKeyHandleResponse(resp *http.Response) (KeyV return result, nil } -// rotateKeyHandleError handles the RotateKey error response. -func (client *KeyVaultClient) rotateKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// Sign - The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation uses the private portion of the -// key. This operation requires the keys/sign permission. -// If the operation fails it returns the *KeyVaultError error type. +// Sign - The SIGN operation is applicable to asymmetric and symmetric keys stored in Azure Key Vault since this operation +// uses the private portion of the key. This operation requires the keys/sign permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// keyVersion - The version of the key. +// parameters - The parameters for the signing operation. +// options - KeyVaultClientSignOptions contains the optional parameters for the KeyVaultClient.Sign method. func (client *KeyVaultClient) Sign(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeySignParameters, options *KeyVaultClientSignOptions) (KeyVaultClientSignResponse, error) { req, err := client.signCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientSignResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientSignResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientSignResponse{}, client.signHandleError(resp) + return KeyVaultClientSignResponse{}, runtime.NewResponseError(resp) } return client.signHandleResponse(resp) } @@ -1247,34 +1081,27 @@ func (client *KeyVaultClient) signHandleResponse(resp *http.Response) (KeyVaultC return result, nil } -// signHandleError handles the Sign error response. -func (client *KeyVaultClient) signHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// UnwrapKey - The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation is the reverse of the WRAP -// operation. The UNWRAP operation applies to asymmetric and -// symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey permission. -// If the operation fails it returns the *KeyVaultError error type. +// UnwrapKey - The UNWRAP operation supports decryption of a symmetric key using the target key encryption key. This operation +// is the reverse of the WRAP operation. The UNWRAP operation applies to asymmetric and +// symmetric keys stored in Azure Key Vault since it uses the private portion of the key. This operation requires the keys/unwrapKey +// permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// keyVersion - The version of the key. +// parameters - The parameters for the key operation. +// options - KeyVaultClientUnwrapKeyOptions contains the optional parameters for the KeyVaultClient.UnwrapKey method. func (client *KeyVaultClient) UnwrapKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters, options *KeyVaultClientUnwrapKeyOptions) (KeyVaultClientUnwrapKeyResponse, error) { req, err := client.unwrapKeyCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientUnwrapKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientUnwrapKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientUnwrapKeyResponse{}, client.unwrapKeyHandleError(resp) + return KeyVaultClientUnwrapKeyResponse{}, runtime.NewResponseError(resp) } return client.unwrapKeyHandleResponse(resp) } @@ -1312,33 +1139,25 @@ func (client *KeyVaultClient) unwrapKeyHandleResponse(resp *http.Response) (KeyV return result, nil } -// unwrapKeyHandleError handles the UnwrapKey error response. -func (client *KeyVaultClient) unwrapKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// UpdateKey - In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot -// be changed. This operation requires the keys/update permission. -// If the operation fails it returns the *KeyVaultError error type. +// UpdateKey - In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material +// of a key itself cannot be changed. This operation requires the keys/update permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of key to update. +// keyVersion - The version of the key to update. +// parameters - The parameters of the key to update. +// options - KeyVaultClientUpdateKeyOptions contains the optional parameters for the KeyVaultClient.UpdateKey method. func (client *KeyVaultClient) UpdateKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyUpdateParameters, options *KeyVaultClientUpdateKeyOptions) (KeyVaultClientUpdateKeyResponse, error) { req, err := client.updateKeyCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientUpdateKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientUpdateKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientUpdateKeyResponse{}, client.updateKeyHandleError(resp) + return KeyVaultClientUpdateKeyResponse{}, runtime.NewResponseError(resp) } return client.updateKeyHandleResponse(resp) } @@ -1376,32 +1195,25 @@ func (client *KeyVaultClient) updateKeyHandleResponse(resp *http.Response) (KeyV return result, nil } -// updateKeyHandleError handles the UpdateKey error response. -func (client *KeyVaultClient) updateKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// UpdateKeyRotationPolicy - Set specified members in the key policy. Leave others as undefined. This operation requires the keys/update permission. -// If the operation fails it returns the *KeyVaultError error type. +// UpdateKeyRotationPolicy - Set specified members in the key policy. Leave others as undefined. This operation requires the +// keys/update permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key in the given vault. +// keyRotationPolicy - The policy for the key. +// options - KeyVaultClientUpdateKeyRotationPolicyOptions contains the optional parameters for the KeyVaultClient.UpdateKeyRotationPolicy +// method. func (client *KeyVaultClient) UpdateKeyRotationPolicy(ctx context.Context, vaultBaseURL string, keyName string, keyRotationPolicy KeyRotationPolicy, options *KeyVaultClientUpdateKeyRotationPolicyOptions) (KeyVaultClientUpdateKeyRotationPolicyResponse, error) { req, err := client.updateKeyRotationPolicyCreateRequest(ctx, vaultBaseURL, keyName, keyRotationPolicy, options) if err != nil { return KeyVaultClientUpdateKeyRotationPolicyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientUpdateKeyRotationPolicyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientUpdateKeyRotationPolicyResponse{}, client.updateKeyRotationPolicyHandleError(resp) + return KeyVaultClientUpdateKeyRotationPolicyResponse{}, runtime.NewResponseError(resp) } return client.updateKeyRotationPolicyHandleResponse(resp) } @@ -1435,36 +1247,28 @@ func (client *KeyVaultClient) updateKeyRotationPolicyHandleResponse(resp *http.R return result, nil } -// updateKeyRotationPolicyHandleError handles the UpdateKeyRotationPolicy error response. -func (client *KeyVaultClient) updateKeyRotationPolicyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// Verify - The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary for asymmetric keys stored -// in Azure Key Vault since signature verification can be -// performed using the public portion of the key but this operation is supported as a convenience for callers that only have a key-reference and not the -// public portion of the key. This operation requires +// Verify - The VERIFY operation is applicable to symmetric keys stored in Azure Key Vault. VERIFY is not strictly necessary +// for asymmetric keys stored in Azure Key Vault since signature verification can be +// performed using the public portion of the key but this operation is supported as a convenience for callers that only have +// a key-reference and not the public portion of the key. This operation requires // the keys/verify permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// keyVersion - The version of the key. +// parameters - The parameters for verify operations. +// options - KeyVaultClientVerifyOptions contains the optional parameters for the KeyVaultClient.Verify method. func (client *KeyVaultClient) Verify(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyVerifyParameters, options *KeyVaultClientVerifyOptions) (KeyVaultClientVerifyResponse, error) { req, err := client.verifyCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientVerifyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientVerifyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientVerifyResponse{}, client.verifyHandleError(resp) + return KeyVaultClientVerifyResponse{}, runtime.NewResponseError(resp) } return client.verifyHandleResponse(resp) } @@ -1502,36 +1306,29 @@ func (client *KeyVaultClient) verifyHandleResponse(resp *http.Response) (KeyVaul return result, nil } -// verifyHandleError handles the Verify error response. -func (client *KeyVaultClient) verifyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// WrapKey - The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault. -// The WRAP operation is only strictly necessary for symmetric -// keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key. This operation is supported -// for asymmetric keys as a convenience for -// callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey permission. -// If the operation fails it returns the *KeyVaultError error type. +// WrapKey - The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been +// stored in an Azure Key Vault. The WRAP operation is only strictly necessary for symmetric +// keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the +// key. This operation is supported for asymmetric keys as a convenience for +// callers that have a key-reference but do not have access to the public key material. This operation requires the keys/wrapKey +// permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// keyName - The name of the key. +// keyVersion - The version of the key. +// parameters - The parameters for wrap operation. +// options - KeyVaultClientWrapKeyOptions contains the optional parameters for the KeyVaultClient.WrapKey method. func (client *KeyVaultClient) WrapKey(ctx context.Context, vaultBaseURL string, keyName string, keyVersion string, parameters KeyOperationsParameters, options *KeyVaultClientWrapKeyOptions) (KeyVaultClientWrapKeyResponse, error) { req, err := client.wrapKeyCreateRequest(ctx, vaultBaseURL, keyName, keyVersion, parameters, options) if err != nil { return KeyVaultClientWrapKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientWrapKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientWrapKeyResponse{}, client.wrapKeyHandleError(resp) + return KeyVaultClientWrapKeyResponse{}, runtime.NewResponseError(resp) } return client.wrapKeyHandleResponse(resp) } @@ -1568,16 +1365,3 @@ func (client *KeyVaultClient) wrapKeyHandleResponse(resp *http.Response) (KeyVau } return result, nil } - -// wrapKeyHandleError handles the WrapKey error response. -func (client *KeyVaultClient) wrapKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azkeys/internal/generated/models.go b/sdk/keyvault/azkeys/internal/generated/models.go index 21bbeafaef84..a9952e614c11 100644 --- a/sdk/keyvault/azkeys/internal/generated/models.go +++ b/sdk/keyvault/azkeys/internal/generated/models.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "encoding/json" @@ -37,7 +37,11 @@ type Attributes struct { // MarshalJSON implements the json.Marshaller interface for type Attributes. func (a Attributes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - a.marshalInternal(objectMap) + populateTimeUnix(objectMap, "created", a.Created) + populate(objectMap, "enabled", a.Enabled) + populateTimeUnix(objectMap, "exp", a.Expires) + populateTimeUnix(objectMap, "nbf", a.NotBefore) + populateTimeUnix(objectMap, "updated", a.Updated) return json.Marshal(objectMap) } @@ -47,18 +51,6 @@ func (a *Attributes) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &rawMsg); err != nil { return err } - return a.unmarshalInternal(rawMsg) -} - -func (a Attributes) marshalInternal(objectMap map[string]interface{}) { - populateTimeUnix(objectMap, "created", a.Created) - populate(objectMap, "enabled", a.Enabled) - populateTimeUnix(objectMap, "exp", a.Expires) - populateTimeUnix(objectMap, "nbf", a.NotBefore) - populateTimeUnix(objectMap, "updated", a.Updated) -} - -func (a *Attributes) unmarshalInternal(rawMsg map[string]json.RawMessage) error { for key, val := range rawMsg { var err error switch key { @@ -136,13 +128,28 @@ func (c CertificateInfoObject) MarshalJSON() ([]byte, error) { // DeletedKeyBundle - A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info type DeletedKeyBundle struct { - KeyBundle + // The key management attributes. + Attributes *KeyAttributes `json:"attributes,omitempty"` + + // The Json web key. + Key *JSONWebKey `json:"key,omitempty"` + // The url of the recovery object, used to identify and recover the deleted key. RecoveryID *string `json:"recoveryId,omitempty"` + // The policy rules under which the key can be exported. + ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` + + // Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags,omitempty"` + // READ-ONLY; The time when the key was deleted, in UTC DeletedDate *time.Time `json:"deletedDate,omitempty" azure:"ro"` + // READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will + // be true. + Managed *bool `json:"managed,omitempty" azure:"ro"` + // READ-ONLY; The time when the key is scheduled to be purged, in UTC ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"` } @@ -150,10 +157,14 @@ type DeletedKeyBundle struct { // MarshalJSON implements the json.Marshaller interface for type DeletedKeyBundle. func (d DeletedKeyBundle) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - d.KeyBundle.marshalInternal(objectMap) + populate(objectMap, "attributes", d.Attributes) populateTimeUnix(objectMap, "deletedDate", d.DeletedDate) + populate(objectMap, "key", d.Key) + populate(objectMap, "managed", d.Managed) populate(objectMap, "recoveryId", d.RecoveryID) + populate(objectMap, "release_policy", d.ReleasePolicy) populateTimeUnix(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } @@ -166,35 +177,59 @@ func (d *DeletedKeyBundle) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "attributes": + err = unpopulate(val, &d.Attributes) + delete(rawMsg, key) case "deletedDate": err = unpopulateTimeUnix(val, &d.DeletedDate) delete(rawMsg, key) + case "key": + err = unpopulate(val, &d.Key) + delete(rawMsg, key) + case "managed": + err = unpopulate(val, &d.Managed) + delete(rawMsg, key) case "recoveryId": err = unpopulate(val, &d.RecoveryID) delete(rawMsg, key) + case "release_policy": + err = unpopulate(val, &d.ReleasePolicy) + delete(rawMsg, key) case "scheduledPurgeDate": err = unpopulateTimeUnix(val, &d.ScheduledPurgeDate) delete(rawMsg, key) + case "tags": + err = unpopulate(val, &d.Tags) + delete(rawMsg, key) } if err != nil { return err } } - if err := d.KeyBundle.unmarshalInternal(rawMsg); err != nil { - return err - } return nil } // DeletedKeyItem - The deleted key item containing the deleted key metadata and information about deletion. type DeletedKeyItem struct { - KeyItem + // The key management attributes. + Attributes *KeyAttributes `json:"attributes,omitempty"` + + // Key identifier. + Kid *string `json:"kid,omitempty"` + // The url of the recovery object, used to identify and recover the deleted key. RecoveryID *string `json:"recoveryId,omitempty"` + // Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags,omitempty"` + // READ-ONLY; The time when the key was deleted, in UTC DeletedDate *time.Time `json:"deletedDate,omitempty" azure:"ro"` + // READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will + // be true. + Managed *bool `json:"managed,omitempty" azure:"ro"` + // READ-ONLY; The time when the key is scheduled to be purged, in UTC ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"` } @@ -202,10 +237,13 @@ type DeletedKeyItem struct { // MarshalJSON implements the json.Marshaller interface for type DeletedKeyItem. func (d DeletedKeyItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - d.KeyItem.marshalInternal(objectMap) + populate(objectMap, "attributes", d.Attributes) populateTimeUnix(objectMap, "deletedDate", d.DeletedDate) + populate(objectMap, "kid", d.Kid) + populate(objectMap, "managed", d.Managed) populate(objectMap, "recoveryId", d.RecoveryID) populateTimeUnix(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } @@ -218,23 +256,32 @@ func (d *DeletedKeyItem) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "attributes": + err = unpopulate(val, &d.Attributes) + delete(rawMsg, key) case "deletedDate": err = unpopulateTimeUnix(val, &d.DeletedDate) delete(rawMsg, key) + case "kid": + err = unpopulate(val, &d.Kid) + delete(rawMsg, key) + case "managed": + err = unpopulate(val, &d.Managed) + delete(rawMsg, key) case "recoveryId": err = unpopulate(val, &d.RecoveryID) delete(rawMsg, key) case "scheduledPurgeDate": err = unpopulateTimeUnix(val, &d.ScheduledPurgeDate) delete(rawMsg, key) + case "tags": + err = unpopulate(val, &d.Tags) + delete(rawMsg, key) } if err != nil { return err } } - if err := d.KeyItem.unmarshalInternal(rawMsg); err != nil { - return err - } return nil } @@ -243,7 +290,8 @@ type DeletedKeyListResult struct { // READ-ONLY; The URL to get the next set of deleted keys. NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // READ-ONLY; A response message containing a list of deleted keys in the vault along with a link to the next page of deleted keys + // READ-ONLY; A response message containing a list of deleted keys in the vault along with a link to the next page of deleted + // keys Value []*DeletedKeyItem `json:"value,omitempty" azure:"ro"` } @@ -273,28 +321,33 @@ type GetRandomBytesRequest struct { Count *int32 `json:"count,omitempty"` } -// HSMSecurityDomainBeginDownloadOptions contains the optional parameters for the HSMSecurityDomain.BeginDownload method. -type HSMSecurityDomainBeginDownloadOptions struct { +// HSMSecurityDomainClientBeginDownloadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginDownload +// method. +type HSMSecurityDomainClientBeginDownloadOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainBeginUploadOptions contains the optional parameters for the HSMSecurityDomain.BeginUpload method. -type HSMSecurityDomainBeginUploadOptions struct { +// HSMSecurityDomainClientBeginUploadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginUpload +// method. +type HSMSecurityDomainClientBeginUploadOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainDownloadPendingOptions contains the optional parameters for the HSMSecurityDomain.DownloadPending method. -type HSMSecurityDomainDownloadPendingOptions struct { +// HSMSecurityDomainClientDownloadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.DownloadPending +// method. +type HSMSecurityDomainClientDownloadPendingOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainTransferKeyOptions contains the optional parameters for the HSMSecurityDomain.TransferKey method. -type HSMSecurityDomainTransferKeyOptions struct { +// HSMSecurityDomainClientTransferKeyOptions contains the optional parameters for the HSMSecurityDomainClient.TransferKey +// method. +type HSMSecurityDomainClientTransferKeyOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainUploadPendingOptions contains the optional parameters for the HSMSecurityDomain.UploadPending method. -type HSMSecurityDomainUploadPendingOptions struct { +// HSMSecurityDomainClientUploadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.UploadPending +// method. +type HSMSecurityDomainClientUploadPendingOptions struct { // placeholder for future optional parameters } @@ -436,26 +489,44 @@ func (j *JSONWebKey) UnmarshalJSON(data []byte) error { // KeyAttributes - The attributes of a key managed by the key vault service. type KeyAttributes struct { - Attributes + // Determines whether the object is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // Expiry date in UTC. + Expires *time.Time `json:"exp,omitempty"` + // Indicates if the private key can be exported. Exportable *bool `json:"exportable,omitempty"` + // Not before date in UTC. + NotBefore *time.Time `json:"nbf,omitempty"` + + // READ-ONLY; Creation time in UTC. + Created *time.Time `json:"created,omitempty" azure:"ro"` + // READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. RecoverableDays *int32 `json:"recoverableDays,omitempty" azure:"ro"` - // READ-ONLY; Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently - // deleted by a privileged user; otherwise, only the system + // READ-ONLY; Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' + // the key can be permanently deleted by a privileged user; otherwise, only the system // can purge the key, at the end of the retention interval. RecoveryLevel *DeletionRecoveryLevel `json:"recoveryLevel,omitempty" azure:"ro"` + + // READ-ONLY; Last updated time in UTC. + Updated *time.Time `json:"updated,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type KeyAttributes. func (k KeyAttributes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - k.Attributes.marshalInternal(objectMap) + populateTimeUnix(objectMap, "created", k.Created) + populate(objectMap, "enabled", k.Enabled) + populateTimeUnix(objectMap, "exp", k.Expires) populate(objectMap, "exportable", k.Exportable) + populateTimeUnix(objectMap, "nbf", k.NotBefore) populate(objectMap, "recoverableDays", k.RecoverableDays) populate(objectMap, "recoveryLevel", k.RecoveryLevel) + populateTimeUnix(objectMap, "updated", k.Updated) return json.Marshal(objectMap) } @@ -468,23 +539,35 @@ func (k *KeyAttributes) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "created": + err = unpopulateTimeUnix(val, &k.Created) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &k.Enabled) + delete(rawMsg, key) + case "exp": + err = unpopulateTimeUnix(val, &k.Expires) + delete(rawMsg, key) case "exportable": err = unpopulate(val, &k.Exportable) delete(rawMsg, key) + case "nbf": + err = unpopulateTimeUnix(val, &k.NotBefore) + delete(rawMsg, key) case "recoverableDays": err = unpopulate(val, &k.RecoverableDays) delete(rawMsg, key) case "recoveryLevel": err = unpopulate(val, &k.RecoveryLevel) delete(rawMsg, key) + case "updated": + err = unpopulateTimeUnix(val, &k.Updated) + delete(rawMsg, key) } if err != nil { return err } } - if err := k.Attributes.unmarshalInternal(rawMsg); err != nil { - return err - } return nil } @@ -502,59 +585,20 @@ type KeyBundle struct { // Application specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + // READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will + // be true. Managed *bool `json:"managed,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type KeyBundle. func (k KeyBundle) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - k.marshalInternal(objectMap) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyBundle. -func (k *KeyBundle) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - return k.unmarshalInternal(rawMsg) -} - -func (k KeyBundle) marshalInternal(objectMap map[string]interface{}) { populate(objectMap, "attributes", k.Attributes) populate(objectMap, "key", k.Key) populate(objectMap, "managed", k.Managed) populate(objectMap, "release_policy", k.ReleasePolicy) populate(objectMap, "tags", k.Tags) -} - -func (k *KeyBundle) unmarshalInternal(rawMsg map[string]json.RawMessage) error { - for key, val := range rawMsg { - var err error - switch key { - case "attributes": - err = unpopulate(val, &k.Attributes) - delete(rawMsg, key) - case "key": - err = unpopulate(val, &k.Key) - delete(rawMsg, key) - case "managed": - err = unpopulate(val, &k.Managed) - delete(rawMsg, key) - case "release_policy": - err = unpopulate(val, &k.ReleasePolicy) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, &k.Tags) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil + return json.Marshal(objectMap) } // KeyCreateParameters - The key create parameters. @@ -648,55 +692,19 @@ type KeyItem struct { // Application specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + // READ-ONLY; True if the key's lifetime is managed by key vault. If this is a key backing a certificate, then managed will + // be true. Managed *bool `json:"managed,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type KeyItem. func (k KeyItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - k.marshalInternal(objectMap) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyItem. -func (k *KeyItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - return k.unmarshalInternal(rawMsg) -} - -func (k KeyItem) marshalInternal(objectMap map[string]interface{}) { populate(objectMap, "attributes", k.Attributes) populate(objectMap, "kid", k.Kid) populate(objectMap, "managed", k.Managed) populate(objectMap, "tags", k.Tags) -} - -func (k *KeyItem) unmarshalInternal(rawMsg map[string]json.RawMessage) error { - for key, val := range rawMsg { - var err error - switch key { - case "attributes": - err = unpopulate(val, &k.Attributes) - delete(rawMsg, key) - case "kid": - err = unpopulate(val, &k.Kid) - delete(rawMsg, key) - case "managed": - err = unpopulate(val, &k.Managed) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, &k.Tags) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil + return json.Marshal(objectMap) } // KeyListResult - The key list result. @@ -951,8 +959,8 @@ type KeyRotationPolicy struct { // The key rotation policy attributes. Attributes *KeyRotationPolicyAttributes `json:"attributes,omitempty"` - // Actions that will be performed by Key Vault over the lifetime of a key. For preview, lifetimeActions can only have two items at maximum: one for rotate, - // one for notify. Notification time would be + // Actions that will be performed by Key Vault over the lifetime of a key. For preview, lifetimeActions can only have two + // items at maximum: one for rotate, one for notify. Notification time would be // default to 30 days before expiry and it is not configurable. LifetimeActions []*LifetimeActions `json:"lifetimeActions,omitempty"` @@ -971,8 +979,8 @@ func (k KeyRotationPolicy) MarshalJSON() ([]byte, error) { // KeyRotationPolicyAttributes - The key rotation policy attributes. type KeyRotationPolicyAttributes struct { - // The expiryTime will be applied on the new key version. It should be at least 28 days. It will be in ISO 8601 Format. Examples: 90 days: P90D, 3 months: - // P3M, 48 hours: PT48H, 1 year and 10 days: P1Y10D + // The expiryTime will be applied on the new key version. It should be at least 28 days. It will be in ISO 8601 Format. Examples: + // 90 days: P90D, 3 months: P3M, 48 hours: PT48H, 1 year and 10 days: P1Y10D ExpiryTime *string `json:"expiryTime,omitempty"` // READ-ONLY; The key rotation policy created time in UTC. @@ -1128,7 +1136,8 @@ type KeyVaultClientGetKeyOptions struct { // placeholder for future optional parameters } -// KeyVaultClientGetKeyRotationPolicyOptions contains the optional parameters for the KeyVaultClient.GetKeyRotationPolicy method. +// KeyVaultClientGetKeyRotationPolicyOptions contains the optional parameters for the KeyVaultClient.GetKeyRotationPolicy +// method. type KeyVaultClientGetKeyRotationPolicyOptions struct { // placeholder for future optional parameters } @@ -1195,7 +1204,8 @@ type KeyVaultClientUpdateKeyOptions struct { // placeholder for future optional parameters } -// KeyVaultClientUpdateKeyRotationPolicyOptions contains the optional parameters for the KeyVaultClient.UpdateKeyRotationPolicy method. +// KeyVaultClientUpdateKeyRotationPolicyOptions contains the optional parameters for the KeyVaultClient.UpdateKeyRotationPolicy +// method. type KeyVaultClientUpdateKeyRotationPolicyOptions struct { // placeholder for future optional parameters } @@ -1211,17 +1221,9 @@ type KeyVaultClientWrapKeyOptions struct { } // KeyVaultError - The key vault error exception. -// Implements the error and azcore.HTTPResponse interfaces. type KeyVaultError struct { - raw string // READ-ONLY; The key vault server error. - InnerError *Error `json:"error,omitempty" azure:"ro"` -} - -// Error implements the error interface for type KeyVaultError. -// The contents of the error text are not contractual and subject to change. -func (e KeyVaultError) Error() string { - return e.raw + Error *Error `json:"error,omitempty" azure:"ro"` } // KeyVerifyParameters - The key verify parameters. @@ -1288,7 +1290,8 @@ type LifetimeActions struct { // LifetimeActionsTrigger - A condition to be satisfied for an action to be executed. type LifetimeActionsTrigger struct { - // Time after creation to attempt to rotate. It only applies to rotate. It will be in ISO 8601 duration format. Example: 90 days : "P90D" + // Time after creation to attempt to rotate. It only applies to rotate. It will be in ISO 8601 duration format. Example: 90 + // days : "P90D" TimeAfterCreate *string `json:"timeAfterCreate,omitempty"` // Time before expiry to attempt to rotate or notify. It will be in ISO 8601 duration format. Example: 90 days : "P90D" @@ -1405,8 +1408,8 @@ func (r RoleAssignmentListResult) MarshalJSON() ([]byte, error) { // RoleAssignmentProperties - Role assignment properties. type RoleAssignmentProperties struct { - // REQUIRED; The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security - // group. + // REQUIRED; The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, + // service principal, or security group. PrincipalID *string `json:"principalId,omitempty"` // REQUIRED; The role definition ID used in the role assignment. @@ -1425,25 +1428,26 @@ type RoleAssignmentPropertiesWithScope struct { Scope *RoleScope `json:"scope,omitempty"` } -// RoleAssignmentsCreateOptions contains the optional parameters for the RoleAssignments.Create method. -type RoleAssignmentsCreateOptions struct { +// RoleAssignmentsClientCreateOptions contains the optional parameters for the RoleAssignmentsClient.Create method. +type RoleAssignmentsClientCreateOptions struct { // placeholder for future optional parameters } -// RoleAssignmentsDeleteOptions contains the optional parameters for the RoleAssignments.Delete method. -type RoleAssignmentsDeleteOptions struct { +// RoleAssignmentsClientDeleteOptions contains the optional parameters for the RoleAssignmentsClient.Delete method. +type RoleAssignmentsClientDeleteOptions struct { // placeholder for future optional parameters } -// RoleAssignmentsGetOptions contains the optional parameters for the RoleAssignments.Get method. -type RoleAssignmentsGetOptions struct { +// RoleAssignmentsClientGetOptions contains the optional parameters for the RoleAssignmentsClient.Get method. +type RoleAssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// RoleAssignmentsListForScopeOptions contains the optional parameters for the RoleAssignments.ListForScope method. -type RoleAssignmentsListForScopeOptions struct { - // The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to - // return all role assignments at, above or below the scope for the specified principal. +// RoleAssignmentsClientListForScopeOptions contains the optional parameters for the RoleAssignmentsClient.ListForScope method. +type RoleAssignmentsClientListForScopeOptions struct { + // The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId + // eq {id} to return all role assignments at, above or below the + // scope for the specified principal. Filter *string } @@ -1520,23 +1524,24 @@ func (r RoleDefinitionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// RoleDefinitionsCreateOrUpdateOptions contains the optional parameters for the RoleDefinitions.CreateOrUpdate method. -type RoleDefinitionsCreateOrUpdateOptions struct { +// RoleDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the RoleDefinitionsClient.CreateOrUpdate +// method. +type RoleDefinitionsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// RoleDefinitionsDeleteOptions contains the optional parameters for the RoleDefinitions.Delete method. -type RoleDefinitionsDeleteOptions struct { +// RoleDefinitionsClientDeleteOptions contains the optional parameters for the RoleDefinitionsClient.Delete method. +type RoleDefinitionsClientDeleteOptions struct { // placeholder for future optional parameters } -// RoleDefinitionsGetOptions contains the optional parameters for the RoleDefinitions.Get method. -type RoleDefinitionsGetOptions struct { +// RoleDefinitionsClientGetOptions contains the optional parameters for the RoleDefinitionsClient.Get method. +type RoleDefinitionsClientGetOptions struct { // placeholder for future optional parameters } -// RoleDefinitionsListOptions contains the optional parameters for the RoleDefinitions.List method. -type RoleDefinitionsListOptions struct { +// RoleDefinitionsClientListOptions contains the optional parameters for the RoleDefinitionsClient.List method. +type RoleDefinitionsClientListOptions struct { // The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well. Filter *string } @@ -1554,8 +1559,8 @@ type SecurityDomainJSONWebKey struct { // REQUIRED; Key identifier. Kid *string `json:"kid,omitempty"` - // REQUIRED; JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. For Security Domain this value - // must be RSA. + // REQUIRED; JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + // For Security Domain this value must be RSA. Kty *string `json:"kty,omitempty"` // REQUIRED; RSA modulus. diff --git a/sdk/keyvault/azkeys/internal/generated/pagers.go b/sdk/keyvault/azkeys/internal/generated/pagers.go index 8654ece6860e..a7675562c748 100644 --- a/sdk/keyvault/azkeys/internal/generated/pagers.go +++ b/sdk/keyvault/azkeys/internal/generated/pagers.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "context" @@ -47,13 +47,13 @@ func (p *KeyVaultClientGetDeletedKeysPager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.getDeletedKeysHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.getDeletedKeysHandleResponse(resp) @@ -101,13 +101,13 @@ func (p *KeyVaultClientGetKeyVersionsPager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.getKeyVersionsHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.getKeyVersionsHandleResponse(resp) @@ -155,13 +155,13 @@ func (p *KeyVaultClientGetKeysPager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.getKeysHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.getKeysHandleResponse(resp) @@ -178,23 +178,23 @@ func (p *KeyVaultClientGetKeysPager) PageResponse() KeyVaultClientGetKeysRespons return p.current } -// RoleAssignmentsListForScopePager provides operations for iterating over paged responses. -type RoleAssignmentsListForScopePager struct { +// RoleAssignmentsClientListForScopePager provides operations for iterating over paged responses. +type RoleAssignmentsClientListForScopePager struct { client *RoleAssignmentsClient - current RoleAssignmentsListForScopeResponse + current RoleAssignmentsClientListForScopeResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, RoleAssignmentsListForScopeResponse) (*policy.Request, error) + advancer func(context.Context, RoleAssignmentsClientListForScopeResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *RoleAssignmentsListForScopePager) Err() error { +func (p *RoleAssignmentsClientListForScopePager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *RoleAssignmentsListForScopePager) NextPage(ctx context.Context) bool { +func (p *RoleAssignmentsClientListForScopePager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { @@ -209,13 +209,13 @@ func (p *RoleAssignmentsListForScopePager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listForScopeHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listForScopeHandleResponse(resp) @@ -227,28 +227,28 @@ func (p *RoleAssignmentsListForScopePager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current RoleAssignmentsListForScopeResponse page. -func (p *RoleAssignmentsListForScopePager) PageResponse() RoleAssignmentsListForScopeResponse { +// PageResponse returns the current RoleAssignmentsClientListForScopeResponse page. +func (p *RoleAssignmentsClientListForScopePager) PageResponse() RoleAssignmentsClientListForScopeResponse { return p.current } -// RoleDefinitionsListPager provides operations for iterating over paged responses. -type RoleDefinitionsListPager struct { +// RoleDefinitionsClientListPager provides operations for iterating over paged responses. +type RoleDefinitionsClientListPager struct { client *RoleDefinitionsClient - current RoleDefinitionsListResponse + current RoleDefinitionsClientListResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, RoleDefinitionsListResponse) (*policy.Request, error) + advancer func(context.Context, RoleDefinitionsClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *RoleDefinitionsListPager) Err() error { +func (p *RoleDefinitionsClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *RoleDefinitionsListPager) NextPage(ctx context.Context) bool { +func (p *RoleDefinitionsClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { @@ -263,13 +263,13 @@ func (p *RoleDefinitionsListPager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) @@ -281,7 +281,7 @@ func (p *RoleDefinitionsListPager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current RoleDefinitionsListResponse page. -func (p *RoleDefinitionsListPager) PageResponse() RoleDefinitionsListResponse { +// PageResponse returns the current RoleDefinitionsClientListResponse page. +func (p *RoleDefinitionsClientListPager) PageResponse() RoleDefinitionsClientListResponse { return p.current } diff --git a/sdk/keyvault/azkeys/internal/generated/pollers.go b/sdk/keyvault/azkeys/internal/generated/pollers.go index 2b5e07174fe8..4f96c2593ab9 100644 --- a/sdk/keyvault/azkeys/internal/generated/pollers.go +++ b/sdk/keyvault/azkeys/internal/generated/pollers.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "context" @@ -14,13 +14,13 @@ import ( "net/http" ) -// HSMSecurityDomainDownloadPoller provides polling facilities until the operation reaches a terminal state. -type HSMSecurityDomainDownloadPoller struct { +// HSMSecurityDomainClientDownloadPoller provides polling facilities until the operation reaches a terminal state. +type HSMSecurityDomainClientDownloadPoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *HSMSecurityDomainDownloadPoller) Done() bool { +func (p *HSMSecurityDomainClientDownloadPoller) Done() bool { return p.pt.Done() } @@ -34,18 +34,18 @@ func (p *HSMSecurityDomainDownloadPoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *HSMSecurityDomainDownloadPoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *HSMSecurityDomainClientDownloadPoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final HSMSecurityDomainDownloadResponse will be returned. -func (p *HSMSecurityDomainDownloadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainDownloadResponse, error) { - respType := HSMSecurityDomainDownloadResponse{} +// If the final GET succeeded then the final HSMSecurityDomainClientDownloadResponse will be returned. +func (p *HSMSecurityDomainClientDownloadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainClientDownloadResponse, error) { + respType := HSMSecurityDomainClientDownloadResponse{} resp, err := p.pt.FinalResponse(ctx, &respType.SecurityDomainObject) if err != nil { - return HSMSecurityDomainDownloadResponse{}, err + return HSMSecurityDomainClientDownloadResponse{}, err } respType.RawResponse = resp return respType, nil @@ -53,17 +53,17 @@ func (p *HSMSecurityDomainDownloadPoller) FinalResponse(ctx context.Context) (HS // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *HSMSecurityDomainDownloadPoller) ResumeToken() (string, error) { +func (p *HSMSecurityDomainClientDownloadPoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// HSMSecurityDomainUploadPoller provides polling facilities until the operation reaches a terminal state. -type HSMSecurityDomainUploadPoller struct { +// HSMSecurityDomainClientUploadPoller provides polling facilities until the operation reaches a terminal state. +type HSMSecurityDomainClientUploadPoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *HSMSecurityDomainUploadPoller) Done() bool { +func (p *HSMSecurityDomainClientUploadPoller) Done() bool { return p.pt.Done() } @@ -77,18 +77,18 @@ func (p *HSMSecurityDomainUploadPoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *HSMSecurityDomainUploadPoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *HSMSecurityDomainClientUploadPoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final HSMSecurityDomainUploadResponse will be returned. -func (p *HSMSecurityDomainUploadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainUploadResponse, error) { - respType := HSMSecurityDomainUploadResponse{} +// If the final GET succeeded then the final HSMSecurityDomainClientUploadResponse will be returned. +func (p *HSMSecurityDomainClientUploadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainClientUploadResponse, error) { + respType := HSMSecurityDomainClientUploadResponse{} resp, err := p.pt.FinalResponse(ctx, &respType.SecurityDomainOperationStatus) if err != nil { - return HSMSecurityDomainUploadResponse{}, err + return HSMSecurityDomainClientUploadResponse{}, err } respType.RawResponse = resp return respType, nil @@ -96,6 +96,6 @@ func (p *HSMSecurityDomainUploadPoller) FinalResponse(ctx context.Context) (HSMS // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *HSMSecurityDomainUploadPoller) ResumeToken() (string, error) { +func (p *HSMSecurityDomainClientUploadPoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } diff --git a/sdk/keyvault/azkeys/internal/generated/response_types.go b/sdk/keyvault/azkeys/internal/generated/response_types.go index 3d17dd362d14..8a23005e2f25 100644 --- a/sdk/keyvault/azkeys/internal/generated/response_types.go +++ b/sdk/keyvault/azkeys/internal/generated/response_types.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "context" @@ -15,22 +15,22 @@ import ( "time" ) -// HSMSecurityDomainDownloadPendingResponse contains the response from method HSMSecurityDomain.DownloadPending. -type HSMSecurityDomainDownloadPendingResponse struct { - HSMSecurityDomainDownloadPendingResult +// HSMSecurityDomainClientDownloadPendingResponse contains the response from method HSMSecurityDomainClient.DownloadPending. +type HSMSecurityDomainClientDownloadPendingResponse struct { + HSMSecurityDomainClientDownloadPendingResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainDownloadPendingResult contains the result from method HSMSecurityDomain.DownloadPending. -type HSMSecurityDomainDownloadPendingResult struct { +// HSMSecurityDomainClientDownloadPendingResult contains the result from method HSMSecurityDomainClient.DownloadPending. +type HSMSecurityDomainClientDownloadPendingResult struct { SecurityDomainOperationStatus } -// HSMSecurityDomainDownloadPollerResponse contains the response from method HSMSecurityDomain.Download. -type HSMSecurityDomainDownloadPollerResponse struct { +// HSMSecurityDomainClientDownloadPollerResponse contains the response from method HSMSecurityDomainClient.Download. +type HSMSecurityDomainClientDownloadPollerResponse struct { // Poller contains an initialized poller. - Poller *HSMSecurityDomainDownloadPoller + Poller *HSMSecurityDomainClientDownloadPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -38,8 +38,8 @@ type HSMSecurityDomainDownloadPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -func (l HSMSecurityDomainDownloadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainDownloadResponse, error) { - respType := HSMSecurityDomainDownloadResponse{} +func (l HSMSecurityDomainClientDownloadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainClientDownloadResponse, error) { + respType := HSMSecurityDomainClientDownloadResponse{} resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SecurityDomainObject) if err != nil { return respType, err @@ -48,13 +48,13 @@ func (l HSMSecurityDomainDownloadPollerResponse) PollUntilDone(ctx context.Conte return respType, nil } -// Resume rehydrates a HSMSecurityDomainDownloadPollerResponse from the provided client and resume token. -func (l *HSMSecurityDomainDownloadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { - pt, err := runtime.NewPollerFromResumeToken("HSMSecurityDomainClient.Download", token, client.con.Pipeline(), client.downloadHandleError) +// Resume rehydrates a HSMSecurityDomainClientDownloadPollerResponse from the provided client and resume token. +func (l *HSMSecurityDomainClientDownloadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { + pt, err := runtime.NewPollerFromResumeToken("HSMSecurityDomainClient.Download", token, client.pl) if err != nil { return err } - poller := &HSMSecurityDomainDownloadPoller{ + poller := &HSMSecurityDomainClientDownloadPoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -66,46 +66,46 @@ func (l *HSMSecurityDomainDownloadPollerResponse) Resume(ctx context.Context, cl return nil } -// HSMSecurityDomainDownloadResponse contains the response from method HSMSecurityDomain.Download. -type HSMSecurityDomainDownloadResponse struct { - HSMSecurityDomainDownloadResult +// HSMSecurityDomainClientDownloadResponse contains the response from method HSMSecurityDomainClient.Download. +type HSMSecurityDomainClientDownloadResponse struct { + HSMSecurityDomainClientDownloadResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainDownloadResult contains the result from method HSMSecurityDomain.Download. -type HSMSecurityDomainDownloadResult struct { +// HSMSecurityDomainClientDownloadResult contains the result from method HSMSecurityDomainClient.Download. +type HSMSecurityDomainClientDownloadResult struct { SecurityDomainObject } -// HSMSecurityDomainTransferKeyResponse contains the response from method HSMSecurityDomain.TransferKey. -type HSMSecurityDomainTransferKeyResponse struct { - HSMSecurityDomainTransferKeyResult +// HSMSecurityDomainClientTransferKeyResponse contains the response from method HSMSecurityDomainClient.TransferKey. +type HSMSecurityDomainClientTransferKeyResponse struct { + HSMSecurityDomainClientTransferKeyResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainTransferKeyResult contains the result from method HSMSecurityDomain.TransferKey. -type HSMSecurityDomainTransferKeyResult struct { +// HSMSecurityDomainClientTransferKeyResult contains the result from method HSMSecurityDomainClient.TransferKey. +type HSMSecurityDomainClientTransferKeyResult struct { TransferKey } -// HSMSecurityDomainUploadPendingResponse contains the response from method HSMSecurityDomain.UploadPending. -type HSMSecurityDomainUploadPendingResponse struct { - HSMSecurityDomainUploadPendingResult +// HSMSecurityDomainClientUploadPendingResponse contains the response from method HSMSecurityDomainClient.UploadPending. +type HSMSecurityDomainClientUploadPendingResponse struct { + HSMSecurityDomainClientUploadPendingResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainUploadPendingResult contains the result from method HSMSecurityDomain.UploadPending. -type HSMSecurityDomainUploadPendingResult struct { +// HSMSecurityDomainClientUploadPendingResult contains the result from method HSMSecurityDomainClient.UploadPending. +type HSMSecurityDomainClientUploadPendingResult struct { SecurityDomainOperationStatus } -// HSMSecurityDomainUploadPollerResponse contains the response from method HSMSecurityDomain.Upload. -type HSMSecurityDomainUploadPollerResponse struct { +// HSMSecurityDomainClientUploadPollerResponse contains the response from method HSMSecurityDomainClient.Upload. +type HSMSecurityDomainClientUploadPollerResponse struct { // Poller contains an initialized poller. - Poller *HSMSecurityDomainUploadPoller + Poller *HSMSecurityDomainClientUploadPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -113,8 +113,8 @@ type HSMSecurityDomainUploadPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -func (l HSMSecurityDomainUploadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainUploadResponse, error) { - respType := HSMSecurityDomainUploadResponse{} +func (l HSMSecurityDomainClientUploadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainClientUploadResponse, error) { + respType := HSMSecurityDomainClientUploadResponse{} resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SecurityDomainOperationStatus) if err != nil { return respType, err @@ -123,13 +123,13 @@ func (l HSMSecurityDomainUploadPollerResponse) PollUntilDone(ctx context.Context return respType, nil } -// Resume rehydrates a HSMSecurityDomainUploadPollerResponse from the provided client and resume token. -func (l *HSMSecurityDomainUploadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { - pt, err := runtime.NewPollerFromResumeToken("HSMSecurityDomainClient.Upload", token, client.con.Pipeline(), client.uploadHandleError) +// Resume rehydrates a HSMSecurityDomainClientUploadPollerResponse from the provided client and resume token. +func (l *HSMSecurityDomainClientUploadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { + pt, err := runtime.NewPollerFromResumeToken("HSMSecurityDomainClient.Upload", token, client.pl) if err != nil { return err } - poller := &HSMSecurityDomainUploadPoller{ + poller := &HSMSecurityDomainClientUploadPoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -141,15 +141,15 @@ func (l *HSMSecurityDomainUploadPollerResponse) Resume(ctx context.Context, clie return nil } -// HSMSecurityDomainUploadResponse contains the response from method HSMSecurityDomain.Upload. -type HSMSecurityDomainUploadResponse struct { - HSMSecurityDomainUploadResult +// HSMSecurityDomainClientUploadResponse contains the response from method HSMSecurityDomainClient.Upload. +type HSMSecurityDomainClientUploadResponse struct { + HSMSecurityDomainClientUploadResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainUploadResult contains the result from method HSMSecurityDomain.Upload. -type HSMSecurityDomainUploadResult struct { +// HSMSecurityDomainClientUploadResult contains the result from method HSMSecurityDomainClient.Upload. +type HSMSecurityDomainClientUploadResult struct { SecurityDomainOperationStatus } @@ -447,98 +447,98 @@ type KeyVaultClientWrapKeyResult struct { KeyOperationResult } -// RoleAssignmentsCreateResponse contains the response from method RoleAssignments.Create. -type RoleAssignmentsCreateResponse struct { - RoleAssignmentsCreateResult +// RoleAssignmentsClientCreateResponse contains the response from method RoleAssignmentsClient.Create. +type RoleAssignmentsClientCreateResponse struct { + RoleAssignmentsClientCreateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsCreateResult contains the result from method RoleAssignments.Create. -type RoleAssignmentsCreateResult struct { +// RoleAssignmentsClientCreateResult contains the result from method RoleAssignmentsClient.Create. +type RoleAssignmentsClientCreateResult struct { RoleAssignment } -// RoleAssignmentsDeleteResponse contains the response from method RoleAssignments.Delete. -type RoleAssignmentsDeleteResponse struct { - RoleAssignmentsDeleteResult +// RoleAssignmentsClientDeleteResponse contains the response from method RoleAssignmentsClient.Delete. +type RoleAssignmentsClientDeleteResponse struct { + RoleAssignmentsClientDeleteResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsDeleteResult contains the result from method RoleAssignments.Delete. -type RoleAssignmentsDeleteResult struct { +// RoleAssignmentsClientDeleteResult contains the result from method RoleAssignmentsClient.Delete. +type RoleAssignmentsClientDeleteResult struct { RoleAssignment } -// RoleAssignmentsGetResponse contains the response from method RoleAssignments.Get. -type RoleAssignmentsGetResponse struct { - RoleAssignmentsGetResult +// RoleAssignmentsClientGetResponse contains the response from method RoleAssignmentsClient.Get. +type RoleAssignmentsClientGetResponse struct { + RoleAssignmentsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsGetResult contains the result from method RoleAssignments.Get. -type RoleAssignmentsGetResult struct { +// RoleAssignmentsClientGetResult contains the result from method RoleAssignmentsClient.Get. +type RoleAssignmentsClientGetResult struct { RoleAssignment } -// RoleAssignmentsListForScopeResponse contains the response from method RoleAssignments.ListForScope. -type RoleAssignmentsListForScopeResponse struct { - RoleAssignmentsListForScopeResult +// RoleAssignmentsClientListForScopeResponse contains the response from method RoleAssignmentsClient.ListForScope. +type RoleAssignmentsClientListForScopeResponse struct { + RoleAssignmentsClientListForScopeResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsListForScopeResult contains the result from method RoleAssignments.ListForScope. -type RoleAssignmentsListForScopeResult struct { +// RoleAssignmentsClientListForScopeResult contains the result from method RoleAssignmentsClient.ListForScope. +type RoleAssignmentsClientListForScopeResult struct { RoleAssignmentListResult } -// RoleDefinitionsCreateOrUpdateResponse contains the response from method RoleDefinitions.CreateOrUpdate. -type RoleDefinitionsCreateOrUpdateResponse struct { - RoleDefinitionsCreateOrUpdateResult +// RoleDefinitionsClientCreateOrUpdateResponse contains the response from method RoleDefinitionsClient.CreateOrUpdate. +type RoleDefinitionsClientCreateOrUpdateResponse struct { + RoleDefinitionsClientCreateOrUpdateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsCreateOrUpdateResult contains the result from method RoleDefinitions.CreateOrUpdate. -type RoleDefinitionsCreateOrUpdateResult struct { +// RoleDefinitionsClientCreateOrUpdateResult contains the result from method RoleDefinitionsClient.CreateOrUpdate. +type RoleDefinitionsClientCreateOrUpdateResult struct { RoleDefinition } -// RoleDefinitionsDeleteResponse contains the response from method RoleDefinitions.Delete. -type RoleDefinitionsDeleteResponse struct { - RoleDefinitionsDeleteResult +// RoleDefinitionsClientDeleteResponse contains the response from method RoleDefinitionsClient.Delete. +type RoleDefinitionsClientDeleteResponse struct { + RoleDefinitionsClientDeleteResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsDeleteResult contains the result from method RoleDefinitions.Delete. -type RoleDefinitionsDeleteResult struct { +// RoleDefinitionsClientDeleteResult contains the result from method RoleDefinitionsClient.Delete. +type RoleDefinitionsClientDeleteResult struct { RoleDefinition } -// RoleDefinitionsGetResponse contains the response from method RoleDefinitions.Get. -type RoleDefinitionsGetResponse struct { - RoleDefinitionsGetResult +// RoleDefinitionsClientGetResponse contains the response from method RoleDefinitionsClient.Get. +type RoleDefinitionsClientGetResponse struct { + RoleDefinitionsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsGetResult contains the result from method RoleDefinitions.Get. -type RoleDefinitionsGetResult struct { +// RoleDefinitionsClientGetResult contains the result from method RoleDefinitionsClient.Get. +type RoleDefinitionsClientGetResult struct { RoleDefinition } -// RoleDefinitionsListResponse contains the response from method RoleDefinitions.List. -type RoleDefinitionsListResponse struct { - RoleDefinitionsListResult +// RoleDefinitionsClientListResponse contains the response from method RoleDefinitionsClient.List. +type RoleDefinitionsClientListResponse struct { + RoleDefinitionsClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsListResult contains the result from method RoleDefinitions.List. -type RoleDefinitionsListResult struct { +// RoleDefinitionsClientListResult contains the result from method RoleDefinitionsClient.List. +type RoleDefinitionsClientListResult struct { RoleDefinitionListResult } diff --git a/sdk/keyvault/azkeys/internal/generated/roleassignments_client.go b/sdk/keyvault/azkeys/internal/generated/roleassignments_client.go index ed815e45f398..a11abecccd4d 100644 --- a/sdk/keyvault/azkeys/internal/generated/roleassignments_client.go +++ b/sdk/keyvault/azkeys/internal/generated/roleassignments_client.go @@ -6,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "context" "errors" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,39 +21,45 @@ import ( // RoleAssignmentsClient contains the methods for the RoleAssignments group. // Don't use this type directly, use NewRoleAssignmentsClient() instead. type RoleAssignmentsClient struct { - con *Connection + pl runtime.Pipeline } // NewRoleAssignmentsClient creates a new instance of RoleAssignmentsClient with the specified values. -func NewRoleAssignmentsClient(con *Connection) *RoleAssignmentsClient { - return &RoleAssignmentsClient{con: con} +// pl - the pipeline used for sending requests and handling responses. +func NewRoleAssignmentsClient(pl runtime.Pipeline) *RoleAssignmentsClient { + client := &RoleAssignmentsClient{ + pl: pl, + } + return client } // Create - Creates a role assignment. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) Create(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsCreateOptions) (RoleAssignmentsCreateResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignment to create. +// roleAssignmentName - The name of the role assignment to create. It can be any valid GUID. +// parameters - Parameters for the role assignment. +// options - RoleAssignmentsClientCreateOptions contains the optional parameters for the RoleAssignmentsClient.Create method. +func (client *RoleAssignmentsClient) Create(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsClientCreateOptions) (RoleAssignmentsClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, vaultBaseURL, scope, roleAssignmentName, parameters, options) if err != nil { - return RoleAssignmentsCreateResponse{}, err + return RoleAssignmentsClientCreateResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleAssignmentsCreateResponse{}, err + return RoleAssignmentsClientCreateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return RoleAssignmentsCreateResponse{}, client.createHandleError(resp) + return RoleAssignmentsClientCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) } // createCreateRequest creates the Create request. -func (client *RoleAssignmentsClient) createCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsCreateOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) createCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsClientCreateOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleAssignmentName == "" { return nil, errors.New("parameter roleAssignmentName cannot be empty") @@ -72,52 +77,40 @@ func (client *RoleAssignmentsClient) createCreateRequest(ctx context.Context, va } // createHandleResponse handles the Create response. -func (client *RoleAssignmentsClient) createHandleResponse(resp *http.Response) (RoleAssignmentsCreateResponse, error) { - result := RoleAssignmentsCreateResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) createHandleResponse(resp *http.Response) (RoleAssignmentsClientCreateResponse, error) { + result := RoleAssignmentsClientCreateResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil { - return RoleAssignmentsCreateResponse{}, err + return RoleAssignmentsClientCreateResponse{}, err } return result, nil } -// createHandleError handles the Create error response. -func (client *RoleAssignmentsClient) createHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - Deletes a role assignment. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsDeleteOptions) (RoleAssignmentsDeleteResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignment to delete. +// roleAssignmentName - The name of the role assignment to delete. +// options - RoleAssignmentsClientDeleteOptions contains the optional parameters for the RoleAssignmentsClient.Delete method. +func (client *RoleAssignmentsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientDeleteOptions) (RoleAssignmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, vaultBaseURL, scope, roleAssignmentName, options) if err != nil { - return RoleAssignmentsDeleteResponse{}, err + return RoleAssignmentsClientDeleteResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleAssignmentsDeleteResponse{}, err + return RoleAssignmentsClientDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleAssignmentsDeleteResponse{}, client.deleteHandleError(resp) + return RoleAssignmentsClientDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } // deleteCreateRequest creates the Delete request. -func (client *RoleAssignmentsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsDeleteOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientDeleteOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleAssignmentName == "" { return nil, errors.New("parameter roleAssignmentName cannot be empty") @@ -135,52 +128,40 @@ func (client *RoleAssignmentsClient) deleteCreateRequest(ctx context.Context, va } // deleteHandleResponse handles the Delete response. -func (client *RoleAssignmentsClient) deleteHandleResponse(resp *http.Response) (RoleAssignmentsDeleteResponse, error) { - result := RoleAssignmentsDeleteResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) deleteHandleResponse(resp *http.Response) (RoleAssignmentsClientDeleteResponse, error) { + result := RoleAssignmentsClientDeleteResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil { - return RoleAssignmentsDeleteResponse{}, err + return RoleAssignmentsClientDeleteResponse{}, err } return result, nil } -// deleteHandleError handles the Delete error response. -func (client *RoleAssignmentsClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Get - Get the specified role assignment. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsGetOptions) (RoleAssignmentsGetResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignment. +// roleAssignmentName - The name of the role assignment to get. +// options - RoleAssignmentsClientGetOptions contains the optional parameters for the RoleAssignmentsClient.Get method. +func (client *RoleAssignmentsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientGetOptions) (RoleAssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultBaseURL, scope, roleAssignmentName, options) if err != nil { - return RoleAssignmentsGetResponse{}, err + return RoleAssignmentsClientGetResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleAssignmentsGetResponse{}, err + return RoleAssignmentsClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleAssignmentsGetResponse{}, client.getHandleError(resp) + return RoleAssignmentsClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *RoleAssignmentsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsGetOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientGetOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleAssignmentName == "" { return nil, errors.New("parameter roleAssignmentName cannot be empty") @@ -198,49 +179,37 @@ func (client *RoleAssignmentsClient) getCreateRequest(ctx context.Context, vault } // getHandleResponse handles the Get response. -func (client *RoleAssignmentsClient) getHandleResponse(resp *http.Response) (RoleAssignmentsGetResponse, error) { - result := RoleAssignmentsGetResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) getHandleResponse(resp *http.Response) (RoleAssignmentsClientGetResponse, error) { + result := RoleAssignmentsClientGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil { - return RoleAssignmentsGetResponse{}, err + return RoleAssignmentsClientGetResponse{}, err } return result, nil } -// getHandleError handles the Get error response. -func (client *RoleAssignmentsClient) getHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListForScope - Gets role assignments for a scope. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) ListForScope(vaultBaseURL string, scope string, options *RoleAssignmentsListForScopeOptions) *RoleAssignmentsListForScopePager { - return &RoleAssignmentsListForScopePager{ +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignments. +// options - RoleAssignmentsClientListForScopeOptions contains the optional parameters for the RoleAssignmentsClient.ListForScope +// method. +func (client *RoleAssignmentsClient) ListForScope(vaultBaseURL string, scope string, options *RoleAssignmentsClientListForScopeOptions) *RoleAssignmentsClientListForScopePager { + return &RoleAssignmentsClientListForScopePager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listForScopeCreateRequest(ctx, vaultBaseURL, scope, options) }, - advancer: func(ctx context.Context, resp RoleAssignmentsListForScopeResponse) (*policy.Request, error) { + advancer: func(ctx context.Context, resp RoleAssignmentsClientListForScopeResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.RoleAssignmentListResult.NextLink) }, } } // listForScopeCreateRequest creates the ListForScope request. -func (client *RoleAssignmentsClient) listForScopeCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleAssignmentsListForScopeOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) listForScopeCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleAssignmentsClientListForScopeOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(host, urlPath)) if err != nil { @@ -257,23 +226,10 @@ func (client *RoleAssignmentsClient) listForScopeCreateRequest(ctx context.Conte } // listForScopeHandleResponse handles the ListForScope response. -func (client *RoleAssignmentsClient) listForScopeHandleResponse(resp *http.Response) (RoleAssignmentsListForScopeResponse, error) { - result := RoleAssignmentsListForScopeResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) listForScopeHandleResponse(resp *http.Response) (RoleAssignmentsClientListForScopeResponse, error) { + result := RoleAssignmentsClientListForScopeResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignmentListResult); err != nil { - return RoleAssignmentsListForScopeResponse{}, err + return RoleAssignmentsClientListForScopeResponse{}, err } return result, nil } - -// listForScopeHandleError handles the ListForScope error response. -func (client *RoleAssignmentsClient) listForScopeHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azkeys/internal/generated/roledefinitions_client.go b/sdk/keyvault/azkeys/internal/generated/roledefinitions_client.go index 84b8d80a4ea4..244a6df95625 100644 --- a/sdk/keyvault/azkeys/internal/generated/roledefinitions_client.go +++ b/sdk/keyvault/azkeys/internal/generated/roledefinitions_client.go @@ -6,12 +6,11 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "context" "errors" - "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,39 +21,46 @@ import ( // RoleDefinitionsClient contains the methods for the RoleDefinitions group. // Don't use this type directly, use NewRoleDefinitionsClient() instead. type RoleDefinitionsClient struct { - con *Connection + pl runtime.Pipeline } // NewRoleDefinitionsClient creates a new instance of RoleDefinitionsClient with the specified values. -func NewRoleDefinitionsClient(con *Connection) *RoleDefinitionsClient { - return &RoleDefinitionsClient{con: con} +// pl - the pipeline used for sending requests and handling responses. +func NewRoleDefinitionsClient(pl runtime.Pipeline) *RoleDefinitionsClient { + client := &RoleDefinitionsClient{ + pl: pl, + } + return client } // CreateOrUpdate - Creates or updates a custom role definition. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) CreateOrUpdate(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsCreateOrUpdateOptions) (RoleDefinitionsCreateOrUpdateResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition to create or update. Managed HSM only supports '/'. +// roleDefinitionName - The name of the role definition to create or update. It can be any valid GUID. +// parameters - Parameters for the role definition. +// options - RoleDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the RoleDefinitionsClient.CreateOrUpdate +// method. +func (client *RoleDefinitionsClient) CreateOrUpdate(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsClientCreateOrUpdateOptions) (RoleDefinitionsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, vaultBaseURL, scope, roleDefinitionName, parameters, options) if err != nil { - return RoleDefinitionsCreateOrUpdateResponse{}, err + return RoleDefinitionsClientCreateOrUpdateResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleDefinitionsCreateOrUpdateResponse{}, err + return RoleDefinitionsClientCreateOrUpdateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return RoleDefinitionsCreateOrUpdateResponse{}, client.createOrUpdateHandleError(resp) + return RoleDefinitionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) } return client.createOrUpdateHandleResponse(resp) } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RoleDefinitionsClient) createOrUpdateCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) createOrUpdateCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsClientCreateOrUpdateOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleDefinitionName == "" { return nil, errors.New("parameter roleDefinitionName cannot be empty") @@ -72,52 +78,40 @@ func (client *RoleDefinitionsClient) createOrUpdateCreateRequest(ctx context.Con } // createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RoleDefinitionsClient) createOrUpdateHandleResponse(resp *http.Response) (RoleDefinitionsCreateOrUpdateResponse, error) { - result := RoleDefinitionsCreateOrUpdateResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) createOrUpdateHandleResponse(resp *http.Response) (RoleDefinitionsClientCreateOrUpdateResponse, error) { + result := RoleDefinitionsClientCreateOrUpdateResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinition); err != nil { - return RoleDefinitionsCreateOrUpdateResponse{}, err + return RoleDefinitionsClientCreateOrUpdateResponse{}, err } return result, nil } -// createOrUpdateHandleError handles the CreateOrUpdate error response. -func (client *RoleDefinitionsClient) createOrUpdateHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - Deletes a custom role definition. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsDeleteOptions) (RoleDefinitionsDeleteResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition to delete. Managed HSM only supports '/'. +// roleDefinitionName - The name (GUID) of the role definition to delete. +// options - RoleDefinitionsClientDeleteOptions contains the optional parameters for the RoleDefinitionsClient.Delete method. +func (client *RoleDefinitionsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientDeleteOptions) (RoleDefinitionsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, vaultBaseURL, scope, roleDefinitionName, options) if err != nil { - return RoleDefinitionsDeleteResponse{}, err + return RoleDefinitionsClientDeleteResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleDefinitionsDeleteResponse{}, err + return RoleDefinitionsClientDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleDefinitionsDeleteResponse{}, client.deleteHandleError(resp) + return RoleDefinitionsClientDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } // deleteCreateRequest creates the Delete request. -func (client *RoleDefinitionsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsDeleteOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientDeleteOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleDefinitionName == "" { return nil, errors.New("parameter roleDefinitionName cannot be empty") @@ -135,52 +129,40 @@ func (client *RoleDefinitionsClient) deleteCreateRequest(ctx context.Context, va } // deleteHandleResponse handles the Delete response. -func (client *RoleDefinitionsClient) deleteHandleResponse(resp *http.Response) (RoleDefinitionsDeleteResponse, error) { - result := RoleDefinitionsDeleteResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) deleteHandleResponse(resp *http.Response) (RoleDefinitionsClientDeleteResponse, error) { + result := RoleDefinitionsClientDeleteResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinition); err != nil { - return RoleDefinitionsDeleteResponse{}, err + return RoleDefinitionsClientDeleteResponse{}, err } return result, nil } -// deleteHandleError handles the Delete error response. -func (client *RoleDefinitionsClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Get - Get the specified role definition. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsGetOptions) (RoleDefinitionsGetResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition to get. Managed HSM only supports '/'. +// roleDefinitionName - The name of the role definition to get. +// options - RoleDefinitionsClientGetOptions contains the optional parameters for the RoleDefinitionsClient.Get method. +func (client *RoleDefinitionsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientGetOptions) (RoleDefinitionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultBaseURL, scope, roleDefinitionName, options) if err != nil { - return RoleDefinitionsGetResponse{}, err + return RoleDefinitionsClientGetResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleDefinitionsGetResponse{}, err + return RoleDefinitionsClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleDefinitionsGetResponse{}, client.getHandleError(resp) + return RoleDefinitionsClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *RoleDefinitionsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsGetOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientGetOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleDefinitionName == "" { return nil, errors.New("parameter roleDefinitionName cannot be empty") @@ -198,49 +180,36 @@ func (client *RoleDefinitionsClient) getCreateRequest(ctx context.Context, vault } // getHandleResponse handles the Get response. -func (client *RoleDefinitionsClient) getHandleResponse(resp *http.Response) (RoleDefinitionsGetResponse, error) { - result := RoleDefinitionsGetResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) getHandleResponse(resp *http.Response) (RoleDefinitionsClientGetResponse, error) { + result := RoleDefinitionsClientGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinition); err != nil { - return RoleDefinitionsGetResponse{}, err + return RoleDefinitionsClientGetResponse{}, err } return result, nil } -// getHandleError handles the Get error response. -func (client *RoleDefinitionsClient) getHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // List - Get all role definitions that are applicable at scope and above. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) List(vaultBaseURL string, scope string, options *RoleDefinitionsListOptions) *RoleDefinitionsListPager { - return &RoleDefinitionsListPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition. +// options - RoleDefinitionsClientListOptions contains the optional parameters for the RoleDefinitionsClient.List method. +func (client *RoleDefinitionsClient) List(vaultBaseURL string, scope string, options *RoleDefinitionsClientListOptions) *RoleDefinitionsClientListPager { + return &RoleDefinitionsClientListPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listCreateRequest(ctx, vaultBaseURL, scope, options) }, - advancer: func(ctx context.Context, resp RoleDefinitionsListResponse) (*policy.Request, error) { + advancer: func(ctx context.Context, resp RoleDefinitionsClientListResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.RoleDefinitionListResult.NextLink) }, } } // listCreateRequest creates the List request. -func (client *RoleDefinitionsClient) listCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleDefinitionsListOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) listCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleDefinitionsClientListOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(host, urlPath)) if err != nil { @@ -257,23 +226,10 @@ func (client *RoleDefinitionsClient) listCreateRequest(ctx context.Context, vaul } // listHandleResponse handles the List response. -func (client *RoleDefinitionsClient) listHandleResponse(resp *http.Response) (RoleDefinitionsListResponse, error) { - result := RoleDefinitionsListResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) listHandleResponse(resp *http.Response) (RoleDefinitionsClientListResponse, error) { + result := RoleDefinitionsClientListResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinitionListResult); err != nil { - return RoleDefinitionsListResponse{}, err + return RoleDefinitionsClientListResponse{}, err } return result, nil } - -// listHandleError handles the List error response. -func (client *RoleDefinitionsClient) listHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azkeys/internal/generated/time_unix.go b/sdk/keyvault/azkeys/internal/generated/time_unix.go index 1259dd37d4d9..ef296335710b 100644 --- a/sdk/keyvault/azkeys/internal/generated/time_unix.go +++ b/sdk/keyvault/azkeys/internal/generated/time_unix.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package internal +package generated import ( "encoding/json" diff --git a/sdk/keyvault/azkeys/models.go b/sdk/keyvault/azkeys/models.go index 3511e45cedbc..745be488cf7e 100644 --- a/sdk/keyvault/azkeys/models.go +++ b/sdk/keyvault/azkeys/models.go @@ -9,7 +9,7 @@ package azkeys import ( "time" - generated "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/internal/generated" + "github.com/Azure/azure-sdk-for-go/sdk/keyvault/azkeys/internal/generated" ) // Attributes - The object attributes managed by the KeyVault service. @@ -47,13 +47,11 @@ func (k KeyAttributes) toGenerated() *generated.KeyAttributes { return &generated.KeyAttributes{ RecoverableDays: k.RecoverableDays, RecoveryLevel: recoveryLevelToGenerated(k.RecoveryLevel), - Attributes: generated.Attributes{ - Enabled: k.Enabled, - Expires: k.Expires, - NotBefore: k.NotBefore, - Created: k.Created, - Updated: k.Updated, - }, + Enabled: k.Enabled, + Expires: k.Expires, + NotBefore: k.NotBefore, + Created: k.Created, + Updated: k.Updated, } } @@ -284,7 +282,22 @@ func deletedKeyItemFromGenerated(i *generated.DeletedKeyItem) *DeletedKeyItem { RecoveryID: i.RecoveryID, DeletedDate: i.DeletedDate, ScheduledPurgeDate: i.ScheduledPurgeDate, - KeyItem: *keyItemFromGenerated(&i.KeyItem), + KeyItem: KeyItem{ + Attributes: &KeyAttributes{ + Attributes: Attributes{ + Enabled: i.Attributes.Enabled, + Expires: i.Attributes.Expires, + NotBefore: i.Attributes.NotBefore, + Created: i.Attributes.Created, + Updated: i.Attributes.Updated, + }, + RecoverableDays: i.Attributes.RecoverableDays, + RecoveryLevel: (*DeletionRecoveryLevel)(i.Attributes.RecoveryLevel), + }, + KID: i.Kid, + Tags: i.Tags, + Managed: i.Managed, + }, } } From 3ff5eaf2e5c3bce8f94a82be12451131223d0472 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:06:57 -0500 Subject: [PATCH 33/36] [Tables] preparing tables for release (#16733) * preparing tables for release * prepping for release with latest azcore * update with latest code generator * formatting * updating to released azcore version * upgrading azidentity * updating autorest.go version * final changes to readme Co-authored-by: Joel Hendrix --- sdk/data/aztables/CHANGELOG.md | 9 +- sdk/data/{ => aztables}/autorest.md | 4 +- sdk/data/aztables/client.go | 62 +- sdk/data/aztables/go.mod | 6 +- sdk/data/aztables/go.sum | 34 +- sdk/data/aztables/internal/connection.go | 2 +- sdk/data/aztables/internal/constants.go | 4 +- sdk/data/aztables/internal/models.go | 250 ++++---- sdk/data/aztables/internal/response_types.go | 140 ++--- sdk/data/aztables/internal/service_client.go | 149 +++-- sdk/data/aztables/internal/table_client.go | 602 ++++++++----------- sdk/data/aztables/proxy_test.go | 2 +- sdk/data/aztables/service_client.go | 50 +- sdk/data/aztables/transactional_batch.go | 12 +- 14 files changed, 635 insertions(+), 691 deletions(-) rename sdk/data/{ => aztables}/autorest.md (93%) diff --git a/sdk/data/aztables/CHANGELOG.md b/sdk/data/aztables/CHANGELOG.md index c83749081251..23082a0c0d2b 100644 --- a/sdk/data/aztables/CHANGELOG.md +++ b/sdk/data/aztables/CHANGELOG.md @@ -1,14 +1,9 @@ # Release History -## 0.4.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 0.5.0 (2022-01-12) ### Other Changes +* Updates `azcore` dependency from `v0.20.0` to `v0.21.0` ## 0.4.0 (2021-11-09) diff --git a/sdk/data/autorest.md b/sdk/data/aztables/autorest.md similarity index 93% rename from sdk/data/autorest.md rename to sdk/data/aztables/autorest.md index 8660db4aa221..fa709d82ef7f 100644 --- a/sdk/data/autorest.md +++ b/sdk/data/aztables/autorest.md @@ -11,10 +11,10 @@ version: "^3.0.0" input-file: https://github.com/Azure/azure-rest-api-specs/blob/d744b6bcb95ab4034832ded556dbbe58f4287c5b/specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json license-header: MICROSOFT_MIT_NO_VERSION clear-output-folder: false -output-folder: aztables/internal +output-folder: internal tag: package-2019-02 credential-scope: none -use: "@autorest/go@4.0.0-preview.27" +use: "@autorest/go@4.0.0-preview.35" module-version: 0.1.0 security: "AADToken" security-scopes: "https://storage.azure.com/.default" diff --git a/sdk/data/aztables/client.go b/sdk/data/aztables/client.go index d9f116f381f9..9d044116eeee 100644 --- a/sdk/data/aztables/client.go +++ b/sdk/data/aztables/client.go @@ -105,7 +105,7 @@ type CreateTableResponse struct { RawResponse *http.Response } -func createTableResponseFromGen(g *generated.TableCreateResponse) CreateTableResponse { +func createTableResponseFromGen(g *generated.TableClientCreateResponse) CreateTableResponse { if g == nil { return CreateTableResponse{} } @@ -183,7 +183,7 @@ type ListEntitiesResponse struct { } // transforms a generated query response into the ListEntitiesPaged -func newListEntitiesPage(resp *generated.TableQueryEntitiesResponse) (ListEntitiesPage, error) { +func newListEntitiesPage(resp *generated.TableClientQueryEntitiesResponse) (ListEntitiesPage, error) { marshalledValue := make([][]byte, 0) for _, e := range resp.TableEntityQueryResponse.Value { m, err := json.Marshal(e) @@ -231,7 +231,7 @@ type ListEntitiesPager interface { type tableEntityQueryResponsePager struct { tableClient *Client current *ListEntitiesPage - tableQueryOptions *generated.TableQueryEntitiesOptions + tableQueryOptions *generated.TableClientQueryEntitiesOptions listOptions *ListEntitiesOptions err error } @@ -251,7 +251,7 @@ func (p *tableEntityQueryResponsePager) NextPage(ctx context.Context) bool { if p.err != nil || (p.current != nil && p.current.ContinuationNextPartitionKey == nil && p.current.ContinuationNextRowKey == nil) { return false } - var resp generated.TableQueryEntitiesResponse + var resp generated.TableClientQueryEntitiesResponse resp, p.err = p.tableClient.client.QueryEntities( ctx, generated.Enum1Three0, @@ -301,7 +301,7 @@ func (t *Client) List(listOptions *ListEntitiesOptions) ListEntitiesPager { return &tableEntityQueryResponsePager{ tableClient: t, listOptions: listOptions, - tableQueryOptions: &generated.TableQueryEntitiesOptions{ + tableQueryOptions: &generated.TableClientQueryEntitiesOptions{ NextPartitionKey: listOptions.PartitionKey, NextRowKey: listOptions.RowKey, }, @@ -312,8 +312,8 @@ func (t *Client) List(listOptions *ListEntitiesOptions) ListEntitiesPager { type GetEntityOptions struct { } -func (g *GetEntityOptions) toGenerated() (*generated.TableQueryEntityWithPartitionAndRowKeyOptions, *generated.QueryOptions) { - return &generated.TableQueryEntityWithPartitionAndRowKeyOptions{}, &generated.QueryOptions{Format: generated.ODataMetadataFormatApplicationJSONODataMinimalmetadata.ToPtr()} +func (g *GetEntityOptions) toGenerated() (*generated.TableClientQueryEntityWithPartitionAndRowKeyOptions, *generated.QueryOptions) { + return &generated.TableClientQueryEntityWithPartitionAndRowKeyOptions{}, &generated.QueryOptions{Format: generated.ODataMetadataFormatApplicationJSONODataMinimalmetadata.ToPtr()} } // GetEntityResponse is the return type for a GetEntity operation. The individual entities are stored in the Value property @@ -329,7 +329,7 @@ type GetEntityResponse struct { } // newGetEntityResponse transforms a generated response to the GetEntityResponse type -func newGetEntityResponse(g generated.TableQueryEntityWithPartitionAndRowKeyResponse) (GetEntityResponse, error) { +func newGetEntityResponse(g generated.TableClientQueryEntityWithPartitionAndRowKeyResponse) (GetEntityResponse, error) { marshalledValue, err := json.Marshal(g.Value) if err != nil { return GetEntityResponse{}, err @@ -371,7 +371,7 @@ type AddEntityResponse struct { ETag azcore.ETag } -func addEntityResponseFromGenerated(g *generated.TableInsertEntityResponse) AddEntityResponse { +func addEntityResponseFromGenerated(g *generated.TableClientInsertEntityResponse) AddEntityResponse { if g == nil { return AddEntityResponse{} } @@ -395,7 +395,7 @@ func (t *Client) AddEntity(ctx context.Context, entity []byte, options *AddEntit if err != nil { return AddEntityResponse{}, err } - resp, err := t.client.InsertEntity(ctx, generated.Enum1Three0, t.name, &generated.TableInsertEntityOptions{TableEntityProperties: mapEntity, ResponsePreference: generated.ResponseFormatReturnNoContent.ToPtr()}, nil) + resp, err := t.client.InsertEntity(ctx, generated.Enum1Three0, t.name, &generated.TableClientInsertEntityOptions{TableEntityProperties: mapEntity, ResponsePreference: generated.ResponseFormatReturnNoContent.ToPtr()}, nil) if err != nil { err = checkEntityForPkRk(&mapEntity, err) return AddEntityResponse{}, err @@ -407,15 +407,15 @@ type DeleteEntityOptions struct { IfMatch *azcore.ETag } -func (d *DeleteEntityOptions) toGenerated() *generated.TableDeleteEntityOptions { - return &generated.TableDeleteEntityOptions{} +func (d *DeleteEntityOptions) toGenerated() *generated.TableClientDeleteEntityOptions { + return &generated.TableClientDeleteEntityOptions{} } type DeleteEntityResponse struct { RawResponse *http.Response } -func deleteEntityResponseFromGenerated(g *generated.TableDeleteEntityResponse) DeleteEntityResponse { +func deleteEntityResponseFromGenerated(g *generated.TableClientDeleteEntityResponse) DeleteEntityResponse { if g == nil { return DeleteEntityResponse{} } @@ -442,21 +442,21 @@ type UpdateEntityOptions struct { UpdateMode EntityUpdateMode } -func (u *UpdateEntityOptions) toGeneratedMergeEntity(m map[string]interface{}) *generated.TableMergeEntityOptions { +func (u *UpdateEntityOptions) toGeneratedMergeEntity(m map[string]interface{}) *generated.TableClientMergeEntityOptions { if u == nil { - return &generated.TableMergeEntityOptions{} + return &generated.TableClientMergeEntityOptions{} } - return &generated.TableMergeEntityOptions{ + return &generated.TableClientMergeEntityOptions{ IfMatch: to.StringPtr(string(*u.IfMatch)), TableEntityProperties: m, } } -func (u *UpdateEntityOptions) toGeneratedUpdateEntity(m map[string]interface{}) *generated.TableUpdateEntityOptions { +func (u *UpdateEntityOptions) toGeneratedUpdateEntity(m map[string]interface{}) *generated.TableClientUpdateEntityOptions { if u == nil { - return &generated.TableUpdateEntityOptions{} + return &generated.TableClientUpdateEntityOptions{} } - return &generated.TableUpdateEntityOptions{ + return &generated.TableClientUpdateEntityOptions{ IfMatch: to.StringPtr(string(*u.IfMatch)), TableEntityProperties: m, } @@ -467,7 +467,7 @@ type UpdateEntityResponse struct { ETag azcore.ETag } -func updateEntityResponseFromMergeGenerated(g *generated.TableMergeEntityResponse) UpdateEntityResponse { +func updateEntityResponseFromMergeGenerated(g *generated.TableClientMergeEntityResponse) UpdateEntityResponse { if g == nil { return UpdateEntityResponse{} } @@ -482,7 +482,7 @@ func updateEntityResponseFromMergeGenerated(g *generated.TableMergeEntityRespons } } -func updateEntityResponseFromUpdateGenerated(g *generated.TableUpdateEntityResponse) UpdateEntityResponse { +func updateEntityResponseFromUpdateGenerated(g *generated.TableClientUpdateEntityResponse) UpdateEntityResponse { if g == nil { return UpdateEntityResponse{} } @@ -566,7 +566,7 @@ type InsertEntityResponse struct { ETag azcore.ETag } -func insertEntityFromGeneratedMerge(g *generated.TableMergeEntityResponse) InsertEntityResponse { +func insertEntityFromGeneratedMerge(g *generated.TableClientMergeEntityResponse) InsertEntityResponse { if g == nil { return InsertEntityResponse{} } @@ -581,7 +581,7 @@ func insertEntityFromGeneratedMerge(g *generated.TableMergeEntityResponse) Inser } } -func insertEntityFromGeneratedUpdate(g *generated.TableUpdateEntityResponse) InsertEntityResponse { +func insertEntityFromGeneratedUpdate(g *generated.TableClientUpdateEntityResponse) InsertEntityResponse { if g == nil { return InsertEntityResponse{} } @@ -626,7 +626,7 @@ func (t *Client) InsertEntity(ctx context.Context, entity []byte, options *Inser t.name, partKey, rowkey, - &generated.TableMergeEntityOptions{TableEntityProperties: mapEntity}, + &generated.TableClientMergeEntityOptions{TableEntityProperties: mapEntity}, &generated.QueryOptions{}, ) return insertEntityFromGeneratedMerge(&resp), err @@ -637,7 +637,7 @@ func (t *Client) InsertEntity(ctx context.Context, entity []byte, options *Inser t.name, partKey, rowkey, - &generated.TableUpdateEntityOptions{TableEntityProperties: mapEntity}, + &generated.TableClientUpdateEntityOptions{TableEntityProperties: mapEntity}, &generated.QueryOptions{}, ) return insertEntityFromGeneratedUpdate(&resp), err @@ -651,8 +651,8 @@ func (t *Client) InsertEntity(ctx context.Context, entity []byte, options *Inser type GetAccessPolicyOptions struct { } -func (g *GetAccessPolicyOptions) toGenerated() *generated.TableGetAccessPolicyOptions { - return &generated.TableGetAccessPolicyOptions{} +func (g *GetAccessPolicyOptions) toGenerated() *generated.TableClientGetAccessPolicyOptions { + return &generated.TableClientGetAccessPolicyOptions{} } type GetAccessPolicyResponse struct { @@ -660,7 +660,7 @@ type GetAccessPolicyResponse struct { SignedIdentifiers []*SignedIdentifier } -func getAccessPolicyResponseFromGenerated(g *generated.TableGetAccessPolicyResponse) GetAccessPolicyResponse { +func getAccessPolicyResponseFromGenerated(g *generated.TableClientGetAccessPolicyResponse) GetAccessPolicyResponse { if g == nil { return GetAccessPolicyResponse{} } @@ -689,7 +689,7 @@ type SetAccessPolicyResponse struct { RawResponse *http.Response } -func setAccessPolicyResponseFromGenerated(g *generated.TableSetAccessPolicyResponse) SetAccessPolicyResponse { +func setAccessPolicyResponseFromGenerated(g *generated.TableClientSetAccessPolicyResponse) SetAccessPolicyResponse { if g == nil { return SetAccessPolicyResponse{} } @@ -697,12 +697,12 @@ func setAccessPolicyResponseFromGenerated(g *generated.TableSetAccessPolicyRespo RawResponse: g.RawResponse, } } -func (s *SetAccessPolicyOptions) toGenerated() *generated.TableSetAccessPolicyOptions { +func (s *SetAccessPolicyOptions) toGenerated() *generated.TableClientSetAccessPolicyOptions { var sis []*generated.SignedIdentifier for _, t := range s.TableACL { sis = append(sis, toGeneratedSignedIdentifier(t)) } - return &generated.TableSetAccessPolicyOptions{ + return &generated.TableClientSetAccessPolicyOptions{ TableACL: sis, } } diff --git a/sdk/data/aztables/go.mod b/sdk/data/aztables/go.mod index b6338e702884..ade2f87f4fa8 100644 --- a/sdk/data/aztables/go.mod +++ b/sdk/data/aztables/go.mod @@ -3,8 +3,8 @@ module github.com/Azure/azure-sdk-for-go/sdk/data/aztables go 1.16 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 - github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 github.com/stretchr/testify v1.7.0 ) diff --git a/sdk/data/aztables/go.sum b/sdk/data/aztables/go.sum index bb3880362bcf..09fe7359f65e 100644 --- a/sdk/data/aztables/go.sum +++ b/sdk/data/aztables/go.sum @@ -1,17 +1,26 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0/go.mod h1:GJzjM4SR9T0KyX5gKCVyz1ytD8FeWeUPCwtFCt1AyfE= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -23,18 +32,23 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/sdk/data/aztables/internal/connection.go b/sdk/data/aztables/internal/connection.go index 5ee284118407..ba574b8414bc 100644 --- a/sdk/data/aztables/internal/connection.go +++ b/sdk/data/aztables/internal/connection.go @@ -25,7 +25,7 @@ func NewConnection(endpoint string, options *azcore.ClientOptions) *Connection { if options != nil { cp = *options } - return &Connection{u: endpoint, p: runtime.NewPipeline(module, version, nil, nil, &cp)} + return &Connection{u: endpoint, p: runtime.NewPipeline(moduleName, moduleVersion, runtime.PipelineOptions{}, &cp)} } // Endpoint returns the connection's endpoint. diff --git a/sdk/data/aztables/internal/constants.go b/sdk/data/aztables/internal/constants.go index 4db7b14bdcf7..42a02c017b63 100644 --- a/sdk/data/aztables/internal/constants.go +++ b/sdk/data/aztables/internal/constants.go @@ -9,8 +9,8 @@ package internal const ( - module = "aztables" - version = "v0.4.1" + moduleName = "internal" + moduleVersion = "v0.5.0" ) type Enum0 string diff --git a/sdk/data/aztables/internal/models.go b/sdk/data/aztables/internal/models.go index b14b5a2119be..a5c54b3c6df0 100644 --- a/sdk/data/aztables/internal/models.go +++ b/sdk/data/aztables/internal/models.go @@ -11,10 +11,9 @@ package internal import ( "encoding/json" "encoding/xml" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" ) // AccessPolicy - An Access policy. @@ -62,10 +61,10 @@ func (a *AccessPolicy) UnmarshalXML(d *xml.Decoder, start xml.StartElement) erro return nil } -// CorsRule - CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement -// a security restriction known as same-origin policy that -// prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another -// domain. +// CorsRule - CORS is an HTTP feature that enables a web application running under one domain to access resources in another +// domain. Web browsers implement a security restriction known as same-origin policy that +// prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin +// domain) to call APIs in another domain. type CorsRule struct { // REQUIRED; The request headers that the origin domain may specify on the CORS request. AllowedHeaders *string `xml:"AllowedHeaders"` @@ -73,13 +72,14 @@ type CorsRule struct { // REQUIRED; The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated) AllowedMethods *string `xml:"AllowedMethods"` - // REQUIRED; The origin domains that are permitted to make a request against the service via CORS. The origin domain is the domain from which the request - // originates. Note that the origin must be an exact - // case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains - // to make requests via CORS. + // REQUIRED; The origin domains that are permitted to make a request against the service via CORS. The origin domain is the + // domain from which the request originates. Note that the origin must be an exact + // case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' + // to allow all origin domains to make requests via CORS. AllowedOrigins *string `xml:"AllowedOrigins"` - // REQUIRED; The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. + // REQUIRED; The response headers that may be sent in the response to the CORS request and exposed by the browser to the request + // issuer. ExposedHeaders *string `xml:"ExposedHeaders"` // REQUIRED; The maximum amount time that a browser should cache the preflight OPTIONS request. @@ -87,8 +87,8 @@ type CorsRule struct { } type GeoReplication struct { - // REQUIRED; A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. - // Primary writes after this point in time may or may + // REQUIRED; A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available + // for read operations at the secondary. Primary writes after this point in time may or may // not be available for reads. LastSyncTime *time.Time `xml:"LastSyncTime"` @@ -157,13 +157,14 @@ type Metrics struct { Version *string `xml:"Version"` } -// QueryOptions contains a group of parameters for the Table.Query method. +// QueryOptions contains a group of parameters for the TableClient.Query method. type QueryOptions struct { // OData filter expression. Filter *string // Specifies the media type for the response. Format *ODataMetadataFormat - // Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, ResourceId". + // Select expression using OData notation. Limits the columns on each record to just those requested, e.g. "$select=PolicyAssignmentId, + // ResourceId". Select *string // Maximum number of records to return. Top *int32 @@ -174,29 +175,33 @@ type RetentionPolicy struct { // REQUIRED; Indicates whether a retention policy is enabled for the service. Enabled *bool `xml:"Enabled"` - // Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted. + // Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this + // value will be deleted. Days *int32 `xml:"Days"` } -// ServiceGetPropertiesOptions contains the optional parameters for the Service.GetProperties method. -type ServiceGetPropertiesOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. +type ServiceClientGetPropertiesOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 } -// ServiceGetStatisticsOptions contains the optional parameters for the Service.GetStatistics method. -type ServiceGetStatisticsOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// ServiceClientGetStatisticsOptions contains the optional parameters for the ServiceClient.GetStatistics method. +type ServiceClientGetStatisticsOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 } -// ServiceSetPropertiesOptions contains the optional parameters for the Service.SetProperties method. -type ServiceSetPropertiesOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// ServiceClientSetPropertiesOptions contains the optional parameters for the ServiceClient.SetProperties method. +type ServiceClientSetPropertiesOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 @@ -211,58 +216,48 @@ type SignedIdentifier struct { ID *string `xml:"Id"` } -// TableCreateOptions contains the optional parameters for the Table.Create method. -type TableCreateOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// TableClientCreateOptions contains the optional parameters for the TableClient.Create method. +type TableClientCreateOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string - // Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content and return-content. + // Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content + // and return-content. ResponsePreference *ResponseFormat } -// TableDeleteEntityOptions contains the optional parameters for the Table.DeleteEntity method. -type TableDeleteEntityOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// TableClientDeleteEntityOptions contains the optional parameters for the TableClient.DeleteEntity method. +type TableClientDeleteEntityOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableDeleteOptions contains the optional parameters for the Table.Delete method. -type TableDeleteOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// TableClientDeleteOptions contains the optional parameters for the TableClient.Delete method. +type TableClientDeleteOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string } -// TableEntityQueryResponse - The properties for the table entity query response. -type TableEntityQueryResponse struct { - // The metadata response of the table. - ODataMetadata *string `json:"odata.metadata,omitempty"` - - // List of table entities. - Value []map[string]interface{} `json:"value,omitempty"` -} - -// MarshalJSON implements the json.Marshaller interface for type TableEntityQueryResponse. -func (t TableEntityQueryResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "odata.metadata", t.ODataMetadata) - populate(objectMap, "value", t.Value) - return json.Marshal(objectMap) -} - -// TableGetAccessPolicyOptions contains the optional parameters for the Table.GetAccessPolicy method. -type TableGetAccessPolicyOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// TableClientGetAccessPolicyOptions contains the optional parameters for the TableClient.GetAccessPolicy method. +type TableClientGetAccessPolicyOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableInsertEntityOptions contains the optional parameters for the Table.InsertEntity method. -type TableInsertEntityOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// TableClientInsertEntityOptions contains the optional parameters for the TableClient.InsertEntity method. +type TableClientInsertEntityOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string - // Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content and return-content. + // Specifies whether the response should include the inserted entity in the payload. Possible values are return-no-content + // and return-content. ResponsePreference *ResponseFormat // The properties for the table entity. TableEntityProperties map[string]interface{} @@ -270,13 +265,15 @@ type TableInsertEntityOptions struct { Timeout *int32 } -// TableMergeEntityOptions contains the optional parameters for the Table.MergeEntity method. -type TableMergeEntityOptions struct { - // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, - // set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a merge will be performed - // if an existing entity is found. +// TableClientMergeEntityOptions contains the optional parameters for the TableClient.MergeEntity method. +type TableClientMergeEntityOptions struct { + // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. + // To force an unconditional update, set to the wildcard character (*). If not + // specified, an insert will be performed when no existing entity is found to update and a merge will be performed if an existing + // entity is found. IfMatch *string - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The properties for the table entity. TableEntityProperties map[string]interface{} @@ -284,38 +281,86 @@ type TableMergeEntityOptions struct { Timeout *int32 } -// TableProperties - The properties for creating a table. -type TableProperties struct { - // The name of the table to create. - TableName *string `json:"TableName,omitempty"` -} - -// TableQueryEntitiesOptions contains the optional parameters for the Table.QueryEntities method. -type TableQueryEntitiesOptions struct { +// TableClientQueryEntitiesOptions contains the optional parameters for the TableClient.QueryEntities method. +type TableClientQueryEntitiesOptions struct { // An entity query continuation token from a previous call. NextPartitionKey *string // An entity query continuation token from a previous call. NextRowKey *string - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableQueryEntityWithPartitionAndRowKeyOptions contains the optional parameters for the Table.QueryEntityWithPartitionAndRowKey method. -type TableQueryEntityWithPartitionAndRowKeyOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. +// TableClientQueryEntityWithPartitionAndRowKeyOptions contains the optional parameters for the TableClient.QueryEntityWithPartitionAndRowKey +// method. +type TableClientQueryEntityWithPartitionAndRowKeyOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string // The timeout parameter is expressed in seconds. Timeout *int32 } -// TableQueryOptions contains the optional parameters for the Table.Query method. -type TableQueryOptions struct { +// TableClientQueryOptions contains the optional parameters for the TableClient.Query method. +type TableClientQueryOptions struct { // A table query continuation token from a previous call. NextTableName *string - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. + RequestID *string +} + +// TableClientSetAccessPolicyOptions contains the optional parameters for the TableClient.SetAccessPolicy method. +type TableClientSetAccessPolicyOptions struct { + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. RequestID *string + // The acls for the table. + TableACL []*SignedIdentifier + // The timeout parameter is expressed in seconds. + Timeout *int32 +} + +// TableClientUpdateEntityOptions contains the optional parameters for the TableClient.UpdateEntity method. +type TableClientUpdateEntityOptions struct { + // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. + // To force an unconditional update, set to the wildcard character (*). If not + // specified, an insert will be performed when no existing entity is found to update and a replace will be performed if an + // existing entity is found. + IfMatch *string + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics + // logging is enabled. + RequestID *string + // The properties for the table entity. + TableEntityProperties map[string]interface{} + // The timeout parameter is expressed in seconds. + Timeout *int32 +} + +// TableEntityQueryResponse - The properties for the table entity query response. +type TableEntityQueryResponse struct { + // The metadata response of the table. + ODataMetadata *string `json:"odata.metadata,omitempty"` + + // List of table entities. + Value []map[string]interface{} `json:"value,omitempty"` +} + +// MarshalJSON implements the json.Marshaller interface for type TableEntityQueryResponse. +func (t TableEntityQueryResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "odata.metadata", t.ODataMetadata) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// TableProperties - The properties for creating a table. +type TableProperties struct { + // The name of the table to create. + TableName *string `json:"TableName,omitempty"` } // TableQueryResponse - The properties for the table query response. @@ -337,9 +382,20 @@ func (t TableQueryResponse) MarshalJSON() ([]byte, error) { // TableResponse - The response for a single table. type TableResponse struct { - TableResponseProperties + // The edit link of the table. + ODataEditLink *string `json:"odata.editLink,omitempty"` + + // The id of the table. + ODataID *string `json:"odata.id,omitempty"` + // The metadata response of the table. ODataMetadata *string `json:"odata.metadata,omitempty"` + + // The odata type of the table. + ODataType *string `json:"odata.type,omitempty"` + + // The name of the table. + TableName *string `json:"TableName,omitempty"` } // TableResponseProperties - The properties for the table response. @@ -358,19 +414,11 @@ type TableResponseProperties struct { } // TableServiceError - Table Service error. -// Implements the error and azcore.HTTPResponse interfaces. type TableServiceError struct { - raw string // The error message. Message *string `json:"Message,omitempty"` } -// Error implements the error interface for type TableServiceError. -// The contents of the error text are not contractual and subject to change. -func (e TableServiceError) Error() string { - return e.raw -} - // TableServiceProperties - Table Service Properties. type TableServiceProperties struct { // The set of CORS rules. @@ -408,30 +456,6 @@ type TableServiceStats struct { GeoReplication *GeoReplication `xml:"GeoReplication"` } -// TableSetAccessPolicyOptions contains the optional parameters for the Table.SetAccessPolicy method. -type TableSetAccessPolicyOptions struct { - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. - RequestID *string - // The acls for the table. - TableACL []*SignedIdentifier - // The timeout parameter is expressed in seconds. - Timeout *int32 -} - -// TableUpdateEntityOptions contains the optional parameters for the Table.UpdateEntity method. -type TableUpdateEntityOptions struct { - // Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, - // set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a replace will be performed - // if an existing entity is found. - IfMatch *string - // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when analytics logging is enabled. - RequestID *string - // The properties for the table entity. - TableEntityProperties map[string]interface{} - // The timeout parameter is expressed in seconds. - Timeout *int32 -} - func populate(m map[string]interface{}, k string, v interface{}) { if v == nil { return diff --git a/sdk/data/aztables/internal/response_types.go b/sdk/data/aztables/internal/response_types.go index 5b7a0c119bbf..0db035fc4366 100644 --- a/sdk/data/aztables/internal/response_types.go +++ b/sdk/data/aztables/internal/response_types.go @@ -13,15 +13,15 @@ import ( "time" ) -// ServiceGetPropertiesResponse contains the response from method Service.GetProperties. -type ServiceGetPropertiesResponse struct { - ServiceGetPropertiesResult +// ServiceClientGetPropertiesResponse contains the response from method ServiceClient.GetProperties. +type ServiceClientGetPropertiesResponse struct { + ServiceClientGetPropertiesResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// ServiceGetPropertiesResult contains the result from method Service.GetProperties. -type ServiceGetPropertiesResult struct { +// ServiceClientGetPropertiesResult contains the result from method ServiceClient.GetProperties. +type ServiceClientGetPropertiesResult struct { TableServiceProperties // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string `xml:"ClientRequestID"` @@ -33,15 +33,15 @@ type ServiceGetPropertiesResult struct { Version *string `xml:"Version"` } -// ServiceGetStatisticsResponse contains the response from method Service.GetStatistics. -type ServiceGetStatisticsResponse struct { - ServiceGetStatisticsResult +// ServiceClientGetStatisticsResponse contains the response from method ServiceClient.GetStatistics. +type ServiceClientGetStatisticsResponse struct { + ServiceClientGetStatisticsResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// ServiceGetStatisticsResult contains the result from method Service.GetStatistics. -type ServiceGetStatisticsResult struct { +// ServiceClientGetStatisticsResult contains the result from method ServiceClient.GetStatistics. +type ServiceClientGetStatisticsResult struct { TableServiceStats // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string `xml:"ClientRequestID"` @@ -56,15 +56,15 @@ type ServiceGetStatisticsResult struct { Version *string `xml:"Version"` } -// ServiceSetPropertiesResponse contains the response from method Service.SetProperties. -type ServiceSetPropertiesResponse struct { - ServiceSetPropertiesResult +// ServiceClientSetPropertiesResponse contains the response from method ServiceClient.SetProperties. +type ServiceClientSetPropertiesResponse struct { + ServiceClientSetPropertiesResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// ServiceSetPropertiesResult contains the result from method Service.SetProperties. -type ServiceSetPropertiesResult struct { +// ServiceClientSetPropertiesResult contains the result from method ServiceClient.SetProperties. +type ServiceClientSetPropertiesResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -75,15 +75,15 @@ type ServiceSetPropertiesResult struct { Version *string } -// TableCreateResponse contains the response from method Table.Create. -type TableCreateResponse struct { - TableCreateResult +// TableClientCreateResponse contains the response from method TableClient.Create. +type TableClientCreateResponse struct { + TableClientCreateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableCreateResult contains the result from method Table.Create. -type TableCreateResult struct { +// TableClientCreateResult contains the result from method TableClient.Create. +type TableClientCreateResult struct { TableResponse // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -101,15 +101,15 @@ type TableCreateResult struct { Version *string } -// TableDeleteEntityResponse contains the response from method Table.DeleteEntity. -type TableDeleteEntityResponse struct { - TableDeleteEntityResult +// TableClientDeleteEntityResponse contains the response from method TableClient.DeleteEntity. +type TableClientDeleteEntityResponse struct { + TableClientDeleteEntityResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableDeleteEntityResult contains the result from method Table.DeleteEntity. -type TableDeleteEntityResult struct { +// TableClientDeleteEntityResult contains the result from method TableClient.DeleteEntity. +type TableClientDeleteEntityResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -123,15 +123,15 @@ type TableDeleteEntityResult struct { Version *string } -// TableDeleteResponse contains the response from method Table.Delete. -type TableDeleteResponse struct { - TableDeleteResult +// TableClientDeleteResponse contains the response from method TableClient.Delete. +type TableClientDeleteResponse struct { + TableClientDeleteResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableDeleteResult contains the result from method Table.Delete. -type TableDeleteResult struct { +// TableClientDeleteResult contains the result from method TableClient.Delete. +type TableClientDeleteResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -145,15 +145,15 @@ type TableDeleteResult struct { Version *string } -// TableGetAccessPolicyResponse contains the response from method Table.GetAccessPolicy. -type TableGetAccessPolicyResponse struct { - TableGetAccessPolicyResult +// TableClientGetAccessPolicyResponse contains the response from method TableClient.GetAccessPolicy. +type TableClientGetAccessPolicyResponse struct { + TableClientGetAccessPolicyResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableGetAccessPolicyResult contains the result from method Table.GetAccessPolicy. -type TableGetAccessPolicyResult struct { +// TableClientGetAccessPolicyResult contains the result from method TableClient.GetAccessPolicy. +type TableClientGetAccessPolicyResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string `xml:"ClientRequestID"` @@ -170,15 +170,15 @@ type TableGetAccessPolicyResult struct { Version *string `xml:"Version"` } -// TableInsertEntityResponse contains the response from method Table.InsertEntity. -type TableInsertEntityResponse struct { - TableInsertEntityResult +// TableClientInsertEntityResponse contains the response from method TableClient.InsertEntity. +type TableClientInsertEntityResponse struct { + TableClientInsertEntityResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableInsertEntityResult contains the result from method Table.InsertEntity. -type TableInsertEntityResult struct { +// TableClientInsertEntityResult contains the result from method TableClient.InsertEntity. +type TableClientInsertEntityResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -204,15 +204,15 @@ type TableInsertEntityResult struct { Version *string } -// TableMergeEntityResponse contains the response from method Table.MergeEntity. -type TableMergeEntityResponse struct { - TableMergeEntityResult +// TableClientMergeEntityResponse contains the response from method TableClient.MergeEntity. +type TableClientMergeEntityResponse struct { + TableClientMergeEntityResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableMergeEntityResult contains the result from method Table.MergeEntity. -type TableMergeEntityResult struct { +// TableClientMergeEntityResult contains the result from method TableClient.MergeEntity. +type TableClientMergeEntityResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -229,15 +229,15 @@ type TableMergeEntityResult struct { Version *string } -// TableQueryEntitiesResponse contains the response from method Table.QueryEntities. -type TableQueryEntitiesResponse struct { - TableQueryEntitiesResult +// TableClientQueryEntitiesResponse contains the response from method TableClient.QueryEntities. +type TableClientQueryEntitiesResponse struct { + TableClientQueryEntitiesResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableQueryEntitiesResult contains the result from method Table.QueryEntities. -type TableQueryEntitiesResult struct { +// TableClientQueryEntitiesResult contains the result from method TableClient.QueryEntities. +type TableClientQueryEntitiesResult struct { TableEntityQueryResponse // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -258,15 +258,15 @@ type TableQueryEntitiesResult struct { XMSContinuationNextRowKey *string } -// TableQueryEntityWithPartitionAndRowKeyResponse contains the response from method Table.QueryEntityWithPartitionAndRowKey. -type TableQueryEntityWithPartitionAndRowKeyResponse struct { - TableQueryEntityWithPartitionAndRowKeyResult +// TableClientQueryEntityWithPartitionAndRowKeyResponse contains the response from method TableClient.QueryEntityWithPartitionAndRowKey. +type TableClientQueryEntityWithPartitionAndRowKeyResponse struct { + TableClientQueryEntityWithPartitionAndRowKeyResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableQueryEntityWithPartitionAndRowKeyResult contains the result from method Table.QueryEntityWithPartitionAndRowKey. -type TableQueryEntityWithPartitionAndRowKeyResult struct { +// TableClientQueryEntityWithPartitionAndRowKeyResult contains the result from method TableClient.QueryEntityWithPartitionAndRowKey. +type TableClientQueryEntityWithPartitionAndRowKeyResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -292,15 +292,15 @@ type TableQueryEntityWithPartitionAndRowKeyResult struct { XMSContinuationNextRowKey *string } -// TableQueryResponseEnvelope contains the response from method Table.Query. -type TableQueryResponseEnvelope struct { - TableQueryResult +// TableClientQueryResponse contains the response from method TableClient.Query. +type TableClientQueryResponse struct { + TableClientQueryResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableQueryResult contains the result from method Table.Query. -type TableQueryResult struct { +// TableClientQueryResult contains the result from method TableClient.Query. +type TableClientQueryResult struct { TableQueryResponse // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -318,15 +318,15 @@ type TableQueryResult struct { XMSContinuationNextTableName *string } -// TableSetAccessPolicyResponse contains the response from method Table.SetAccessPolicy. -type TableSetAccessPolicyResponse struct { - TableSetAccessPolicyResult +// TableClientSetAccessPolicyResponse contains the response from method TableClient.SetAccessPolicy. +type TableClientSetAccessPolicyResponse struct { + TableClientSetAccessPolicyResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableSetAccessPolicyResult contains the result from method Table.SetAccessPolicy. -type TableSetAccessPolicyResult struct { +// TableClientSetAccessPolicyResult contains the result from method TableClient.SetAccessPolicy. +type TableClientSetAccessPolicyResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string @@ -340,15 +340,15 @@ type TableSetAccessPolicyResult struct { Version *string } -// TableUpdateEntityResponse contains the response from method Table.UpdateEntity. -type TableUpdateEntityResponse struct { - TableUpdateEntityResult +// TableClientUpdateEntityResponse contains the response from method TableClient.UpdateEntity. +type TableClientUpdateEntityResponse struct { + TableClientUpdateEntityResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// TableUpdateEntityResult contains the result from method Table.UpdateEntity. -type TableUpdateEntityResult struct { +// TableClientUpdateEntityResult contains the result from method TableClient.UpdateEntity. +type TableClientUpdateEntityResult struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string diff --git a/sdk/data/aztables/internal/service_client.go b/sdk/data/aztables/internal/service_client.go index 8c7a58aa7351..5c94c0915a27 100644 --- a/sdk/data/aztables/internal/service_client.go +++ b/sdk/data/aztables/internal/service_client.go @@ -10,7 +10,7 @@ package internal import ( "context" - "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -21,35 +21,52 @@ import ( // ServiceClient contains the methods for the Service group. // Don't use this type directly, use NewServiceClient() instead. type ServiceClient struct { - con *Connection - version Enum0 + endpoint string + version Enum0 + pl runtime.Pipeline } // NewServiceClient creates a new instance of ServiceClient with the specified values. -func NewServiceClient(con *Connection, version Enum0) *ServiceClient { - return &ServiceClient{con: con, version: version} +// endpoint - The URL of the service account or table that is the target of the desired operation. +// version - Specifies the version of the operation to use for this request. +// options - pass nil to accept the default values. +func NewServiceClient(endpoint string, version Enum0, options *azcore.ClientOptions) *ServiceClient { + cp := azcore.ClientOptions{} + if options != nil { + cp = *options + } + client := &ServiceClient{ + endpoint: endpoint, + version: version, + pl: runtime.NewPipeline(moduleName, moduleVersion, runtime.PipelineOptions{}, &cp), + } + return client } -// GetProperties - Gets the properties of an account's Table service, including properties for Analytics and CORS (Cross-Origin Resource Sharing) rules. -// If the operation fails it returns the *TableServiceError error type. -func (client *ServiceClient) GetProperties(ctx context.Context, restype Enum5, comp Enum6, options *ServiceGetPropertiesOptions) (ServiceGetPropertiesResponse, error) { +// GetProperties - Gets the properties of an account's Table service, including properties for Analytics and CORS (Cross-Origin +// Resource Sharing) rules. +// If the operation fails it returns an *azcore.ResponseError type. +// restype - Required query string to set the service properties. +// comp - Required query string to set the service properties. +// options - ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. +func (client *ServiceClient) GetProperties(ctx context.Context, restype Enum5, comp Enum6, options *ServiceClientGetPropertiesOptions) (ServiceClientGetPropertiesResponse, error) { req, err := client.getPropertiesCreateRequest(ctx, restype, comp, options) if err != nil { - return ServiceGetPropertiesResponse{}, err + return ServiceClientGetPropertiesResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return ServiceGetPropertiesResponse{}, err + return ServiceClientGetPropertiesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceGetPropertiesResponse{}, client.getPropertiesHandleError(resp) + return ServiceClientGetPropertiesResponse{}, runtime.NewResponseError(resp) } return client.getPropertiesHandleResponse(resp) } // getPropertiesCreateRequest creates the GetProperties request. -func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, restype Enum5, comp Enum6, options *ServiceGetPropertiesOptions) (*policy.Request, error) { - req, err := runtime.NewRequest(ctx, http.MethodGet, client.con.Endpoint()) +func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, restype Enum5, comp Enum6, options *ServiceClientGetPropertiesOptions) (*policy.Request, error) { + req, err := runtime.NewRequest(ctx, http.MethodGet, client.endpoint) if err != nil { return nil, err } @@ -69,8 +86,8 @@ func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, res } // getPropertiesHandleResponse handles the GetProperties response. -func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (ServiceGetPropertiesResponse, error) { - result := ServiceGetPropertiesResponse{RawResponse: resp} +func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (ServiceClientGetPropertiesResponse, error) { + result := ServiceClientGetPropertiesResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -81,45 +98,35 @@ func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (S result.Version = &val } if err := runtime.UnmarshalAsXML(resp, &result.TableServiceProperties); err != nil { - return ServiceGetPropertiesResponse{}, err + return ServiceClientGetPropertiesResponse{}, err } return result, nil } -// getPropertiesHandleError handles the GetProperties error response. -func (client *ServiceClient) getPropertiesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetStatistics - Retrieves statistics related to replication for the Table service. It is only available on the secondary location endpoint when read-access -// geo-redundant replication is enabled for the account. -// If the operation fails it returns the *TableServiceError error type. -func (client *ServiceClient) GetStatistics(ctx context.Context, restype Enum5, comp Enum7, options *ServiceGetStatisticsOptions) (ServiceGetStatisticsResponse, error) { +// GetStatistics - Retrieves statistics related to replication for the Table service. It is only available on the secondary +// location endpoint when read-access geo-redundant replication is enabled for the account. +// If the operation fails it returns an *azcore.ResponseError type. +// restype - Required query string to get service stats. +// comp - Required query string to get service stats. +// options - ServiceClientGetStatisticsOptions contains the optional parameters for the ServiceClient.GetStatistics method. +func (client *ServiceClient) GetStatistics(ctx context.Context, restype Enum5, comp Enum7, options *ServiceClientGetStatisticsOptions) (ServiceClientGetStatisticsResponse, error) { req, err := client.getStatisticsCreateRequest(ctx, restype, comp, options) if err != nil { - return ServiceGetStatisticsResponse{}, err + return ServiceClientGetStatisticsResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return ServiceGetStatisticsResponse{}, err + return ServiceClientGetStatisticsResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceGetStatisticsResponse{}, client.getStatisticsHandleError(resp) + return ServiceClientGetStatisticsResponse{}, runtime.NewResponseError(resp) } return client.getStatisticsHandleResponse(resp) } // getStatisticsCreateRequest creates the GetStatistics request. -func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, restype Enum5, comp Enum7, options *ServiceGetStatisticsOptions) (*policy.Request, error) { - req, err := runtime.NewRequest(ctx, http.MethodGet, client.con.Endpoint()) +func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, restype Enum5, comp Enum7, options *ServiceClientGetStatisticsOptions) (*policy.Request, error) { + req, err := runtime.NewRequest(ctx, http.MethodGet, client.endpoint) if err != nil { return nil, err } @@ -139,8 +146,8 @@ func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, res } // getStatisticsHandleResponse handles the GetStatistics response. -func (client *ServiceClient) getStatisticsHandleResponse(resp *http.Response) (ServiceGetStatisticsResponse, error) { - result := ServiceGetStatisticsResponse{RawResponse: resp} +func (client *ServiceClient) getStatisticsHandleResponse(resp *http.Response) (ServiceClientGetStatisticsResponse, error) { + result := ServiceClientGetStatisticsResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -153,50 +160,41 @@ func (client *ServiceClient) getStatisticsHandleResponse(resp *http.Response) (S if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return ServiceGetStatisticsResponse{}, err + return ServiceClientGetStatisticsResponse{}, err } result.Date = &date } if err := runtime.UnmarshalAsXML(resp, &result.TableServiceStats); err != nil { - return ServiceGetStatisticsResponse{}, err + return ServiceClientGetStatisticsResponse{}, err } return result, nil } -// getStatisticsHandleError handles the GetStatistics error response. -func (client *ServiceClient) getStatisticsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// SetProperties - Sets properties for an account's Table service endpoint, including properties for Analytics and CORS (Cross-Origin Resource Sharing) -// rules. -// If the operation fails it returns the *TableServiceError error type. -func (client *ServiceClient) SetProperties(ctx context.Context, restype Enum5, comp Enum6, tableServiceProperties TableServiceProperties, options *ServiceSetPropertiesOptions) (ServiceSetPropertiesResponse, error) { +// SetProperties - Sets properties for an account's Table service endpoint, including properties for Analytics and CORS (Cross-Origin +// Resource Sharing) rules. +// If the operation fails it returns an *azcore.ResponseError type. +// restype - Required query string to set the service properties. +// comp - Required query string to set the service properties. +// tableServiceProperties - The Table Service properties. +// options - ServiceClientSetPropertiesOptions contains the optional parameters for the ServiceClient.SetProperties method. +func (client *ServiceClient) SetProperties(ctx context.Context, restype Enum5, comp Enum6, tableServiceProperties TableServiceProperties, options *ServiceClientSetPropertiesOptions) (ServiceClientSetPropertiesResponse, error) { req, err := client.setPropertiesCreateRequest(ctx, restype, comp, tableServiceProperties, options) if err != nil { - return ServiceSetPropertiesResponse{}, err + return ServiceClientSetPropertiesResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return ServiceSetPropertiesResponse{}, err + return ServiceClientSetPropertiesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ServiceSetPropertiesResponse{}, client.setPropertiesHandleError(resp) + return ServiceClientSetPropertiesResponse{}, runtime.NewResponseError(resp) } return client.setPropertiesHandleResponse(resp) } // setPropertiesCreateRequest creates the SetProperties request. -func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, restype Enum5, comp Enum6, tableServiceProperties TableServiceProperties, options *ServiceSetPropertiesOptions) (*policy.Request, error) { - req, err := runtime.NewRequest(ctx, http.MethodPut, client.con.Endpoint()) +func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, restype Enum5, comp Enum6, tableServiceProperties TableServiceProperties, options *ServiceClientSetPropertiesOptions) (*policy.Request, error) { + req, err := runtime.NewRequest(ctx, http.MethodPut, client.endpoint) if err != nil { return nil, err } @@ -216,8 +214,8 @@ func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, res } // setPropertiesHandleResponse handles the SetProperties response. -func (client *ServiceClient) setPropertiesHandleResponse(resp *http.Response) (ServiceSetPropertiesResponse, error) { - result := ServiceSetPropertiesResponse{RawResponse: resp} +func (client *ServiceClient) setPropertiesHandleResponse(resp *http.Response) (ServiceClientSetPropertiesResponse, error) { + result := ServiceClientSetPropertiesResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -229,16 +227,3 @@ func (client *ServiceClient) setPropertiesHandleResponse(resp *http.Response) (S } return result, nil } - -// setPropertiesHandleError handles the SetProperties error response. -func (client *ServiceClient) setPropertiesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/data/aztables/internal/table_client.go b/sdk/data/aztables/internal/table_client.go index 348b26c9f147..d0726cb95858 100644 --- a/sdk/data/aztables/internal/table_client.go +++ b/sdk/data/aztables/internal/table_client.go @@ -12,50 +12,66 @@ import ( "context" "encoding/xml" "errors" - "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" "strconv" "strings" "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) // TableClient contains the methods for the Table group. // Don't use this type directly, use NewTableClient() instead. type TableClient struct { - con *Connection - version Enum0 + endpoint string + version Enum0 + pl runtime.Pipeline } // NewTableClient creates a new instance of TableClient with the specified values. -func NewTableClient(con *Connection, version Enum0) *TableClient { - return &TableClient{con: con, version: version} +// endpoint - The URL of the service account or table that is the target of the desired operation. +// version - Specifies the version of the operation to use for this request. +// options - pass nil to accept the default values. +func NewTableClient(endpoint string, version Enum0, options *azcore.ClientOptions) *TableClient { + cp := azcore.ClientOptions{} + if options != nil { + cp = *options + } + client := &TableClient{ + endpoint: endpoint, + version: version, + pl: runtime.NewPipeline(moduleName, moduleVersion, runtime.PipelineOptions{}, &cp), + } + return client } // Create - Creates a new table under the given account. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) Create(ctx context.Context, dataServiceVersion Enum1, tableProperties TableProperties, tableCreateOptions *TableCreateOptions, queryOptions *QueryOptions) (TableCreateResponse, error) { - req, err := client.createCreateRequest(ctx, dataServiceVersion, tableProperties, tableCreateOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// tableProperties - The Table properties. +// TableClientCreateOptions - TableClientCreateOptions contains the optional parameters for the TableClient.Create method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) Create(ctx context.Context, dataServiceVersion Enum1, tableProperties TableProperties, tableClientCreateOptions *TableClientCreateOptions, queryOptions *QueryOptions) (TableClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, dataServiceVersion, tableProperties, tableClientCreateOptions, queryOptions) if err != nil { - return TableCreateResponse{}, err + return TableClientCreateResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableCreateResponse{}, err + return TableClientCreateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated, http.StatusNoContent) { - return TableCreateResponse{}, client.createHandleError(resp) + return TableClientCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) } // createCreateRequest creates the Create request. -func (client *TableClient) createCreateRequest(ctx context.Context, dataServiceVersion Enum1, tableProperties TableProperties, tableCreateOptions *TableCreateOptions, queryOptions *QueryOptions) (*policy.Request, error) { +func (client *TableClient) createCreateRequest(ctx context.Context, dataServiceVersion Enum1, tableProperties TableProperties, tableClientCreateOptions *TableClientCreateOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/Tables" - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } @@ -65,20 +81,20 @@ func (client *TableClient) createCreateRequest(ctx context.Context, dataServiceV } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableCreateOptions != nil && tableCreateOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableCreateOptions.RequestID) + if tableClientCreateOptions != nil && tableClientCreateOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientCreateOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) - if tableCreateOptions != nil && tableCreateOptions.ResponsePreference != nil { - req.Raw().Header.Set("Prefer", string(*tableCreateOptions.ResponsePreference)) + if tableClientCreateOptions != nil && tableClientCreateOptions.ResponsePreference != nil { + req.Raw().Header.Set("Prefer", string(*tableClientCreateOptions.ResponsePreference)) } req.Raw().Header.Set("Accept", "application/json;odata=minimalmetadata") return req, runtime.MarshalAsJSON(req, tableProperties) } // createHandleResponse handles the Create response. -func (client *TableClient) createHandleResponse(resp *http.Response) (TableCreateResponse, error) { - result := TableCreateResponse{RawResponse: resp} +func (client *TableClient) createHandleResponse(resp *http.Response) (TableClientCreateResponse, error) { + result := TableClientCreateResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -91,7 +107,7 @@ func (client *TableClient) createHandleResponse(resp *http.Response) (TableCreat if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableCreateResponse{}, err + return TableClientCreateResponse{}, err } result.Date = &date } @@ -99,49 +115,38 @@ func (client *TableClient) createHandleResponse(resp *http.Response) (TableCreat result.PreferenceApplied = &val } if err := runtime.UnmarshalAsJSON(resp, &result.TableResponse); err != nil { - return TableCreateResponse{}, err + return TableClientCreateResponse{}, err } return result, nil } -// createHandleError handles the Create error response. -func (client *TableClient) createHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - Operation permanently deletes the specified table. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) Delete(ctx context.Context, table string, options *TableDeleteOptions) (TableDeleteResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// table - The name of the table. +// options - TableClientDeleteOptions contains the optional parameters for the TableClient.Delete method. +func (client *TableClient) Delete(ctx context.Context, table string, options *TableClientDeleteOptions) (TableClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, table, options) if err != nil { - return TableDeleteResponse{}, err + return TableClientDeleteResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableDeleteResponse{}, err + return TableClientDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TableDeleteResponse{}, client.deleteHandleError(resp) + return TableClientDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } // deleteCreateRequest creates the Delete request. -func (client *TableClient) deleteCreateRequest(ctx context.Context, table string, options *TableDeleteOptions) (*policy.Request, error) { +func (client *TableClient) deleteCreateRequest(ctx context.Context, table string, options *TableClientDeleteOptions) (*policy.Request, error) { urlPath := "/Tables('{table}')" if table == "" { return nil, errors.New("parameter table cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } @@ -154,8 +159,8 @@ func (client *TableClient) deleteCreateRequest(ctx context.Context, table string } // deleteHandleResponse handles the Delete response. -func (client *TableClient) deleteHandleResponse(resp *http.Response) (TableDeleteResponse, error) { - result := TableDeleteResponse{RawResponse: resp} +func (client *TableClient) deleteHandleResponse(resp *http.Response) (TableClientDeleteResponse, error) { + result := TableClientDeleteResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -168,45 +173,41 @@ func (client *TableClient) deleteHandleResponse(resp *http.Response) (TableDelet if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableDeleteResponse{}, err + return TableClientDeleteResponse{}, err } result.Date = &date } return result, nil } -// deleteHandleError handles the Delete error response. -func (client *TableClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // DeleteEntity - Deletes the specified entity in a table. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) DeleteEntity(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, ifMatch string, tableDeleteEntityOptions *TableDeleteEntityOptions, queryOptions *QueryOptions) (TableDeleteEntityResponse, error) { - req, err := client.DeleteEntityCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, ifMatch, tableDeleteEntityOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// table - The name of the table. +// partitionKey - The partition key of the entity. +// rowKey - The row key of the entity. +// ifMatch - Match condition for an entity to be deleted. If specified and a matching entity is not found, an error will be +// raised. To force an unconditional delete, set to the wildcard character (*). +// TableClientDeleteEntityOptions - TableClientDeleteEntityOptions contains the optional parameters for the TableClient.DeleteEntity +// method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) DeleteEntity(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, ifMatch string, tableClientDeleteEntityOptions *TableClientDeleteEntityOptions, queryOptions *QueryOptions) (TableClientDeleteEntityResponse, error) { + req, err := client.DeleteEntityCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, ifMatch, tableClientDeleteEntityOptions, queryOptions) if err != nil { - return TableDeleteEntityResponse{}, err + return TableClientDeleteEntityResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableDeleteEntityResponse{}, err + return TableClientDeleteEntityResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TableDeleteEntityResponse{}, client.deleteEntityHandleError(resp) + return TableClientDeleteEntityResponse{}, runtime.NewResponseError(resp) } return client.deleteEntityHandleResponse(resp) } -// DeleteEntityCreateRequest creates the DeleteEntity request. -func (client *TableClient) DeleteEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, ifMatch string, tableDeleteEntityOptions *TableDeleteEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { +// deleteEntityCreateRequest creates the DeleteEntity request. +func (client *TableClient) DeleteEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, ifMatch string, tableClientDeleteEntityOptions *TableClientDeleteEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" if table == "" { return nil, errors.New("parameter table cannot be empty") @@ -220,21 +221,21 @@ func (client *TableClient) DeleteEntityCreateRequest(ctx context.Context, dataSe return nil, errors.New("parameter rowKey cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - if tableDeleteEntityOptions != nil && tableDeleteEntityOptions.Timeout != nil { - reqQP.Set("timeout", strconv.FormatInt(int64(*tableDeleteEntityOptions.Timeout), 10)) + if tableClientDeleteEntityOptions != nil && tableClientDeleteEntityOptions.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*tableClientDeleteEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { reqQP.Set("$format", string(*queryOptions.Format)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableDeleteEntityOptions != nil && tableDeleteEntityOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableDeleteEntityOptions.RequestID) + if tableClientDeleteEntityOptions != nil && tableClientDeleteEntityOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientDeleteEntityOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) req.Raw().Header.Set("If-Match", ifMatch) @@ -243,8 +244,8 @@ func (client *TableClient) DeleteEntityCreateRequest(ctx context.Context, dataSe } // deleteEntityHandleResponse handles the DeleteEntity response. -func (client *TableClient) deleteEntityHandleResponse(resp *http.Response) (TableDeleteEntityResponse, error) { - result := TableDeleteEntityResponse{RawResponse: resp} +func (client *TableClient) deleteEntityHandleResponse(resp *http.Response) (TableClientDeleteEntityResponse, error) { + result := TableClientDeleteEntityResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -257,51 +258,42 @@ func (client *TableClient) deleteEntityHandleResponse(resp *http.Response) (Tabl if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableDeleteEntityResponse{}, err + return TableClientDeleteEntityResponse{}, err } result.Date = &date } return result, nil } -// deleteEntityHandleError handles the DeleteEntity error response. -func (client *TableClient) deleteEntityHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetAccessPolicy - Retrieves details about any stored access policies specified on the table that may be used with Shared Access Signatures. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) GetAccessPolicy(ctx context.Context, table string, comp Enum4, options *TableGetAccessPolicyOptions) (TableGetAccessPolicyResponse, error) { +// GetAccessPolicy - Retrieves details about any stored access policies specified on the table that may be used with Shared +// Access Signatures. +// If the operation fails it returns an *azcore.ResponseError type. +// table - The name of the table. +// comp - Required query string to handle stored access policies for the table that may be used with Shared Access Signatures. +// options - TableClientGetAccessPolicyOptions contains the optional parameters for the TableClient.GetAccessPolicy method. +func (client *TableClient) GetAccessPolicy(ctx context.Context, table string, comp Enum4, options *TableClientGetAccessPolicyOptions) (TableClientGetAccessPolicyResponse, error) { req, err := client.getAccessPolicyCreateRequest(ctx, table, comp, options) if err != nil { - return TableGetAccessPolicyResponse{}, err + return TableClientGetAccessPolicyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableGetAccessPolicyResponse{}, err + return TableClientGetAccessPolicyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return TableGetAccessPolicyResponse{}, client.getAccessPolicyHandleError(resp) + return TableClientGetAccessPolicyResponse{}, runtime.NewResponseError(resp) } return client.getAccessPolicyHandleResponse(resp) } // getAccessPolicyCreateRequest creates the GetAccessPolicy request. -func (client *TableClient) getAccessPolicyCreateRequest(ctx context.Context, table string, comp Enum4, options *TableGetAccessPolicyOptions) (*policy.Request, error) { +func (client *TableClient) getAccessPolicyCreateRequest(ctx context.Context, table string, comp Enum4, options *TableClientGetAccessPolicyOptions) (*policy.Request, error) { urlPath := "/{table}" if table == "" { return nil, errors.New("parameter table cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } @@ -320,8 +312,8 @@ func (client *TableClient) getAccessPolicyCreateRequest(ctx context.Context, tab } // getAccessPolicyHandleResponse handles the GetAccessPolicy response. -func (client *TableClient) getAccessPolicyHandleResponse(resp *http.Response) (TableGetAccessPolicyResponse, error) { - result := TableGetAccessPolicyResponse{RawResponse: resp} +func (client *TableClient) getAccessPolicyHandleResponse(resp *http.Response) (TableClientGetAccessPolicyResponse, error) { + result := TableClientGetAccessPolicyResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -334,83 +326,75 @@ func (client *TableClient) getAccessPolicyHandleResponse(resp *http.Response) (T if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableGetAccessPolicyResponse{}, err + return TableClientGetAccessPolicyResponse{}, err } result.Date = &date } if err := runtime.UnmarshalAsXML(resp, &result); err != nil { - return TableGetAccessPolicyResponse{}, err + return TableClientGetAccessPolicyResponse{}, err } return result, nil } -// getAccessPolicyHandleError handles the GetAccessPolicy error response. -func (client *TableClient) getAccessPolicyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // InsertEntity - Insert entity in a table. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) InsertEntity(ctx context.Context, dataServiceVersion Enum1, table string, tableInsertEntityOptions *TableInsertEntityOptions, queryOptions *QueryOptions) (TableInsertEntityResponse, error) { - req, err := client.InsertEntityCreateRequest(ctx, dataServiceVersion, table, tableInsertEntityOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// table - The name of the table. +// TableClientInsertEntityOptions - TableClientInsertEntityOptions contains the optional parameters for the TableClient.InsertEntity +// method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) InsertEntity(ctx context.Context, dataServiceVersion Enum1, table string, tableClientInsertEntityOptions *TableClientInsertEntityOptions, queryOptions *QueryOptions) (TableClientInsertEntityResponse, error) { + req, err := client.InsertEntityCreateRequest(ctx, dataServiceVersion, table, tableClientInsertEntityOptions, queryOptions) if err != nil { - return TableInsertEntityResponse{}, err + return TableClientInsertEntityResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableInsertEntityResponse{}, err + return TableClientInsertEntityResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated, http.StatusNoContent) { - return TableInsertEntityResponse{}, client.insertEntityHandleError(resp) + return TableClientInsertEntityResponse{}, runtime.NewResponseError(resp) } return client.insertEntityHandleResponse(resp) } -// InsertEntityCreateRequest creates the InsertEntity request. -func (client *TableClient) InsertEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, tableInsertEntityOptions *TableInsertEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { +// insertEntityCreateRequest creates the InsertEntity request. +func (client *TableClient) InsertEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, tableClientInsertEntityOptions *TableClientInsertEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/{table}" if table == "" { return nil, errors.New("parameter table cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - if tableInsertEntityOptions != nil && tableInsertEntityOptions.Timeout != nil { - reqQP.Set("timeout", strconv.FormatInt(int64(*tableInsertEntityOptions.Timeout), 10)) + if tableClientInsertEntityOptions != nil && tableClientInsertEntityOptions.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*tableClientInsertEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { reqQP.Set("$format", string(*queryOptions.Format)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableInsertEntityOptions != nil && tableInsertEntityOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableInsertEntityOptions.RequestID) + if tableClientInsertEntityOptions != nil && tableClientInsertEntityOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientInsertEntityOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) - if tableInsertEntityOptions != nil && tableInsertEntityOptions.ResponsePreference != nil { - req.Raw().Header.Set("Prefer", string(*tableInsertEntityOptions.ResponsePreference)) + if tableClientInsertEntityOptions != nil && tableClientInsertEntityOptions.ResponsePreference != nil { + req.Raw().Header.Set("Prefer", string(*tableClientInsertEntityOptions.ResponsePreference)) } req.Raw().Header.Set("Accept", "application/json;odata=minimalmetadata") - if tableInsertEntityOptions != nil && tableInsertEntityOptions.TableEntityProperties != nil { - return req, runtime.MarshalAsJSON(req, tableInsertEntityOptions.TableEntityProperties) + if tableClientInsertEntityOptions != nil && tableClientInsertEntityOptions.TableEntityProperties != nil { + return req, runtime.MarshalAsJSON(req, tableClientInsertEntityOptions.TableEntityProperties) } return req, nil } // insertEntityHandleResponse handles the InsertEntity response. -func (client *TableClient) insertEntityHandleResponse(resp *http.Response) (TableInsertEntityResponse, error) { - result := TableInsertEntityResponse{RawResponse: resp} +func (client *TableClient) insertEntityHandleResponse(resp *http.Response) (TableClientInsertEntityResponse, error) { + result := TableClientInsertEntityResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -423,7 +407,7 @@ func (client *TableClient) insertEntityHandleResponse(resp *http.Response) (Tabl if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableInsertEntityResponse{}, err + return TableClientInsertEntityResponse{}, err } result.Date = &date } @@ -437,43 +421,37 @@ func (client *TableClient) insertEntityHandleResponse(resp *http.Response) (Tabl result.ContentType = &val } if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { - return TableInsertEntityResponse{}, err + return TableClientInsertEntityResponse{}, err } return result, nil } -// insertEntityHandleError handles the InsertEntity error response. -func (client *TableClient) insertEntityHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // MergeEntity - Merge entity in a table. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) MergeEntity(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableMergeEntityOptions *TableMergeEntityOptions, queryOptions *QueryOptions) (TableMergeEntityResponse, error) { - req, err := client.MergeEntityCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, tableMergeEntityOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// table - The name of the table. +// partitionKey - The partition key of the entity. +// rowKey - The row key of the entity. +// TableClientMergeEntityOptions - TableClientMergeEntityOptions contains the optional parameters for the TableClient.MergeEntity +// method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) MergeEntity(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableClientMergeEntityOptions *TableClientMergeEntityOptions, queryOptions *QueryOptions) (TableClientMergeEntityResponse, error) { + req, err := client.MergeEntityCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, tableClientMergeEntityOptions, queryOptions) if err != nil { - return TableMergeEntityResponse{}, err + return TableClientMergeEntityResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableMergeEntityResponse{}, err + return TableClientMergeEntityResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TableMergeEntityResponse{}, client.mergeEntityHandleError(resp) + return TableClientMergeEntityResponse{}, runtime.NewResponseError(resp) } return client.mergeEntityHandleResponse(resp) } -// MergeEntityCreateRequest creates the MergeEntity request. -func (client *TableClient) MergeEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableMergeEntityOptions *TableMergeEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { +// mergeEntityCreateRequest creates the MergeEntity request. +func (client *TableClient) MergeEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableClientMergeEntityOptions *TableClientMergeEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" if table == "" { return nil, errors.New("parameter table cannot be empty") @@ -487,36 +465,36 @@ func (client *TableClient) MergeEntityCreateRequest(ctx context.Context, dataSer return nil, errors.New("parameter rowKey cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - if tableMergeEntityOptions != nil && tableMergeEntityOptions.Timeout != nil { - reqQP.Set("timeout", strconv.FormatInt(int64(*tableMergeEntityOptions.Timeout), 10)) + if tableClientMergeEntityOptions != nil && tableClientMergeEntityOptions.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*tableClientMergeEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { reqQP.Set("$format", string(*queryOptions.Format)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableMergeEntityOptions != nil && tableMergeEntityOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableMergeEntityOptions.RequestID) + if tableClientMergeEntityOptions != nil && tableClientMergeEntityOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientMergeEntityOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) - if tableMergeEntityOptions != nil && tableMergeEntityOptions.IfMatch != nil { - req.Raw().Header.Set("If-Match", *tableMergeEntityOptions.IfMatch) + if tableClientMergeEntityOptions != nil && tableClientMergeEntityOptions.IfMatch != nil { + req.Raw().Header.Set("If-Match", *tableClientMergeEntityOptions.IfMatch) } req.Raw().Header.Set("Accept", "application/json") - if tableMergeEntityOptions != nil && tableMergeEntityOptions.TableEntityProperties != nil { - return req, runtime.MarshalAsJSON(req, tableMergeEntityOptions.TableEntityProperties) + if tableClientMergeEntityOptions != nil && tableClientMergeEntityOptions.TableEntityProperties != nil { + return req, runtime.MarshalAsJSON(req, tableClientMergeEntityOptions.TableEntityProperties) } return req, nil } // mergeEntityHandleResponse handles the MergeEntity response. -func (client *TableClient) mergeEntityHandleResponse(resp *http.Response) (TableMergeEntityResponse, error) { - result := TableMergeEntityResponse{RawResponse: resp} +func (client *TableClient) mergeEntityHandleResponse(resp *http.Response) (TableClientMergeEntityResponse, error) { + result := TableClientMergeEntityResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -529,7 +507,7 @@ func (client *TableClient) mergeEntityHandleResponse(resp *http.Response) (Table if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableMergeEntityResponse{}, err + return TableClientMergeEntityResponse{}, err } result.Date = &date } @@ -539,40 +517,30 @@ func (client *TableClient) mergeEntityHandleResponse(resp *http.Response) (Table return result, nil } -// mergeEntityHandleError handles the MergeEntity error response. -func (client *TableClient) mergeEntityHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Query - Queries tables under the given account. -// If the operation fails it returns a generic error. -func (client *TableClient) Query(ctx context.Context, dataServiceVersion Enum1, tableQueryOptions *TableQueryOptions, queryOptions *QueryOptions) (TableQueryResponseEnvelope, error) { - req, err := client.queryCreateRequest(ctx, dataServiceVersion, tableQueryOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// TableClientQueryOptions - TableClientQueryOptions contains the optional parameters for the TableClient.Query method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) Query(ctx context.Context, dataServiceVersion Enum1, tableClientQueryOptions *TableClientQueryOptions, queryOptions *QueryOptions) (TableClientQueryResponse, error) { + req, err := client.queryCreateRequest(ctx, dataServiceVersion, tableClientQueryOptions, queryOptions) if err != nil { - return TableQueryResponseEnvelope{}, err + return TableClientQueryResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableQueryResponseEnvelope{}, err + return TableClientQueryResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return TableQueryResponseEnvelope{}, client.queryHandleError(resp) + return TableClientQueryResponse{}, runtime.NewResponseError(resp) } return client.queryHandleResponse(resp) } // queryCreateRequest creates the Query request. -func (client *TableClient) queryCreateRequest(ctx context.Context, dataServiceVersion Enum1, tableQueryOptions *TableQueryOptions, queryOptions *QueryOptions) (*policy.Request, error) { +func (client *TableClient) queryCreateRequest(ctx context.Context, dataServiceVersion Enum1, tableClientQueryOptions *TableClientQueryOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/Tables" - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } @@ -589,13 +557,13 @@ func (client *TableClient) queryCreateRequest(ctx context.Context, dataServiceVe if queryOptions != nil && queryOptions.Filter != nil { reqQP.Set("$filter", *queryOptions.Filter) } - if tableQueryOptions != nil && tableQueryOptions.NextTableName != nil { - reqQP.Set("NextTableName", *tableQueryOptions.NextTableName) + if tableClientQueryOptions != nil && tableClientQueryOptions.NextTableName != nil { + reqQP.Set("NextTableName", *tableClientQueryOptions.NextTableName) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableQueryOptions != nil && tableQueryOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableQueryOptions.RequestID) + if tableClientQueryOptions != nil && tableClientQueryOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientQueryOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) req.Raw().Header.Set("Accept", "application/json;odata=minimalmetadata") @@ -603,8 +571,8 @@ func (client *TableClient) queryCreateRequest(ctx context.Context, dataServiceVe } // queryHandleResponse handles the Query response. -func (client *TableClient) queryHandleResponse(resp *http.Response) (TableQueryResponseEnvelope, error) { - result := TableQueryResponseEnvelope{RawResponse: resp} +func (client *TableClient) queryHandleResponse(resp *http.Response) (TableClientQueryResponse, error) { + result := TableClientQueryResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -617,7 +585,7 @@ func (client *TableClient) queryHandleResponse(resp *http.Response) (TableQueryR if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableQueryResponseEnvelope{}, err + return TableClientQueryResponse{}, err } result.Date = &date } @@ -625,54 +593,47 @@ func (client *TableClient) queryHandleResponse(resp *http.Response) (TableQueryR result.XMSContinuationNextTableName = &val } if err := runtime.UnmarshalAsJSON(resp, &result.TableQueryResponse); err != nil { - return TableQueryResponseEnvelope{}, err + return TableClientQueryResponse{}, err } return result, nil } -// queryHandleError handles the Query error response. -func (client *TableClient) queryHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - if len(body) == 0 { - return runtime.NewResponseError(errors.New(resp.Status), resp) - } - return runtime.NewResponseError(errors.New(string(body)), resp) -} - // QueryEntities - Queries entities in a table. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) QueryEntities(ctx context.Context, dataServiceVersion Enum1, table string, tableQueryEntitiesOptions *TableQueryEntitiesOptions, queryOptions *QueryOptions) (TableQueryEntitiesResponse, error) { - req, err := client.queryEntitiesCreateRequest(ctx, dataServiceVersion, table, tableQueryEntitiesOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// table - The name of the table. +// TableClientQueryEntitiesOptions - TableClientQueryEntitiesOptions contains the optional parameters for the TableClient.QueryEntities +// method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) QueryEntities(ctx context.Context, dataServiceVersion Enum1, table string, tableClientQueryEntitiesOptions *TableClientQueryEntitiesOptions, queryOptions *QueryOptions) (TableClientQueryEntitiesResponse, error) { + req, err := client.queryEntitiesCreateRequest(ctx, dataServiceVersion, table, tableClientQueryEntitiesOptions, queryOptions) if err != nil { - return TableQueryEntitiesResponse{}, err + return TableClientQueryEntitiesResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableQueryEntitiesResponse{}, err + return TableClientQueryEntitiesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return TableQueryEntitiesResponse{}, client.queryEntitiesHandleError(resp) + return TableClientQueryEntitiesResponse{}, runtime.NewResponseError(resp) } return client.queryEntitiesHandleResponse(resp) } // queryEntitiesCreateRequest creates the QueryEntities request. -func (client *TableClient) queryEntitiesCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, tableQueryEntitiesOptions *TableQueryEntitiesOptions, queryOptions *QueryOptions) (*policy.Request, error) { +func (client *TableClient) queryEntitiesCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, tableClientQueryEntitiesOptions *TableClientQueryEntitiesOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/{table}()" if table == "" { return nil, errors.New("parameter table cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.Timeout != nil { - reqQP.Set("timeout", strconv.FormatInt(int64(*tableQueryEntitiesOptions.Timeout), 10)) + if tableClientQueryEntitiesOptions != nil && tableClientQueryEntitiesOptions.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*tableClientQueryEntitiesOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { reqQP.Set("$format", string(*queryOptions.Format)) @@ -686,16 +647,16 @@ func (client *TableClient) queryEntitiesCreateRequest(ctx context.Context, dataS if queryOptions != nil && queryOptions.Filter != nil { reqQP.Set("$filter", *queryOptions.Filter) } - if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.NextPartitionKey != nil { - reqQP.Set("NextPartitionKey", *tableQueryEntitiesOptions.NextPartitionKey) + if tableClientQueryEntitiesOptions != nil && tableClientQueryEntitiesOptions.NextPartitionKey != nil { + reqQP.Set("NextPartitionKey", *tableClientQueryEntitiesOptions.NextPartitionKey) } - if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.NextRowKey != nil { - reqQP.Set("NextRowKey", *tableQueryEntitiesOptions.NextRowKey) + if tableClientQueryEntitiesOptions != nil && tableClientQueryEntitiesOptions.NextRowKey != nil { + reqQP.Set("NextRowKey", *tableClientQueryEntitiesOptions.NextRowKey) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableQueryEntitiesOptions != nil && tableQueryEntitiesOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableQueryEntitiesOptions.RequestID) + if tableClientQueryEntitiesOptions != nil && tableClientQueryEntitiesOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientQueryEntitiesOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) req.Raw().Header.Set("Accept", "application/json;odata=minimalmetadata") @@ -703,8 +664,8 @@ func (client *TableClient) queryEntitiesCreateRequest(ctx context.Context, dataS } // queryEntitiesHandleResponse handles the QueryEntities response. -func (client *TableClient) queryEntitiesHandleResponse(resp *http.Response) (TableQueryEntitiesResponse, error) { - result := TableQueryEntitiesResponse{RawResponse: resp} +func (client *TableClient) queryEntitiesHandleResponse(resp *http.Response) (TableClientQueryEntitiesResponse, error) { + result := TableClientQueryEntitiesResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -717,7 +678,7 @@ func (client *TableClient) queryEntitiesHandleResponse(resp *http.Response) (Tab if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableQueryEntitiesResponse{}, err + return TableClientQueryEntitiesResponse{}, err } result.Date = &date } @@ -728,43 +689,37 @@ func (client *TableClient) queryEntitiesHandleResponse(resp *http.Response) (Tab result.XMSContinuationNextRowKey = &val } if err := runtime.UnmarshalAsJSON(resp, &result.TableEntityQueryResponse); err != nil { - return TableQueryEntitiesResponse{}, err + return TableClientQueryEntitiesResponse{}, err } return result, nil } -// queryEntitiesHandleError handles the QueryEntities error response. -func (client *TableClient) queryEntitiesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // QueryEntityWithPartitionAndRowKey - Queries a single entity in a table. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) QueryEntityWithPartitionAndRowKey(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableQueryEntityWithPartitionAndRowKeyOptions *TableQueryEntityWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (TableQueryEntityWithPartitionAndRowKeyResponse, error) { - req, err := client.queryEntityWithPartitionAndRowKeyCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, tableQueryEntityWithPartitionAndRowKeyOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// table - The name of the table. +// partitionKey - The partition key of the entity. +// rowKey - The row key of the entity. +// TableClientQueryEntityWithPartitionAndRowKeyOptions - TableClientQueryEntityWithPartitionAndRowKeyOptions contains the +// optional parameters for the TableClient.QueryEntityWithPartitionAndRowKey method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) QueryEntityWithPartitionAndRowKey(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableClientQueryEntityWithPartitionAndRowKeyOptions *TableClientQueryEntityWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (TableClientQueryEntityWithPartitionAndRowKeyResponse, error) { + req, err := client.queryEntityWithPartitionAndRowKeyCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, tableClientQueryEntityWithPartitionAndRowKeyOptions, queryOptions) if err != nil { - return TableQueryEntityWithPartitionAndRowKeyResponse{}, err + return TableClientQueryEntityWithPartitionAndRowKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableQueryEntityWithPartitionAndRowKeyResponse{}, err + return TableClientQueryEntityWithPartitionAndRowKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return TableQueryEntityWithPartitionAndRowKeyResponse{}, client.queryEntityWithPartitionAndRowKeyHandleError(resp) + return TableClientQueryEntityWithPartitionAndRowKeyResponse{}, runtime.NewResponseError(resp) } return client.queryEntityWithPartitionAndRowKeyHandleResponse(resp) } // queryEntityWithPartitionAndRowKeyCreateRequest creates the QueryEntityWithPartitionAndRowKey request. -func (client *TableClient) queryEntityWithPartitionAndRowKeyCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableQueryEntityWithPartitionAndRowKeyOptions *TableQueryEntityWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (*policy.Request, error) { +func (client *TableClient) queryEntityWithPartitionAndRowKeyCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableClientQueryEntityWithPartitionAndRowKeyOptions *TableClientQueryEntityWithPartitionAndRowKeyOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" if table == "" { return nil, errors.New("parameter table cannot be empty") @@ -778,13 +733,13 @@ func (client *TableClient) queryEntityWithPartitionAndRowKeyCreateRequest(ctx co return nil, errors.New("parameter rowKey cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - if tableQueryEntityWithPartitionAndRowKeyOptions != nil && tableQueryEntityWithPartitionAndRowKeyOptions.Timeout != nil { - reqQP.Set("timeout", strconv.FormatInt(int64(*tableQueryEntityWithPartitionAndRowKeyOptions.Timeout), 10)) + if tableClientQueryEntityWithPartitionAndRowKeyOptions != nil && tableClientQueryEntityWithPartitionAndRowKeyOptions.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*tableClientQueryEntityWithPartitionAndRowKeyOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { reqQP.Set("$format", string(*queryOptions.Format)) @@ -797,8 +752,8 @@ func (client *TableClient) queryEntityWithPartitionAndRowKeyCreateRequest(ctx co } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableQueryEntityWithPartitionAndRowKeyOptions != nil && tableQueryEntityWithPartitionAndRowKeyOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableQueryEntityWithPartitionAndRowKeyOptions.RequestID) + if tableClientQueryEntityWithPartitionAndRowKeyOptions != nil && tableClientQueryEntityWithPartitionAndRowKeyOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientQueryEntityWithPartitionAndRowKeyOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) req.Raw().Header.Set("Accept", "application/json;odata=minimalmetadata") @@ -806,8 +761,8 @@ func (client *TableClient) queryEntityWithPartitionAndRowKeyCreateRequest(ctx co } // queryEntityWithPartitionAndRowKeyHandleResponse handles the QueryEntityWithPartitionAndRowKey response. -func (client *TableClient) queryEntityWithPartitionAndRowKeyHandleResponse(resp *http.Response) (TableQueryEntityWithPartitionAndRowKeyResponse, error) { - result := TableQueryEntityWithPartitionAndRowKeyResponse{RawResponse: resp} +func (client *TableClient) queryEntityWithPartitionAndRowKeyHandleResponse(resp *http.Response) (TableClientQueryEntityWithPartitionAndRowKeyResponse, error) { + result := TableClientQueryEntityWithPartitionAndRowKeyResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -820,7 +775,7 @@ func (client *TableClient) queryEntityWithPartitionAndRowKeyHandleResponse(resp if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableQueryEntityWithPartitionAndRowKeyResponse{}, err + return TableClientQueryEntityWithPartitionAndRowKeyResponse{}, err } result.Date = &date } @@ -834,49 +789,39 @@ func (client *TableClient) queryEntityWithPartitionAndRowKeyHandleResponse(resp result.XMSContinuationNextRowKey = &val } if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { - return TableQueryEntityWithPartitionAndRowKeyResponse{}, err + return TableClientQueryEntityWithPartitionAndRowKeyResponse{}, err } return result, nil } -// queryEntityWithPartitionAndRowKeyHandleError handles the QueryEntityWithPartitionAndRowKey error response. -func (client *TableClient) queryEntityWithPartitionAndRowKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetAccessPolicy - Sets stored access policies for the table that may be used with Shared Access Signatures. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) SetAccessPolicy(ctx context.Context, table string, comp Enum4, options *TableSetAccessPolicyOptions) (TableSetAccessPolicyResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// table - The name of the table. +// comp - Required query string to handle stored access policies for the table that may be used with Shared Access Signatures. +// options - TableClientSetAccessPolicyOptions contains the optional parameters for the TableClient.SetAccessPolicy method. +func (client *TableClient) SetAccessPolicy(ctx context.Context, table string, comp Enum4, options *TableClientSetAccessPolicyOptions) (TableClientSetAccessPolicyResponse, error) { req, err := client.setAccessPolicyCreateRequest(ctx, table, comp, options) if err != nil { - return TableSetAccessPolicyResponse{}, err + return TableClientSetAccessPolicyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableSetAccessPolicyResponse{}, err + return TableClientSetAccessPolicyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TableSetAccessPolicyResponse{}, client.setAccessPolicyHandleError(resp) + return TableClientSetAccessPolicyResponse{}, runtime.NewResponseError(resp) } return client.setAccessPolicyHandleResponse(resp) } // setAccessPolicyCreateRequest creates the SetAccessPolicy request. -func (client *TableClient) setAccessPolicyCreateRequest(ctx context.Context, table string, comp Enum4, options *TableSetAccessPolicyOptions) (*policy.Request, error) { +func (client *TableClient) setAccessPolicyCreateRequest(ctx context.Context, table string, comp Enum4, options *TableClientSetAccessPolicyOptions) (*policy.Request, error) { urlPath := "/{table}" if table == "" { return nil, errors.New("parameter table cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{table}", url.PathEscape(table)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } @@ -902,8 +847,8 @@ func (client *TableClient) setAccessPolicyCreateRequest(ctx context.Context, tab } // setAccessPolicyHandleResponse handles the SetAccessPolicy response. -func (client *TableClient) setAccessPolicyHandleResponse(resp *http.Response) (TableSetAccessPolicyResponse, error) { - result := TableSetAccessPolicyResponse{RawResponse: resp} +func (client *TableClient) setAccessPolicyHandleResponse(resp *http.Response) (TableClientSetAccessPolicyResponse, error) { + result := TableClientSetAccessPolicyResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -916,45 +861,39 @@ func (client *TableClient) setAccessPolicyHandleResponse(resp *http.Response) (T if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableSetAccessPolicyResponse{}, err + return TableClientSetAccessPolicyResponse{}, err } result.Date = &date } return result, nil } -// setAccessPolicyHandleError handles the SetAccessPolicy error response. -func (client *TableClient) setAccessPolicyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // UpdateEntity - Update entity in a table. -// If the operation fails it returns the *TableServiceError error type. -func (client *TableClient) UpdateEntity(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableUpdateEntityOptions *TableUpdateEntityOptions, queryOptions *QueryOptions) (TableUpdateEntityResponse, error) { - req, err := client.UpdateEntityCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, tableUpdateEntityOptions, queryOptions) +// If the operation fails it returns an *azcore.ResponseError type. +// dataServiceVersion - Specifies the data service version. +// table - The name of the table. +// partitionKey - The partition key of the entity. +// rowKey - The row key of the entity. +// TableClientUpdateEntityOptions - TableClientUpdateEntityOptions contains the optional parameters for the TableClient.UpdateEntity +// method. +// QueryOptions - QueryOptions contains a group of parameters for the TableClient.Query method. +func (client *TableClient) UpdateEntity(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableClientUpdateEntityOptions *TableClientUpdateEntityOptions, queryOptions *QueryOptions) (TableClientUpdateEntityResponse, error) { + req, err := client.UpdateEntityCreateRequest(ctx, dataServiceVersion, table, partitionKey, rowKey, tableClientUpdateEntityOptions, queryOptions) if err != nil { - return TableUpdateEntityResponse{}, err + return TableClientUpdateEntityResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return TableUpdateEntityResponse{}, err + return TableClientUpdateEntityResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TableUpdateEntityResponse{}, client.updateEntityHandleError(resp) + return TableClientUpdateEntityResponse{}, runtime.NewResponseError(resp) } return client.updateEntityHandleResponse(resp) } -// UpdateEntityCreateRequest creates the UpdateEntity request. -func (client *TableClient) UpdateEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableUpdateEntityOptions *TableUpdateEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { +// updateEntityCreateRequest creates the UpdateEntity request. +func (client *TableClient) UpdateEntityCreateRequest(ctx context.Context, dataServiceVersion Enum1, table string, partitionKey string, rowKey string, tableClientUpdateEntityOptions *TableClientUpdateEntityOptions, queryOptions *QueryOptions) (*policy.Request, error) { urlPath := "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')" if table == "" { return nil, errors.New("parameter table cannot be empty") @@ -968,36 +907,36 @@ func (client *TableClient) UpdateEntityCreateRequest(ctx context.Context, dataSe return nil, errors.New("parameter rowKey cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{rowKey}", url.PathEscape(rowKey)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.con.Endpoint(), urlPath)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.endpoint, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - if tableUpdateEntityOptions != nil && tableUpdateEntityOptions.Timeout != nil { - reqQP.Set("timeout", strconv.FormatInt(int64(*tableUpdateEntityOptions.Timeout), 10)) + if tableClientUpdateEntityOptions != nil && tableClientUpdateEntityOptions.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*tableClientUpdateEntityOptions.Timeout), 10)) } if queryOptions != nil && queryOptions.Format != nil { reqQP.Set("$format", string(*queryOptions.Format)) } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("x-ms-version", string(client.version)) - if tableUpdateEntityOptions != nil && tableUpdateEntityOptions.RequestID != nil { - req.Raw().Header.Set("x-ms-client-request-id", *tableUpdateEntityOptions.RequestID) + if tableClientUpdateEntityOptions != nil && tableClientUpdateEntityOptions.RequestID != nil { + req.Raw().Header.Set("x-ms-client-request-id", *tableClientUpdateEntityOptions.RequestID) } req.Raw().Header.Set("DataServiceVersion", string(dataServiceVersion)) - if tableUpdateEntityOptions != nil && tableUpdateEntityOptions.IfMatch != nil { - req.Raw().Header.Set("If-Match", *tableUpdateEntityOptions.IfMatch) + if tableClientUpdateEntityOptions != nil && tableClientUpdateEntityOptions.IfMatch != nil { + req.Raw().Header.Set("If-Match", *tableClientUpdateEntityOptions.IfMatch) } req.Raw().Header.Set("Accept", "application/json") - if tableUpdateEntityOptions != nil && tableUpdateEntityOptions.TableEntityProperties != nil { - return req, runtime.MarshalAsJSON(req, tableUpdateEntityOptions.TableEntityProperties) + if tableClientUpdateEntityOptions != nil && tableClientUpdateEntityOptions.TableEntityProperties != nil { + return req, runtime.MarshalAsJSON(req, tableClientUpdateEntityOptions.TableEntityProperties) } return req, nil } // updateEntityHandleResponse handles the UpdateEntity response. -func (client *TableClient) updateEntityHandleResponse(resp *http.Response) (TableUpdateEntityResponse, error) { - result := TableUpdateEntityResponse{RawResponse: resp} +func (client *TableClient) updateEntityHandleResponse(resp *http.Response) (TableClientUpdateEntityResponse, error) { + result := TableClientUpdateEntityResponse{RawResponse: resp} if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } @@ -1010,7 +949,7 @@ func (client *TableClient) updateEntityHandleResponse(resp *http.Response) (Tabl if val := resp.Header.Get("Date"); val != "" { date, err := time.Parse(time.RFC1123, val) if err != nil { - return TableUpdateEntityResponse{}, err + return TableClientUpdateEntityResponse{}, err } result.Date = &date } @@ -1019,16 +958,3 @@ func (client *TableClient) updateEntityHandleResponse(resp *http.Response) (Tabl } return result, nil } - -// updateEntityHandleError handles the UpdateEntity error response. -func (client *TableClient) updateEntityHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := TableServiceError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/data/aztables/proxy_test.go b/sdk/data/aztables/proxy_test.go index 12664686d464..553d3e5a7987 100644 --- a/sdk/data/aztables/proxy_test.go +++ b/sdk/data/aztables/proxy_test.go @@ -42,7 +42,7 @@ func TestMain(m *testing.M) { // 3. Reset // TODO: Add after sanitizer PR if recording.GetRecordMode() != "live" { - err := recording.ResetSanitizers(nil) + err := recording.ResetProxy(nil) if err != nil { panic(err) } diff --git a/sdk/data/aztables/service_client.go b/sdk/data/aztables/service_client.go index ffdf83dcfeec..dde36f23d437 100644 --- a/sdk/data/aztables/service_client.go +++ b/sdk/data/aztables/service_client.go @@ -30,8 +30,8 @@ func NewServiceClient(serviceURL string, cred azcore.TokenCredential, options *C conOptions.PerRetryPolicies = append(conOptions.PerRetryPolicies, runtime.NewBearerTokenPolicy(cred, []string{"https://storage.azure.com/.default"}, nil)) con := generated.NewConnection(serviceURL, conOptions) return &ServiceClient{ - client: generated.NewTableClient(con, generated.Enum0TwoThousandNineteen0202), - service: generated.NewServiceClient(con, generated.Enum0TwoThousandNineteen0202), + client: generated.NewTableClient(serviceURL, generated.Enum0TwoThousandNineteen0202, conOptions), + service: generated.NewServiceClient(serviceURL, generated.Enum0TwoThousandNineteen0202, conOptions), con: con, }, nil } @@ -42,8 +42,8 @@ func NewServiceClientWithNoCredential(serviceURL string, options *ClientOptions) conOptions := getConnectionOptions(serviceURL, options) con := generated.NewConnection(serviceURL, conOptions) return &ServiceClient{ - client: generated.NewTableClient(con, generated.Enum0TwoThousandNineteen0202), - service: generated.NewServiceClient(con, generated.Enum0TwoThousandNineteen0202), + client: generated.NewTableClient(serviceURL, generated.Enum0TwoThousandNineteen0202, conOptions), + service: generated.NewServiceClient(serviceURL, generated.Enum0TwoThousandNineteen0202, conOptions), con: con, }, nil } @@ -55,8 +55,8 @@ func NewServiceClientWithSharedKey(serviceURL string, cred *SharedKeyCredential, con := generated.NewConnection(serviceURL, conOptions) return &ServiceClient{ - client: generated.NewTableClient(con, generated.Enum0TwoThousandNineteen0202), - service: generated.NewServiceClient(con, generated.Enum0TwoThousandNineteen0202), + client: generated.NewTableClient(serviceURL, generated.Enum0TwoThousandNineteen0202, conOptions), + service: generated.NewServiceClient(serviceURL, generated.Enum0TwoThousandNineteen0202, conOptions), cred: cred, con: con, }, nil @@ -88,8 +88,8 @@ func (t *ServiceClient) NewClient(tableName string) *Client { type CreateTableOptions struct { } -func (c *CreateTableOptions) toGenerated() *generated.TableCreateOptions { - return &generated.TableCreateOptions{} +func (c *CreateTableOptions) toGenerated() *generated.TableClientCreateOptions { + return &generated.TableClientCreateOptions{} } // Create creates a table with the specified name. @@ -105,8 +105,8 @@ func (t *ServiceClient) CreateTable(ctx context.Context, name string, options *C type DeleteTableOptions struct { } -func (c *DeleteTableOptions) toGenerated() *generated.TableDeleteOptions { - return &generated.TableDeleteOptions{} +func (c *DeleteTableOptions) toGenerated() *generated.TableClientDeleteOptions { + return &generated.TableClientDeleteOptions{} } // Response object from a ServiceClient.DeleteTable or Client.Delete operation @@ -114,7 +114,7 @@ type DeleteTableResponse struct { RawResponse *http.Response } -func deleteTableResponseFromGen(g *generated.TableDeleteResponse) DeleteTableResponse { +func deleteTableResponseFromGen(g *generated.TableClientDeleteResponse) DeleteTableResponse { if g == nil { return DeleteTableResponse{} } @@ -187,7 +187,7 @@ type ListTablesPage struct { Tables []*ResponseProperties `json:"value,omitempty"` } -func fromGeneratedTableQueryResponseEnvelope(g *generated.TableQueryResponseEnvelope) *ListTablesPage { +func fromGeneratedTableQueryResponseEnvelope(g *generated.TableClientQueryResponse) *ListTablesPage { if g == nil { return nil } @@ -237,8 +237,8 @@ func fromGeneratedTableResponseProperties(g *generated.TableResponseProperties) type tableQueryResponsePager struct { client *generated.TableClient - current *generated.TableQueryResponseEnvelope - tableQueryOptions *generated.TableQueryOptions + current *generated.TableClientQueryResponse + tableQueryOptions *generated.TableClientQueryOptions listOptions *ListTablesOptions err error } @@ -250,7 +250,7 @@ func (p *tableQueryResponsePager) NextPage(ctx context.Context) bool { if p.err != nil || (p.current != nil && p.current.XMSContinuationNextTableName == nil) { return false } - var resp generated.TableQueryResponseEnvelope + var resp generated.TableClientQueryResponse resp, p.err = p.client.Query(ctx, generated.Enum1Three0, p.tableQueryOptions, p.listOptions.toQueryOptions()) p.current = &resp p.tableQueryOptions.NextTableName = resp.XMSContinuationNextTableName @@ -281,7 +281,7 @@ func (t *ServiceClient) ListTables(listOptions *ListTablesOptions) ListTablesPag return &tableQueryResponsePager{ client: t.client, listOptions: listOptions, - tableQueryOptions: new(generated.TableQueryOptions), + tableQueryOptions: new(generated.TableClientQueryOptions), } } @@ -294,15 +294,15 @@ type GetStatisticsResponse struct { GeoReplication *GeoReplication `xml:"GeoReplication"` } -func getStatisticsResponseFromGenerated(g *generated.ServiceGetStatisticsResponse) GetStatisticsResponse { +func getStatisticsResponseFromGenerated(g *generated.ServiceClientGetStatisticsResponse) GetStatisticsResponse { return GetStatisticsResponse{ RawResponse: g.RawResponse, GeoReplication: fromGeneratedGeoReplication(g.GeoReplication), } } -func (g *GetStatisticsOptions) toGenerated() *generated.ServiceGetStatisticsOptions { - return &generated.ServiceGetStatisticsOptions{} +func (g *GetStatisticsOptions) toGenerated() *generated.ServiceClientGetStatisticsOptions { + return &generated.ServiceClientGetStatisticsOptions{} } // GetStatistics retrieves all the statistics for an account with Geo-redundancy established. @@ -317,8 +317,8 @@ func (t *ServiceClient) GetStatistics(ctx context.Context, options *GetStatistic type GetPropertiesOptions struct { } -func (g *GetPropertiesOptions) toGenerated() *generated.ServiceGetPropertiesOptions { - return &generated.ServiceGetPropertiesOptions{} +func (g *GetPropertiesOptions) toGenerated() *generated.ServiceClientGetPropertiesOptions { + return &generated.ServiceClientGetPropertiesOptions{} } type GetPropertiesResponse struct { @@ -336,7 +336,7 @@ type GetPropertiesResponse struct { MinuteMetrics *Metrics `xml:"MinuteMetrics"` } -func getPropertiesResponseFromGenerated(g *generated.ServiceGetPropertiesResponse) GetPropertiesResponse { +func getPropertiesResponseFromGenerated(g *generated.ServiceClientGetPropertiesResponse) GetPropertiesResponse { var cors []*CorsRule for _, c := range g.Cors { cors = append(cors, fromGeneratedCors(c)) @@ -361,15 +361,15 @@ func (t *ServiceClient) GetProperties(ctx context.Context, options *GetPropertie type SetPropertiesOptions struct{} -func (s *SetPropertiesOptions) toGenerated() *generated.ServiceSetPropertiesOptions { - return &generated.ServiceSetPropertiesOptions{} +func (s *SetPropertiesOptions) toGenerated() *generated.ServiceClientSetPropertiesOptions { + return &generated.ServiceClientSetPropertiesOptions{} } type SetPropertiesResponse struct { RawResponse *http.Response } -func setPropertiesResponseFromGenerated(g *generated.ServiceSetPropertiesResponse) SetPropertiesResponse { +func setPropertiesResponseFromGenerated(g *generated.ServiceClientSetPropertiesResponse) SetPropertiesResponse { return SetPropertiesResponse{ RawResponse: g.RawResponse, } diff --git a/sdk/data/aztables/transactional_batch.go b/sdk/data/aztables/transactional_batch.go index dd5eb547b74e..eda531968249 100644 --- a/sdk/data/aztables/transactional_batch.go +++ b/sdk/data/aztables/transactional_batch.go @@ -165,7 +165,7 @@ func (t *Client) submitTransactionInternal(ctx context.Context, transactionActio } if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return TransactionResponse{}, runtime.NewResponseError(err, resp) + return TransactionResponse{}, runtime.NewResponseError(resp) } return *transactionResponse, nil } @@ -223,7 +223,7 @@ func buildTransactionResponse(req *policy.Request, resp *http.Response, itemCoun retError := newTableTransactionError(errorBody, resp) ret := retError.(*transactionError) ret.statusCode = r.StatusCode - return &result, runtime.NewResponseError(retError, resp) + return &result, runtime.NewResponseError(resp) } } innerResponses[i] = *r @@ -314,7 +314,7 @@ func (t *Client) generateEntitySubset(transactionAction *TransactionAction, writ entity[partitionKey].(string), entity[rowKey].(string), ifMatch, - &generated.TableDeleteEntityOptions{}, + &generated.TableClientDeleteEntityOptions{}, qo, ) if err != nil { @@ -325,7 +325,7 @@ func (t *Client) generateEntitySubset(transactionAction *TransactionAction, writ ctx, generated.Enum1Three0, t.name, - &generated.TableInsertEntityOptions{ + &generated.TableClientInsertEntityOptions{ TableEntityProperties: entity, ResponsePreference: generated.ResponseFormatReturnNoContent.ToPtr(), }, @@ -337,7 +337,7 @@ func (t *Client) generateEntitySubset(transactionAction *TransactionAction, writ case UpdateMerge: fallthrough case InsertMerge: - opts := &generated.TableMergeEntityOptions{TableEntityProperties: entity} + opts := &generated.TableClientMergeEntityOptions{TableEntityProperties: entity} if transactionAction.IfMatch != nil { opts.IfMatch = to.StringPtr(string(*transactionAction.IfMatch)) } @@ -359,7 +359,7 @@ func (t *Client) generateEntitySubset(transactionAction *TransactionAction, writ case UpdateReplace: fallthrough case InsertReplace: - opts := &generated.TableUpdateEntityOptions{TableEntityProperties: entity} + opts := &generated.TableClientUpdateEntityOptions{TableEntityProperties: entity} if transactionAction.IfMatch != nil { opts.IfMatch = to.StringPtr(string(*transactionAction.IfMatch)) } From 992b1b30b6c28d36f06d98313968641c8d623943 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:47:39 -0500 Subject: [PATCH 34/36] [KeyVault] prepare secrets for release (#16732) * prepare secrets for release * updating to latest azcore * update with latest codegen * fixing secret version issues * formatting * manual checkout of azkeys * updating to azcore v0.21.0 * updating autorest.go and azidentity * updating Changelog * updating changelog * updating changelog * modifying moduleVersion * undoing changes to keys and tables Co-authored-by: Joel Hendrix --- sdk/keyvault/azsecrets/CHANGELOG.md | 9 +- sdk/keyvault/azsecrets/autorest.md | 2 +- sdk/keyvault/azsecrets/client.go | 24 +- sdk/keyvault/azsecrets/client_test.go | 6 +- sdk/keyvault/azsecrets/go.mod | 4 +- sdk/keyvault/azsecrets/go.sum | 29 +- sdk/keyvault/azsecrets/internal/connection.go | 37 -- sdk/keyvault/azsecrets/internal/constants.go | 55 +-- .../internal/hsmsecuritydomain_client.go | 213 +++++------ ...ultclient_client.go => keyvault_client.go} | 322 ++++++---------- sdk/keyvault/azsecrets/internal/models.go | 348 +++++++++--------- sdk/keyvault/azsecrets/internal/pagers.go | 52 +-- sdk/keyvault/azsecrets/internal/pollers.go | 36 +- .../azsecrets/internal/response_types.go | 166 ++++----- .../internal/roleassignments_client.go | 173 ++++----- .../internal/roledefinitions_client.go | 173 ++++----- sdk/keyvault/azsecrets/models.go | 22 +- 17 files changed, 725 insertions(+), 946 deletions(-) delete mode 100644 sdk/keyvault/azsecrets/internal/connection.go rename sdk/keyvault/azsecrets/internal/{keyvaultclient_client.go => keyvault_client.go} (71%) diff --git a/sdk/keyvault/azsecrets/CHANGELOG.md b/sdk/keyvault/azsecrets/CHANGELOG.md index 1a9fd2bbad31..4d653cc11b9c 100644 --- a/sdk/keyvault/azsecrets/CHANGELOG.md +++ b/sdk/keyvault/azsecrets/CHANGELOG.md @@ -1,14 +1,9 @@ # Release History -## 0.3.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed +## 0.4.0 (2022-01-11) ### Other Changes +* Bumps `azcore` dependency from `v0.20.0` to `v0.21.0` ## 0.3.0 (2021-11-09) diff --git a/sdk/keyvault/azsecrets/autorest.md b/sdk/keyvault/azsecrets/autorest.md index e0665fadc0f6..e18822baa7ab 100644 --- a/sdk/keyvault/azsecrets/autorest.md +++ b/sdk/keyvault/azsecrets/autorest.md @@ -18,7 +18,7 @@ clear-output-folder: false output-folder: internal tag: package-7.2 credential-scope: none -use: "@autorest/go@4.0.0-preview.30" +use: "@autorest/go@4.0.0-preview.35" module-version: 0.2.0 export-clients: true ``` diff --git a/sdk/keyvault/azsecrets/client.go b/sdk/keyvault/azsecrets/client.go index 911e91d4f0a9..fbf9eac71296 100644 --- a/sdk/keyvault/azsecrets/client.go +++ b/sdk/keyvault/azsecrets/client.go @@ -57,10 +57,8 @@ func NewClient(vaultUrl string, credential azcore.TokenCredential, options *Clie shared.NewKeyVaultChallengePolicy(credential), ) - conn := internal.NewConnection(conOptions) - return &Client{ - kvClient: internal.NewKeyVaultClient(conn), + kvClient: internal.NewKeyVaultClient(conOptions), vaultUrl: vaultUrl, }, nil } @@ -272,9 +270,9 @@ func (s *startDeleteSecretPoller) Poll(ctx context.Context) (*http.Response, err s.lastResponse = resp return resp.RawResponse, nil } - var httpResponseErr azcore.HTTPResponse - if errors.As(err, &httpResponseErr) { - if httpResponseErr.RawResponse().StatusCode == http.StatusNotFound { + var httpErr *azcore.ResponseError + if errors.As(err, &httpErr) { + if httpErr.StatusCode == http.StatusNotFound { // This is the expected result return s.deleteResponse.RawResponse, nil } @@ -329,9 +327,9 @@ func (c *Client) BeginDeleteSecret(ctx context.Context, secretName string, optio } getResp, err := c.kvClient.GetDeletedSecret(ctx, c.vaultUrl, secretName, nil) - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError if errors.As(err, &httpErr) { - if httpErr.RawResponse().StatusCode != http.StatusNotFound { + if httpErr.StatusCode != http.StatusNotFound { return DeleteSecretPollerResponse{}, err } } @@ -381,7 +379,7 @@ func getDeletedSecretResponseFromGenerated(i internal.KeyVaultClientGetDeletedSe RecoveryID: i.RecoveryID, DeletedDate: i.DeletedDate, ScheduledPurgeDate: i.ScheduledPurgeDate, - Secret: secretFromGenerated(i.SecretBundle), + Secret: secretFromGenerated(i.DeletedSecretBundle), } } @@ -626,9 +624,9 @@ func (b *beginRecoverPoller) Done() bool { func (b *beginRecoverPoller) Poll(ctx context.Context) (*http.Response, error) { resp, err := b.client.GetSecret(ctx, b.vaultUrl, b.secretName, "", nil) b.lastResponse = resp - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError if errors.As(err, &httpErr) { - return httpErr.RawResponse(), err + return httpErr.RawResponse, err } return resp.RawResponse, nil } @@ -720,9 +718,9 @@ func (c *Client) BeginRecoverDeletedSecret(ctx context.Context, secretName strin } getResp, err := c.kvClient.GetSecret(ctx, c.vaultUrl, secretName, "", nil) - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError if errors.As(err, &httpErr) { - if httpErr.RawResponse().StatusCode != http.StatusNotFound { + if httpErr.StatusCode != http.StatusNotFound { return RecoverDeletedSecretPollerResponse{}, err } } diff --git a/sdk/keyvault/azsecrets/client_test.go b/sdk/keyvault/azsecrets/client_test.go index 462cbcf33f67..d4284d43c543 100644 --- a/sdk/keyvault/azsecrets/client_test.go +++ b/sdk/keyvault/azsecrets/client_test.go @@ -383,13 +383,13 @@ func TestBackupSecret(t *testing.T) { require.NoError(t, err) _, err = client.GetSecret(context.Background(), secret, nil) - var httpErr azcore.HTTPResponse + var httpErr *azcore.ResponseError require.True(t, errors.As(err, &httpErr)) - require.Equal(t, httpErr.RawResponse().StatusCode, http.StatusNotFound) + require.Equal(t, httpErr.RawResponse.StatusCode, http.StatusNotFound) _, err = client.GetDeletedSecret(context.Background(), secret, nil) require.True(t, errors.As(err, &httpErr)) - require.Equal(t, httpErr.RawResponse().StatusCode, http.StatusNotFound) + require.Equal(t, httpErr.RawResponse.StatusCode, http.StatusNotFound) time.Sleep(20 * delay()) diff --git a/sdk/keyvault/azsecrets/go.mod b/sdk/keyvault/azsecrets/go.mod index 2d965f5b3e28..64fbc3f8bcfd 100644 --- a/sdk/keyvault/azsecrets/go.mod +++ b/sdk/keyvault/azsecrets/go.mod @@ -3,8 +3,8 @@ module github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets go 1.16 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.1.0 github.com/stretchr/testify v1.7.0 diff --git a/sdk/keyvault/azsecrets/go.sum b/sdk/keyvault/azsecrets/go.sum index caa59560af2c..aaadcb37af81 100644 --- a/sdk/keyvault/azsecrets/go.sum +++ b/sdk/keyvault/azsecrets/go.sum @@ -1,20 +1,30 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0 h1:VBvHGLJbaY0+c66NZHdS9cgjHVYSH6DDa0XJMyrblsI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.12.0/go.mod h1:GJzjM4SR9T0KyX5gKCVyz1ytD8FeWeUPCwtFCt1AyfE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.1.0 h1:Xc2XhOPo5WsyBAX+EsMdg1HZQ0oDJ8Lt4jivIjv4Cak= github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal v0.1.0/go.mod h1:qKJHexVLI0iqKFeV/2WnqbRBQtJTPOMeBdmHOxs+E88= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -26,18 +36,23 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/sdk/keyvault/azsecrets/internal/connection.go b/sdk/keyvault/azsecrets/internal/connection.go deleted file mode 100644 index c7fa89a3946d..000000000000 --- a/sdk/keyvault/azsecrets/internal/connection.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package internal - -import ( - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" -) - -// Connection - The key vault client performs cryptographic key operations and vault operations against the Key Vault service. -type Connection struct { - p runtime.Pipeline -} - -// NewConnection creates an instance of the Connection type with the specified endpoint. -// Pass nil to accept the default options; this is the same as passing a zero-value options. -func NewConnection(options *azcore.ClientOptions) *Connection { - cp := azcore.ClientOptions{} - if options != nil { - cp = *options - } - client := &Connection{ - p: runtime.NewPipeline(module, version, nil, nil, &cp), - } - return client -} - -// Pipeline returns the connection's pipeline. -func (c *Connection) Pipeline() runtime.Pipeline { - return c.p -} diff --git a/sdk/keyvault/azsecrets/internal/constants.go b/sdk/keyvault/azsecrets/internal/constants.go index fb7d1a1974d5..e42b8bd37abe 100644 --- a/sdk/keyvault/azsecrets/internal/constants.go +++ b/sdk/keyvault/azsecrets/internal/constants.go @@ -9,8 +9,8 @@ package internal const ( - module = "internal" - version = "v0.3.1" + moduleName = "internal" + moduleVersion = "v0.4.0" ) // DataAction - Supported permissions for data actions. @@ -123,40 +123,43 @@ func (c DataAction) ToPtr() *DataAction { return &c } -// DeletionRecoveryLevel - Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret -// can be permanently deleted by a privileged user; otherwise, only the +// DeletionRecoveryLevel - Reflects the deletion recovery level currently in effect for secrets in the current vault. If it +// contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the // system can purge the secret, at the end of the retention interval. type DeletionRecoveryLevel string const ( - // DeletionRecoveryLevelCustomizedRecoverable - Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent - // deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval - // and while the subscription is still available. + // DeletionRecoveryLevelCustomizedRecoverable - Denotes a vault state in which deletion is recoverable without the possibility + // for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability + // of the deleted entity during the retention interval and while the subscription is still available. DeletionRecoveryLevelCustomizedRecoverable DeletionRecoveryLevel = "CustomizedRecoverable" - // DeletionRecoveryLevelCustomizedRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion is recoverable, immediate - // and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays - // < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription - // itself cannot be cancelled. + // DeletionRecoveryLevelCustomizedRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion + // is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot + // be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted + // entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled. DeletionRecoveryLevelCustomizedRecoverableProtectedSubscription DeletionRecoveryLevel = "CustomizedRecoverable+ProtectedSubscription" - // DeletionRecoveryLevelCustomizedRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent - // deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, - // unless a Purge operation is requested, or the subscription is cancelled. + // DeletionRecoveryLevelCustomizedRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which + // also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees + // the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription + // is cancelled. DeletionRecoveryLevelCustomizedRecoverablePurgeable DeletionRecoveryLevel = "CustomizedRecoverable+Purgeable" - // DeletionRecoveryLevelPurgeable - Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level - // corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity - // level or higher (vault, resource group, subscription etc.) + // DeletionRecoveryLevelPurgeable - Denotes a vault state in which deletion is an irreversible operation, without the possibility + // for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably + // lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.) DeletionRecoveryLevelPurgeable DeletionRecoveryLevel = "Purgeable" - // DeletionRecoveryLevelRecoverable - Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion - // (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still - // available. System wil permanently delete it after 90 days, if not recovered + // DeletionRecoveryLevelRecoverable - Denotes a vault state in which deletion is recoverable without the possibility for immediate + // and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention + // interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not + // recovered DeletionRecoveryLevelRecoverable DeletionRecoveryLevel = "Recoverable" - // DeletionRecoveryLevelRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion is recoverable within retention interval - // (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System - // wil permanently delete it after 90 days, if not recovered + // DeletionRecoveryLevelRecoverableProtectedSubscription - Denotes a vault and subscription state in which deletion is recoverable + // within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription + // itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered DeletionRecoveryLevelRecoverableProtectedSubscription DeletionRecoveryLevel = "Recoverable+ProtectedSubscription" - // DeletionRecoveryLevelRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion - // (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, - // or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered + // DeletionRecoveryLevelRecoverablePurgeable - Denotes a vault state in which deletion is recoverable, and which also permits + // immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the + // retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently + // delete it after 90 days, if not recovered DeletionRecoveryLevelRecoverablePurgeable DeletionRecoveryLevel = "Recoverable+Purgeable" ) diff --git a/sdk/keyvault/azsecrets/internal/hsmsecuritydomain_client.go b/sdk/keyvault/azsecrets/internal/hsmsecuritydomain_client.go index fd5a309b514e..a65cfa6aef54 100644 --- a/sdk/keyvault/azsecrets/internal/hsmsecuritydomain_client.go +++ b/sdk/keyvault/azsecrets/internal/hsmsecuritydomain_client.go @@ -10,7 +10,7 @@ package internal import ( "context" - "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" @@ -21,53 +21,68 @@ import ( // HSMSecurityDomainClient contains the methods for the HSMSecurityDomain group. // Don't use this type directly, use NewHSMSecurityDomainClient() instead. type HSMSecurityDomainClient struct { - con *Connection + pl runtime.Pipeline } // NewHSMSecurityDomainClient creates a new instance of HSMSecurityDomainClient with the specified values. -func NewHSMSecurityDomainClient(con *Connection) *HSMSecurityDomainClient { - return &HSMSecurityDomainClient{con: con} +// options - pass nil to accept the default values. +func NewHSMSecurityDomainClient(options *azcore.ClientOptions) *HSMSecurityDomainClient { + cp := azcore.ClientOptions{} + if options != nil { + cp = *options + } + client := &HSMSecurityDomainClient{ + pl: runtime.NewPipeline(moduleName, moduleVersion, runtime.PipelineOptions{}, &cp), + } + return client } -// BeginDownload - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned managed HSM resource. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) BeginDownload(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainBeginDownloadOptions) (HSMSecurityDomainDownloadPollerResponse, error) { +// BeginDownload - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned +// managed HSM resource. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// certificateInfoObject - The Security Domain download operation requires customer to provide N certificates (minimum 3 and +// maximum 10) containing a public key in JWK format. +// options - HSMSecurityDomainClientBeginDownloadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginDownload +// method. +func (client *HSMSecurityDomainClient) BeginDownload(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainClientBeginDownloadOptions) (HSMSecurityDomainClientDownloadPollerResponse, error) { resp, err := client.download(ctx, vaultBaseURL, certificateInfoObject, options) if err != nil { - return HSMSecurityDomainDownloadPollerResponse{}, err + return HSMSecurityDomainClientDownloadPollerResponse{}, err } - result := HSMSecurityDomainDownloadPollerResponse{ + result := HSMSecurityDomainClientDownloadPollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("HSMSecurityDomainClient.Download", "azure-async-operation", resp, client.con.Pipeline(), client.downloadHandleError) + pt, err := armruntime.NewPoller("HSMSecurityDomainClient.Download", "azure-async-operation", resp, client.pl) if err != nil { - return HSMSecurityDomainDownloadPollerResponse{}, err + return HSMSecurityDomainClientDownloadPollerResponse{}, err } - result.Poller = &HSMSecurityDomainDownloadPoller{ + result.Poller = &HSMSecurityDomainClientDownloadPoller{ pt: pt, } return result, nil } -// Download - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned managed HSM resource. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) download(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainBeginDownloadOptions) (*http.Response, error) { +// Download - Retrieves the Security Domain from the managed HSM. Calling this endpoint can be used to activate a provisioned +// managed HSM resource. +// If the operation fails it returns an *azcore.ResponseError type. +func (client *HSMSecurityDomainClient) download(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainClientBeginDownloadOptions) (*http.Response, error) { req, err := client.downloadCreateRequest(ctx, vaultBaseURL, certificateInfoObject, options) if err != nil { return nil, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, client.downloadHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // downloadCreateRequest creates the Download request. -func (client *HSMSecurityDomainClient) downloadCreateRequest(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainBeginDownloadOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) downloadCreateRequest(ctx context.Context, vaultBaseURL string, certificateInfoObject CertificateInfoObject, options *HSMSecurityDomainClientBeginDownloadOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/download" @@ -82,38 +97,28 @@ func (client *HSMSecurityDomainClient) downloadCreateRequest(ctx context.Context return req, runtime.MarshalAsJSON(req, certificateInfoObject) } -// downloadHandleError handles the Download error response. -func (client *HSMSecurityDomainClient) downloadHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // DownloadPending - Retrieves the Security Domain download operation status -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) DownloadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainDownloadPendingOptions) (HSMSecurityDomainDownloadPendingResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - HSMSecurityDomainClientDownloadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.DownloadPending +// method. +func (client *HSMSecurityDomainClient) DownloadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientDownloadPendingOptions) (HSMSecurityDomainClientDownloadPendingResponse, error) { req, err := client.downloadPendingCreateRequest(ctx, vaultBaseURL, options) if err != nil { - return HSMSecurityDomainDownloadPendingResponse{}, err + return HSMSecurityDomainClientDownloadPendingResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return HSMSecurityDomainDownloadPendingResponse{}, err + return HSMSecurityDomainClientDownloadPendingResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return HSMSecurityDomainDownloadPendingResponse{}, client.downloadPendingHandleError(resp) + return HSMSecurityDomainClientDownloadPendingResponse{}, runtime.NewResponseError(resp) } return client.downloadPendingHandleResponse(resp) } // downloadPendingCreateRequest creates the DownloadPending request. -func (client *HSMSecurityDomainClient) downloadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainDownloadPendingOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) downloadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientDownloadPendingOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/download/pending" @@ -126,46 +131,36 @@ func (client *HSMSecurityDomainClient) downloadPendingCreateRequest(ctx context. } // downloadPendingHandleResponse handles the DownloadPending response. -func (client *HSMSecurityDomainClient) downloadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainDownloadPendingResponse, error) { - result := HSMSecurityDomainDownloadPendingResponse{RawResponse: resp} +func (client *HSMSecurityDomainClient) downloadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainClientDownloadPendingResponse, error) { + result := HSMSecurityDomainClientDownloadPendingResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SecurityDomainOperationStatus); err != nil { - return HSMSecurityDomainDownloadPendingResponse{}, err + return HSMSecurityDomainClientDownloadPendingResponse{}, err } return result, nil } -// downloadPendingHandleError handles the DownloadPending error response. -func (client *HSMSecurityDomainClient) downloadPendingHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // TransferKey - Retrieve Security Domain transfer key -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) TransferKey(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainTransferKeyOptions) (HSMSecurityDomainTransferKeyResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - HSMSecurityDomainClientTransferKeyOptions contains the optional parameters for the HSMSecurityDomainClient.TransferKey +// method. +func (client *HSMSecurityDomainClient) TransferKey(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientTransferKeyOptions) (HSMSecurityDomainClientTransferKeyResponse, error) { req, err := client.transferKeyCreateRequest(ctx, vaultBaseURL, options) if err != nil { - return HSMSecurityDomainTransferKeyResponse{}, err + return HSMSecurityDomainClientTransferKeyResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return HSMSecurityDomainTransferKeyResponse{}, err + return HSMSecurityDomainClientTransferKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return HSMSecurityDomainTransferKeyResponse{}, client.transferKeyHandleError(resp) + return HSMSecurityDomainClientTransferKeyResponse{}, runtime.NewResponseError(resp) } return client.transferKeyHandleResponse(resp) } // transferKeyCreateRequest creates the TransferKey request. -func (client *HSMSecurityDomainClient) transferKeyCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainTransferKeyOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) transferKeyCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientTransferKeyOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/upload" @@ -181,66 +176,57 @@ func (client *HSMSecurityDomainClient) transferKeyCreateRequest(ctx context.Cont } // transferKeyHandleResponse handles the TransferKey response. -func (client *HSMSecurityDomainClient) transferKeyHandleResponse(resp *http.Response) (HSMSecurityDomainTransferKeyResponse, error) { - result := HSMSecurityDomainTransferKeyResponse{RawResponse: resp} +func (client *HSMSecurityDomainClient) transferKeyHandleResponse(resp *http.Response) (HSMSecurityDomainClientTransferKeyResponse, error) { + result := HSMSecurityDomainClientTransferKeyResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.TransferKey); err != nil { - return HSMSecurityDomainTransferKeyResponse{}, err + return HSMSecurityDomainClientTransferKeyResponse{}, err } return result, nil } -// transferKeyHandleError handles the TransferKey error response. -func (client *HSMSecurityDomainClient) transferKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BeginUpload - Restore the provided Security Domain. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) BeginUpload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainBeginUploadOptions) (HSMSecurityDomainUploadPollerResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// securityDomain - The Security Domain to be restored. +// options - HSMSecurityDomainClientBeginUploadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginUpload +// method. +func (client *HSMSecurityDomainClient) BeginUpload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainClientBeginUploadOptions) (HSMSecurityDomainClientUploadPollerResponse, error) { resp, err := client.upload(ctx, vaultBaseURL, securityDomain, options) if err != nil { - return HSMSecurityDomainUploadPollerResponse{}, err + return HSMSecurityDomainClientUploadPollerResponse{}, err } - result := HSMSecurityDomainUploadPollerResponse{ + result := HSMSecurityDomainClientUploadPollerResponse{ RawResponse: resp, } - pt, err := armruntime.NewPoller("HSMSecurityDomainClient.Upload", "azure-async-operation", resp, client.con.Pipeline(), client.uploadHandleError) + pt, err := armruntime.NewPoller("HSMSecurityDomainClient.Upload", "azure-async-operation", resp, client.pl) if err != nil { - return HSMSecurityDomainUploadPollerResponse{}, err + return HSMSecurityDomainClientUploadPollerResponse{}, err } - result.Poller = &HSMSecurityDomainUploadPoller{ + result.Poller = &HSMSecurityDomainClientUploadPoller{ pt: pt, } return result, nil } // Upload - Restore the provided Security Domain. -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) upload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainBeginUploadOptions) (*http.Response, error) { +// If the operation fails it returns an *azcore.ResponseError type. +func (client *HSMSecurityDomainClient) upload(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainClientBeginUploadOptions) (*http.Response, error) { req, err := client.uploadCreateRequest(ctx, vaultBaseURL, securityDomain, options) if err != nil { return nil, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return nil, err } if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, client.uploadHandleError(resp) + return nil, runtime.NewResponseError(resp) } return resp, nil } // uploadCreateRequest creates the Upload request. -func (client *HSMSecurityDomainClient) uploadCreateRequest(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainBeginUploadOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) uploadCreateRequest(ctx context.Context, vaultBaseURL string, securityDomain SecurityDomainObject, options *HSMSecurityDomainClientBeginUploadOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/upload" @@ -252,38 +238,28 @@ func (client *HSMSecurityDomainClient) uploadCreateRequest(ctx context.Context, return req, runtime.MarshalAsJSON(req, securityDomain) } -// uploadHandleError handles the Upload error response. -func (client *HSMSecurityDomainClient) uploadHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // UploadPending - Get Security Domain upload operation status -// If the operation fails it returns the *KeyVaultError error type. -func (client *HSMSecurityDomainClient) UploadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainUploadPendingOptions) (HSMSecurityDomainUploadPendingResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - HSMSecurityDomainClientUploadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.UploadPending +// method. +func (client *HSMSecurityDomainClient) UploadPending(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientUploadPendingOptions) (HSMSecurityDomainClientUploadPendingResponse, error) { req, err := client.uploadPendingCreateRequest(ctx, vaultBaseURL, options) if err != nil { - return HSMSecurityDomainUploadPendingResponse{}, err + return HSMSecurityDomainClientUploadPendingResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return HSMSecurityDomainUploadPendingResponse{}, err + return HSMSecurityDomainClientUploadPendingResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return HSMSecurityDomainUploadPendingResponse{}, client.uploadPendingHandleError(resp) + return HSMSecurityDomainClientUploadPendingResponse{}, runtime.NewResponseError(resp) } return client.uploadPendingHandleResponse(resp) } // uploadPendingCreateRequest creates the UploadPending request. -func (client *HSMSecurityDomainClient) uploadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainUploadPendingOptions) (*policy.Request, error) { +func (client *HSMSecurityDomainClient) uploadPendingCreateRequest(ctx context.Context, vaultBaseURL string, options *HSMSecurityDomainClientUploadPendingOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/securitydomain/upload/pending" @@ -296,23 +272,10 @@ func (client *HSMSecurityDomainClient) uploadPendingCreateRequest(ctx context.Co } // uploadPendingHandleResponse handles the UploadPending response. -func (client *HSMSecurityDomainClient) uploadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainUploadPendingResponse, error) { - result := HSMSecurityDomainUploadPendingResponse{RawResponse: resp} +func (client *HSMSecurityDomainClient) uploadPendingHandleResponse(resp *http.Response) (HSMSecurityDomainClientUploadPendingResponse, error) { + result := HSMSecurityDomainClientUploadPendingResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.SecurityDomainOperationStatus); err != nil { - return HSMSecurityDomainUploadPendingResponse{}, err + return HSMSecurityDomainClientUploadPendingResponse{}, err } return result, nil } - -// uploadPendingHandleError handles the UploadPending error response. -func (client *HSMSecurityDomainClient) uploadPendingHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azsecrets/internal/keyvaultclient_client.go b/sdk/keyvault/azsecrets/internal/keyvault_client.go similarity index 71% rename from sdk/keyvault/azsecrets/internal/keyvaultclient_client.go rename to sdk/keyvault/azsecrets/internal/keyvault_client.go index 9ca6a48c7f68..e02b387243ed 100644 --- a/sdk/keyvault/azsecrets/internal/keyvaultclient_client.go +++ b/sdk/keyvault/azsecrets/internal/keyvault_client.go @@ -11,7 +11,7 @@ package internal import ( "context" "errors" - "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -23,28 +23,39 @@ import ( // KeyVaultClient contains the methods for the KeyVaultClient group. // Don't use this type directly, use NewKeyVaultClient() instead. type KeyVaultClient struct { - con *Connection + pl runtime.Pipeline } // NewKeyVaultClient creates a new instance of KeyVaultClient with the specified values. -func NewKeyVaultClient(con *Connection) *KeyVaultClient { - return &KeyVaultClient{con: con} +// options - pass nil to accept the default values. +func NewKeyVaultClient(options *azcore.ClientOptions) *KeyVaultClient { + cp := azcore.ClientOptions{} + if options != nil { + cp = *options + } + client := &KeyVaultClient{ + pl: runtime.NewPipeline(moduleName, moduleVersion, runtime.PipelineOptions{}, &cp), + } + return client } -// BackupSecret - Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. This operation -// requires the secrets/backup permission. -// If the operation fails it returns the *KeyVaultError error type. +// BackupSecret - Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will +// be downloaded. This operation requires the secrets/backup permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// options - KeyVaultClientBackupSecretOptions contains the optional parameters for the KeyVaultClient.BackupSecret method. func (client *KeyVaultClient) BackupSecret(ctx context.Context, vaultBaseURL string, secretName string, options *KeyVaultClientBackupSecretOptions) (KeyVaultClientBackupSecretResponse, error) { req, err := client.backupSecretCreateRequest(ctx, vaultBaseURL, secretName, options) if err != nil { return KeyVaultClientBackupSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientBackupSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientBackupSecretResponse{}, client.backupSecretHandleError(resp) + return KeyVaultClientBackupSecretResponse{}, runtime.NewResponseError(resp) } return client.backupSecretHandleResponse(resp) } @@ -78,33 +89,23 @@ func (client *KeyVaultClient) backupSecretHandleResponse(resp *http.Response) (K return result, nil } -// backupSecretHandleError handles the BackupSecret error response. -func (client *KeyVaultClient) backupSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// DeleteSecret - The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version of a secret. This -// operation requires the secrets/delete permission. -// If the operation fails it returns the *KeyVaultError error type. +// DeleteSecret - The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual +// version of a secret. This operation requires the secrets/delete permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// options - KeyVaultClientDeleteSecretOptions contains the optional parameters for the KeyVaultClient.DeleteSecret method. func (client *KeyVaultClient) DeleteSecret(ctx context.Context, vaultBaseURL string, secretName string, options *KeyVaultClientDeleteSecretOptions) (KeyVaultClientDeleteSecretResponse, error) { req, err := client.deleteSecretCreateRequest(ctx, vaultBaseURL, secretName, options) if err != nil { return KeyVaultClientDeleteSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientDeleteSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientDeleteSecretResponse{}, client.deleteSecretHandleError(resp) + return KeyVaultClientDeleteSecretResponse{}, runtime.NewResponseError(resp) } return client.deleteSecretHandleResponse(resp) } @@ -138,33 +139,24 @@ func (client *KeyVaultClient) deleteSecretHandleResponse(resp *http.Response) (K return result, nil } -// deleteSecretHandleError handles the DeleteSecret error response. -func (client *KeyVaultClient) deleteSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetDeletedSecret - The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get -// permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetDeletedSecret - The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This +// operation requires the secrets/get permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// options - KeyVaultClientGetDeletedSecretOptions contains the optional parameters for the KeyVaultClient.GetDeletedSecret +// method. func (client *KeyVaultClient) GetDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string, options *KeyVaultClientGetDeletedSecretOptions) (KeyVaultClientGetDeletedSecretResponse, error) { req, err := client.getDeletedSecretCreateRequest(ctx, vaultBaseURL, secretName, options) if err != nil { return KeyVaultClientGetDeletedSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientGetDeletedSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientGetDeletedSecretResponse{}, client.getDeletedSecretHandleError(resp) + return KeyVaultClientGetDeletedSecretResponse{}, runtime.NewResponseError(resp) } return client.getDeletedSecretHandleResponse(resp) } @@ -198,22 +190,12 @@ func (client *KeyVaultClient) getDeletedSecretHandleResponse(resp *http.Response return result, nil } -// getDeletedSecretHandleError handles the GetDeletedSecret error response. -func (client *KeyVaultClient) getDeletedSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetDeletedSecrets - The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation -// requires the secrets/list permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetDeletedSecrets - The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for +// soft-delete. This operation requires the secrets/list permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - KeyVaultClientGetDeletedSecretsOptions contains the optional parameters for the KeyVaultClient.GetDeletedSecrets +// method. func (client *KeyVaultClient) GetDeletedSecrets(vaultBaseURL string, options *KeyVaultClientGetDeletedSecretsOptions) *KeyVaultClientGetDeletedSecretsPager { return &KeyVaultClientGetDeletedSecretsPager{ client: client, @@ -254,32 +236,25 @@ func (client *KeyVaultClient) getDeletedSecretsHandleResponse(resp *http.Respons return result, nil } -// getDeletedSecretsHandleError handles the GetDeletedSecrets error response. -func (client *KeyVaultClient) getDeletedSecretsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetSecret - The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetSecret - The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get +// permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// secretVersion - The version of the secret. This URI fragment is optional. If not specified, the latest version of the secret +// is returned. +// options - KeyVaultClientGetSecretOptions contains the optional parameters for the KeyVaultClient.GetSecret method. func (client *KeyVaultClient) GetSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string, options *KeyVaultClientGetSecretOptions) (KeyVaultClientGetSecretResponse, error) { req, err := client.getSecretCreateRequest(ctx, vaultBaseURL, secretName, secretVersion, options) if err != nil { return KeyVaultClientGetSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientGetSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientGetSecretResponse{}, client.getSecretHandleError(resp) + return KeyVaultClientGetSecretResponse{}, runtime.NewResponseError(resp) } return client.getSecretHandleResponse(resp) } @@ -317,22 +292,13 @@ func (client *KeyVaultClient) getSecretHandleResponse(resp *http.Response) (KeyV return result, nil } -// getSecretHandleError handles the GetSecret error response. -func (client *KeyVaultClient) getSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetSecretVersions - The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations requires -// the secrets/list permission. -// If the operation fails it returns the *KeyVaultError error type. +// GetSecretVersions - The full secret identifier and attributes are provided in the response. No values are returned for +// the secrets. This operations requires the secrets/list permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// options - KeyVaultClientGetSecretVersionsOptions contains the optional parameters for the KeyVaultClient.GetSecretVersions +// method. func (client *KeyVaultClient) GetSecretVersions(vaultBaseURL string, secretName string, options *KeyVaultClientGetSecretVersionsOptions) *KeyVaultClientGetSecretVersionsPager { return &KeyVaultClientGetSecretVersionsPager{ client: client, @@ -377,23 +343,12 @@ func (client *KeyVaultClient) getSecretVersionsHandleResponse(resp *http.Respons return result, nil } -// getSecretVersionsHandleError handles the GetSecretVersions error response. -func (client *KeyVaultClient) getSecretVersionsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// GetSecrets - The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in -// the response. Individual secret versions are not listed in the +// GetSecrets - The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and +// its attributes are provided in the response. Individual secret versions are not listed in the // response. This operation requires the secrets/list permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// options - KeyVaultClientGetSecretsOptions contains the optional parameters for the KeyVaultClient.GetSecrets method. func (client *KeyVaultClient) GetSecrets(vaultBaseURL string, options *KeyVaultClientGetSecretsOptions) *KeyVaultClientGetSecretsPager { return &KeyVaultClientGetSecretsPager{ client: client, @@ -434,34 +389,25 @@ func (client *KeyVaultClient) getSecretsHandleResponse(resp *http.Response) (Key return result, nil } -// getSecretsHandleError handles the GetSecrets error response. -func (client *KeyVaultClient) getSecretsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// PurgeDeletedSecret - The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only -// be enabled on a soft-delete enabled vault. This operation requires the +// PurgeDeletedSecret - The purge deleted secret operation removes the secret permanently, without the possibility of recovery. +// This operation can only be enabled on a soft-delete enabled vault. This operation requires the // secrets/purge permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// options - KeyVaultClientPurgeDeletedSecretOptions contains the optional parameters for the KeyVaultClient.PurgeDeletedSecret +// method. func (client *KeyVaultClient) PurgeDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string, options *KeyVaultClientPurgeDeletedSecretOptions) (KeyVaultClientPurgeDeletedSecretResponse, error) { req, err := client.purgeDeletedSecretCreateRequest(ctx, vaultBaseURL, secretName, options) if err != nil { return KeyVaultClientPurgeDeletedSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientPurgeDeletedSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return KeyVaultClientPurgeDeletedSecretResponse{}, client.purgeDeletedSecretHandleError(resp) + return KeyVaultClientPurgeDeletedSecretResponse{}, runtime.NewResponseError(resp) } return KeyVaultClientPurgeDeletedSecretResponse{RawResponse: resp}, nil } @@ -486,33 +432,24 @@ func (client *KeyVaultClient) purgeDeletedSecretCreateRequest(ctx context.Contex return req, nil } -// purgeDeletedSecretHandleError handles the PurgeDeletedSecret error response. -func (client *KeyVaultClient) purgeDeletedSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// RecoverDeletedSecret - Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This -// operation requires the secrets/recover permission. -// If the operation fails it returns the *KeyVaultError error type. +// RecoverDeletedSecret - Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete +// enabled vault. This operation requires the secrets/recover permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the deleted secret. +// options - KeyVaultClientRecoverDeletedSecretOptions contains the optional parameters for the KeyVaultClient.RecoverDeletedSecret +// method. func (client *KeyVaultClient) RecoverDeletedSecret(ctx context.Context, vaultBaseURL string, secretName string, options *KeyVaultClientRecoverDeletedSecretOptions) (KeyVaultClientRecoverDeletedSecretResponse, error) { req, err := client.recoverDeletedSecretCreateRequest(ctx, vaultBaseURL, secretName, options) if err != nil { return KeyVaultClientRecoverDeletedSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientRecoverDeletedSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientRecoverDeletedSecretResponse{}, client.recoverDeletedSecretHandleError(resp) + return KeyVaultClientRecoverDeletedSecretResponse{}, runtime.NewResponseError(resp) } return client.recoverDeletedSecretHandleResponse(resp) } @@ -546,32 +483,23 @@ func (client *KeyVaultClient) recoverDeletedSecretHandleResponse(resp *http.Resp return result, nil } -// recoverDeletedSecretHandleError handles the RecoverDeletedSecret error response. -func (client *KeyVaultClient) recoverDeletedSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// RestoreSecret - Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. -// If the operation fails it returns the *KeyVaultError error type. +// RestoreSecret - Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore +// permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// parameters - The parameters to restore the secret. +// options - KeyVaultClientRestoreSecretOptions contains the optional parameters for the KeyVaultClient.RestoreSecret method. func (client *KeyVaultClient) RestoreSecret(ctx context.Context, vaultBaseURL string, parameters SecretRestoreParameters, options *KeyVaultClientRestoreSecretOptions) (KeyVaultClientRestoreSecretResponse, error) { req, err := client.restoreSecretCreateRequest(ctx, vaultBaseURL, parameters, options) if err != nil { return KeyVaultClientRestoreSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientRestoreSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientRestoreSecretResponse{}, client.restoreSecretHandleError(resp) + return KeyVaultClientRestoreSecretResponse{}, runtime.NewResponseError(resp) } return client.restoreSecretHandleResponse(resp) } @@ -601,33 +529,24 @@ func (client *KeyVaultClient) restoreSecretHandleResponse(resp *http.Response) ( return result, nil } -// restoreSecretHandleError handles the RestoreSecret error response. -func (client *KeyVaultClient) restoreSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// SetSecret - The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a new version of that -// secret. This operation requires the secrets/set permission. -// If the operation fails it returns the *KeyVaultError error type. +// SetSecret - The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault +// creates a new version of that secret. This operation requires the secrets/set permission. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// parameters - The parameters for setting the secret. +// options - KeyVaultClientSetSecretOptions contains the optional parameters for the KeyVaultClient.SetSecret method. func (client *KeyVaultClient) SetSecret(ctx context.Context, vaultBaseURL string, secretName string, parameters SecretSetParameters, options *KeyVaultClientSetSecretOptions) (KeyVaultClientSetSecretResponse, error) { req, err := client.setSecretCreateRequest(ctx, vaultBaseURL, secretName, parameters, options) if err != nil { return KeyVaultClientSetSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientSetSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientSetSecretResponse{}, client.setSecretHandleError(resp) + return KeyVaultClientSetSecretResponse{}, runtime.NewResponseError(resp) } return client.setSecretHandleResponse(resp) } @@ -661,34 +580,26 @@ func (client *KeyVaultClient) setSecretHandleResponse(resp *http.Response) (KeyV return result, nil } -// setSecretHandleError handles the SetSecret error response. -func (client *KeyVaultClient) setSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - -// UpdateSecret - The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the request are left -// unchanged. The value of a secret itself cannot be changed. +// UpdateSecret - The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not +// specified in the request are left unchanged. The value of a secret itself cannot be changed. // This operation requires the secrets/set permission. -// If the operation fails it returns the *KeyVaultError error type. +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// secretName - The name of the secret. +// secretVersion - The version of the secret. +// parameters - The parameters for update secret operation. +// options - KeyVaultClientUpdateSecretOptions contains the optional parameters for the KeyVaultClient.UpdateSecret method. func (client *KeyVaultClient) UpdateSecret(ctx context.Context, vaultBaseURL string, secretName string, secretVersion string, parameters SecretUpdateParameters, options *KeyVaultClientUpdateSecretOptions) (KeyVaultClientUpdateSecretResponse, error) { req, err := client.updateSecretCreateRequest(ctx, vaultBaseURL, secretName, secretVersion, parameters, options) if err != nil { return KeyVaultClientUpdateSecretResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { return KeyVaultClientUpdateSecretResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return KeyVaultClientUpdateSecretResponse{}, client.updateSecretHandleError(resp) + return KeyVaultClientUpdateSecretResponse{}, runtime.NewResponseError(resp) } return client.updateSecretHandleResponse(resp) } @@ -725,16 +636,3 @@ func (client *KeyVaultClient) updateSecretHandleResponse(resp *http.Response) (K } return result, nil } - -// updateSecretHandleError handles the UpdateSecret error response. -func (client *KeyVaultClient) updateSecretHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azsecrets/internal/models.go b/sdk/keyvault/azsecrets/internal/models.go index 054e2eb95fa7..327c379db41a 100644 --- a/sdk/keyvault/azsecrets/internal/models.go +++ b/sdk/keyvault/azsecrets/internal/models.go @@ -37,7 +37,11 @@ type Attributes struct { // MarshalJSON implements the json.Marshaller interface for type Attributes. func (a Attributes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - a.marshalInternal(objectMap) + populateTimeUnix(objectMap, "created", a.Created) + populate(objectMap, "enabled", a.Enabled) + populateTimeUnix(objectMap, "exp", a.Expires) + populateTimeUnix(objectMap, "nbf", a.NotBefore) + populateTimeUnix(objectMap, "updated", a.Updated) return json.Marshal(objectMap) } @@ -47,18 +51,6 @@ func (a *Attributes) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &rawMsg); err != nil { return err } - return a.unmarshalInternal(rawMsg) -} - -func (a Attributes) marshalInternal(objectMap map[string]interface{}) { - populateTimeUnix(objectMap, "created", a.Created) - populate(objectMap, "enabled", a.Enabled) - populateTimeUnix(objectMap, "exp", a.Expires) - populateTimeUnix(objectMap, "nbf", a.NotBefore) - populateTimeUnix(objectMap, "updated", a.Updated) -} - -func (a *Attributes) unmarshalInternal(rawMsg map[string]json.RawMessage) error { for key, val := range rawMsg { var err error switch key { @@ -134,15 +126,38 @@ func (c CertificateInfoObject) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// DeletedSecretBundle - A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged. +// DeletedSecretBundle - A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on +// when it will be purged. type DeletedSecretBundle struct { - SecretBundle + // The secret management attributes. + Attributes *SecretAttributes `json:"attributes,omitempty"` + + // The content type of the secret. + ContentType *string `json:"contentType,omitempty"` + + // The secret id. + ID *string `json:"id,omitempty"` + // The url of the recovery object, used to identify and recover the deleted secret. RecoveryID *string `json:"recoveryId,omitempty"` + // Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags,omitempty"` + + // The secret value. + Value *string `json:"value,omitempty"` + // READ-ONLY; The time when the secret was deleted, in UTC DeletedDate *time.Time `json:"deletedDate,omitempty" azure:"ro"` + // READ-ONLY; If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV + // certificate. + Kid *string `json:"kid,omitempty" azure:"ro"` + + // READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed + // will be true. + Managed *bool `json:"managed,omitempty" azure:"ro"` + // READ-ONLY; The time when the secret is scheduled to be purged, in UTC ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"` } @@ -150,10 +165,16 @@ type DeletedSecretBundle struct { // MarshalJSON implements the json.Marshaller interface for type DeletedSecretBundle. func (d DeletedSecretBundle) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - d.SecretBundle.marshalInternal(objectMap) + populate(objectMap, "attributes", d.Attributes) + populate(objectMap, "contentType", d.ContentType) populateTimeUnix(objectMap, "deletedDate", d.DeletedDate) + populate(objectMap, "id", d.ID) + populate(objectMap, "kid", d.Kid) + populate(objectMap, "managed", d.Managed) populate(objectMap, "recoveryId", d.RecoveryID) populateTimeUnix(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -166,35 +187,68 @@ func (d *DeletedSecretBundle) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "attributes": + err = unpopulate(val, &d.Attributes) + delete(rawMsg, key) + case "contentType": + err = unpopulate(val, &d.ContentType) + delete(rawMsg, key) case "deletedDate": err = unpopulateTimeUnix(val, &d.DeletedDate) delete(rawMsg, key) + case "id": + err = unpopulate(val, &d.ID) + delete(rawMsg, key) + case "kid": + err = unpopulate(val, &d.Kid) + delete(rawMsg, key) + case "managed": + err = unpopulate(val, &d.Managed) + delete(rawMsg, key) case "recoveryId": err = unpopulate(val, &d.RecoveryID) delete(rawMsg, key) case "scheduledPurgeDate": err = unpopulateTimeUnix(val, &d.ScheduledPurgeDate) delete(rawMsg, key) + case "tags": + err = unpopulate(val, &d.Tags) + delete(rawMsg, key) + case "value": + err = unpopulate(val, &d.Value) + delete(rawMsg, key) } if err != nil { return err } } - if err := d.SecretBundle.unmarshalInternal(rawMsg); err != nil { - return err - } return nil } // DeletedSecretItem - The deleted secret item containing metadata about the deleted secret. type DeletedSecretItem struct { - SecretItem + // The secret management attributes. + Attributes *SecretAttributes `json:"attributes,omitempty"` + + // Type of the secret value such as a password. + ContentType *string `json:"contentType,omitempty"` + + // Secret identifier. + ID *string `json:"id,omitempty"` + // The url of the recovery object, used to identify and recover the deleted secret. RecoveryID *string `json:"recoveryId,omitempty"` + // Application specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags,omitempty"` + // READ-ONLY; The time when the secret was deleted, in UTC DeletedDate *time.Time `json:"deletedDate,omitempty" azure:"ro"` + // READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed + // will be true. + Managed *bool `json:"managed,omitempty" azure:"ro"` + // READ-ONLY; The time when the secret is scheduled to be purged, in UTC ScheduledPurgeDate *time.Time `json:"scheduledPurgeDate,omitempty" azure:"ro"` } @@ -202,10 +256,14 @@ type DeletedSecretItem struct { // MarshalJSON implements the json.Marshaller interface for type DeletedSecretItem. func (d DeletedSecretItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - d.SecretItem.marshalInternal(objectMap) + populate(objectMap, "attributes", d.Attributes) + populate(objectMap, "contentType", d.ContentType) populateTimeUnix(objectMap, "deletedDate", d.DeletedDate) + populate(objectMap, "id", d.ID) + populate(objectMap, "managed", d.Managed) populate(objectMap, "recoveryId", d.RecoveryID) populateTimeUnix(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) + populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } @@ -218,23 +276,35 @@ func (d *DeletedSecretItem) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "attributes": + err = unpopulate(val, &d.Attributes) + delete(rawMsg, key) + case "contentType": + err = unpopulate(val, &d.ContentType) + delete(rawMsg, key) case "deletedDate": err = unpopulateTimeUnix(val, &d.DeletedDate) delete(rawMsg, key) + case "id": + err = unpopulate(val, &d.ID) + delete(rawMsg, key) + case "managed": + err = unpopulate(val, &d.Managed) + delete(rawMsg, key) case "recoveryId": err = unpopulate(val, &d.RecoveryID) delete(rawMsg, key) case "scheduledPurgeDate": err = unpopulateTimeUnix(val, &d.ScheduledPurgeDate) delete(rawMsg, key) + case "tags": + err = unpopulate(val, &d.Tags) + delete(rawMsg, key) } if err != nil { return err } } - if err := d.SecretItem.unmarshalInternal(rawMsg); err != nil { - return err - } return nil } @@ -243,7 +313,8 @@ type DeletedSecretListResult struct { // READ-ONLY; The URL to get the next set of deleted secrets. NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // READ-ONLY; A response message containing a list of the deleted secrets in the vault along with a link to the next page of deleted secrets + // READ-ONLY; A response message containing a list of the deleted secrets in the vault along with a link to the next page + // of deleted secrets Value []*DeletedSecretItem `json:"value,omitempty" azure:"ro"` } @@ -267,28 +338,33 @@ type Error struct { Message *string `json:"message,omitempty" azure:"ro"` } -// HSMSecurityDomainBeginDownloadOptions contains the optional parameters for the HSMSecurityDomain.BeginDownload method. -type HSMSecurityDomainBeginDownloadOptions struct { +// HSMSecurityDomainClientBeginDownloadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginDownload +// method. +type HSMSecurityDomainClientBeginDownloadOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainBeginUploadOptions contains the optional parameters for the HSMSecurityDomain.BeginUpload method. -type HSMSecurityDomainBeginUploadOptions struct { +// HSMSecurityDomainClientBeginUploadOptions contains the optional parameters for the HSMSecurityDomainClient.BeginUpload +// method. +type HSMSecurityDomainClientBeginUploadOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainDownloadPendingOptions contains the optional parameters for the HSMSecurityDomain.DownloadPending method. -type HSMSecurityDomainDownloadPendingOptions struct { +// HSMSecurityDomainClientDownloadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.DownloadPending +// method. +type HSMSecurityDomainClientDownloadPendingOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainTransferKeyOptions contains the optional parameters for the HSMSecurityDomain.TransferKey method. -type HSMSecurityDomainTransferKeyOptions struct { +// HSMSecurityDomainClientTransferKeyOptions contains the optional parameters for the HSMSecurityDomainClient.TransferKey +// method. +type HSMSecurityDomainClientTransferKeyOptions struct { // placeholder for future optional parameters } -// HSMSecurityDomainUploadPendingOptions contains the optional parameters for the HSMSecurityDomain.UploadPending method. -type HSMSecurityDomainUploadPendingOptions struct { +// HSMSecurityDomainClientUploadPendingOptions contains the optional parameters for the HSMSecurityDomainClient.UploadPending +// method. +type HSMSecurityDomainClientUploadPendingOptions struct { // placeholder for future optional parameters } @@ -335,7 +411,8 @@ type KeyVaultClientPurgeDeletedSecretOptions struct { // placeholder for future optional parameters } -// KeyVaultClientRecoverDeletedSecretOptions contains the optional parameters for the KeyVaultClient.RecoverDeletedSecret method. +// KeyVaultClientRecoverDeletedSecretOptions contains the optional parameters for the KeyVaultClient.RecoverDeletedSecret +// method. type KeyVaultClientRecoverDeletedSecretOptions struct { // placeholder for future optional parameters } @@ -356,17 +433,9 @@ type KeyVaultClientUpdateSecretOptions struct { } // KeyVaultError - The key vault error exception. -// Implements the error and azcore.HTTPResponse interfaces. type KeyVaultError struct { - raw string // READ-ONLY; The key vault server error. - InnerError *Error `json:"error,omitempty" azure:"ro"` -} - -// Error implements the error interface for type KeyVaultError. -// The contents of the error text are not contractual and subject to change. -func (e KeyVaultError) Error() string { - return e.raw + Error *Error `json:"error,omitempty" azure:"ro"` } // Permission - Role definition permissions. @@ -440,8 +509,8 @@ func (r RoleAssignmentListResult) MarshalJSON() ([]byte, error) { // RoleAssignmentProperties - Role assignment properties. type RoleAssignmentProperties struct { - // REQUIRED; The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, service principal, or security - // group. + // REQUIRED; The principal ID assigned to the role. This maps to the ID inside the Active Directory. It can point to a user, + // service principal, or security group. PrincipalID *string `json:"principalId,omitempty"` // REQUIRED; The role definition ID used in the role assignment. @@ -460,25 +529,26 @@ type RoleAssignmentPropertiesWithScope struct { Scope *RoleScope `json:"scope,omitempty"` } -// RoleAssignmentsCreateOptions contains the optional parameters for the RoleAssignments.Create method. -type RoleAssignmentsCreateOptions struct { +// RoleAssignmentsClientCreateOptions contains the optional parameters for the RoleAssignmentsClient.Create method. +type RoleAssignmentsClientCreateOptions struct { // placeholder for future optional parameters } -// RoleAssignmentsDeleteOptions contains the optional parameters for the RoleAssignments.Delete method. -type RoleAssignmentsDeleteOptions struct { +// RoleAssignmentsClientDeleteOptions contains the optional parameters for the RoleAssignmentsClient.Delete method. +type RoleAssignmentsClientDeleteOptions struct { // placeholder for future optional parameters } -// RoleAssignmentsGetOptions contains the optional parameters for the RoleAssignments.Get method. -type RoleAssignmentsGetOptions struct { +// RoleAssignmentsClientGetOptions contains the optional parameters for the RoleAssignmentsClient.Get method. +type RoleAssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// RoleAssignmentsListForScopeOptions contains the optional parameters for the RoleAssignments.ListForScope method. -type RoleAssignmentsListForScopeOptions struct { - // The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId eq {id} to - // return all role assignments at, above or below the scope for the specified principal. +// RoleAssignmentsClientListForScopeOptions contains the optional parameters for the RoleAssignmentsClient.ListForScope method. +type RoleAssignmentsClientListForScopeOptions struct { + // The filter to apply on the operation. Use $filter=atScope() to return all role assignments at or above the scope. Use $filter=principalId + // eq {id} to return all role assignments at, above or below the + // scope for the specified principal. Filter *string } @@ -555,45 +625,64 @@ func (r RoleDefinitionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// RoleDefinitionsCreateOrUpdateOptions contains the optional parameters for the RoleDefinitions.CreateOrUpdate method. -type RoleDefinitionsCreateOrUpdateOptions struct { +// RoleDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the RoleDefinitionsClient.CreateOrUpdate +// method. +type RoleDefinitionsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// RoleDefinitionsDeleteOptions contains the optional parameters for the RoleDefinitions.Delete method. -type RoleDefinitionsDeleteOptions struct { +// RoleDefinitionsClientDeleteOptions contains the optional parameters for the RoleDefinitionsClient.Delete method. +type RoleDefinitionsClientDeleteOptions struct { // placeholder for future optional parameters } -// RoleDefinitionsGetOptions contains the optional parameters for the RoleDefinitions.Get method. -type RoleDefinitionsGetOptions struct { +// RoleDefinitionsClientGetOptions contains the optional parameters for the RoleDefinitionsClient.Get method. +type RoleDefinitionsClientGetOptions struct { // placeholder for future optional parameters } -// RoleDefinitionsListOptions contains the optional parameters for the RoleDefinitions.List method. -type RoleDefinitionsListOptions struct { +// RoleDefinitionsClientListOptions contains the optional parameters for the RoleDefinitionsClient.List method. +type RoleDefinitionsClientListOptions struct { // The filter to apply on the operation. Use atScopeAndBelow filter to search below the given scope as well. Filter *string } // SecretAttributes - The secret management attributes. type SecretAttributes struct { - Attributes + // Determines whether the object is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // Expiry date in UTC. + Expires *time.Time `json:"exp,omitempty"` + + // Not before date in UTC. + NotBefore *time.Time `json:"nbf,omitempty"` + + // READ-ONLY; Creation time in UTC. + Created *time.Time `json:"created,omitempty" azure:"ro"` + // READ-ONLY; softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. RecoverableDays *int32 `json:"recoverableDays,omitempty" azure:"ro"` - // READ-ONLY; Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently - // deleted by a privileged user; otherwise, only the + // READ-ONLY; Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', + // the secret can be permanently deleted by a privileged user; otherwise, only the // system can purge the secret, at the end of the retention interval. RecoveryLevel *DeletionRecoveryLevel `json:"recoveryLevel,omitempty" azure:"ro"` + + // READ-ONLY; Last updated time in UTC. + Updated *time.Time `json:"updated,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type SecretAttributes. func (s SecretAttributes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - s.Attributes.marshalInternal(objectMap) + populateTimeUnix(objectMap, "created", s.Created) + populate(objectMap, "enabled", s.Enabled) + populateTimeUnix(objectMap, "exp", s.Expires) + populateTimeUnix(objectMap, "nbf", s.NotBefore) populate(objectMap, "recoverableDays", s.RecoverableDays) populate(objectMap, "recoveryLevel", s.RecoveryLevel) + populateTimeUnix(objectMap, "updated", s.Updated) return json.Marshal(objectMap) } @@ -606,20 +695,32 @@ func (s *SecretAttributes) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "created": + err = unpopulateTimeUnix(val, &s.Created) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &s.Enabled) + delete(rawMsg, key) + case "exp": + err = unpopulateTimeUnix(val, &s.Expires) + delete(rawMsg, key) + case "nbf": + err = unpopulateTimeUnix(val, &s.NotBefore) + delete(rawMsg, key) case "recoverableDays": err = unpopulate(val, &s.RecoverableDays) delete(rawMsg, key) case "recoveryLevel": err = unpopulate(val, &s.RecoveryLevel) delete(rawMsg, key) + case "updated": + err = unpopulateTimeUnix(val, &s.Updated) + delete(rawMsg, key) } if err != nil { return err } } - if err := s.Attributes.unmarshalInternal(rawMsg); err != nil { - return err - } return nil } @@ -640,30 +741,18 @@ type SecretBundle struct { // The secret value. Value *string `json:"value,omitempty"` - // READ-ONLY; If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. + // READ-ONLY; If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV + // certificate. Kid *string `json:"kid,omitempty" azure:"ro"` - // READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true. + // READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed + // will be true. Managed *bool `json:"managed,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type SecretBundle. func (s SecretBundle) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - s.marshalInternal(objectMap) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretBundle. -func (s *SecretBundle) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - return s.unmarshalInternal(rawMsg) -} - -func (s SecretBundle) marshalInternal(objectMap map[string]interface{}) { populate(objectMap, "attributes", s.Attributes) populate(objectMap, "contentType", s.ContentType) populate(objectMap, "id", s.ID) @@ -671,39 +760,7 @@ func (s SecretBundle) marshalInternal(objectMap map[string]interface{}) { populate(objectMap, "managed", s.Managed) populate(objectMap, "tags", s.Tags) populate(objectMap, "value", s.Value) -} - -func (s *SecretBundle) unmarshalInternal(rawMsg map[string]json.RawMessage) error { - for key, val := range rawMsg { - var err error - switch key { - case "attributes": - err = unpopulate(val, &s.Attributes) - delete(rawMsg, key) - case "contentType": - err = unpopulate(val, &s.ContentType) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "kid": - err = unpopulate(val, &s.Kid) - delete(rawMsg, key) - case "managed": - err = unpopulate(val, &s.Managed) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, &s.Tags) - delete(rawMsg, key) - case "value": - err = unpopulate(val, &s.Value) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil + return json.Marshal(objectMap) } // SecretItem - The secret item containing secret metadata. @@ -720,59 +777,20 @@ type SecretItem struct { // Application specific metadata in the form of key-value pairs. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + // READ-ONLY; True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed + // will be true. Managed *bool `json:"managed,omitempty" azure:"ro"` } // MarshalJSON implements the json.Marshaller interface for type SecretItem. func (s SecretItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - s.marshalInternal(objectMap) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretItem. -func (s *SecretItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - return s.unmarshalInternal(rawMsg) -} - -func (s SecretItem) marshalInternal(objectMap map[string]interface{}) { populate(objectMap, "attributes", s.Attributes) populate(objectMap, "contentType", s.ContentType) populate(objectMap, "id", s.ID) populate(objectMap, "managed", s.Managed) populate(objectMap, "tags", s.Tags) -} - -func (s *SecretItem) unmarshalInternal(rawMsg map[string]json.RawMessage) error { - for key, val := range rawMsg { - var err error - switch key { - case "attributes": - err = unpopulate(val, &s.Attributes) - delete(rawMsg, key) - case "contentType": - err = unpopulate(val, &s.ContentType) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "managed": - err = unpopulate(val, &s.Managed) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, &s.Tags) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil + return json.Marshal(objectMap) } // SecretListResult - The secret list result. @@ -890,8 +908,8 @@ type SecurityDomainJSONWebKey struct { // REQUIRED; Key identifier. Kid *string `json:"kid,omitempty"` - // REQUIRED; JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. For Security Domain this value - // must be RSA. + // REQUIRED; JsonWebKey Key Type (kty), as defined in https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40. + // For Security Domain this value must be RSA. Kty *string `json:"kty,omitempty"` // REQUIRED; RSA modulus. diff --git a/sdk/keyvault/azsecrets/internal/pagers.go b/sdk/keyvault/azsecrets/internal/pagers.go index dea8488ce558..c72254457cbc 100644 --- a/sdk/keyvault/azsecrets/internal/pagers.go +++ b/sdk/keyvault/azsecrets/internal/pagers.go @@ -47,13 +47,13 @@ func (p *KeyVaultClientGetDeletedSecretsPager) NextPage(ctx context.Context) boo p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.getDeletedSecretsHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.getDeletedSecretsHandleResponse(resp) @@ -101,13 +101,13 @@ func (p *KeyVaultClientGetSecretVersionsPager) NextPage(ctx context.Context) boo p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.getSecretVersionsHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.getSecretVersionsHandleResponse(resp) @@ -155,13 +155,13 @@ func (p *KeyVaultClientGetSecretsPager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.getSecretsHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.getSecretsHandleResponse(resp) @@ -178,23 +178,23 @@ func (p *KeyVaultClientGetSecretsPager) PageResponse() KeyVaultClientGetSecretsR return p.current } -// RoleAssignmentsListForScopePager provides operations for iterating over paged responses. -type RoleAssignmentsListForScopePager struct { +// RoleAssignmentsClientListForScopePager provides operations for iterating over paged responses. +type RoleAssignmentsClientListForScopePager struct { client *RoleAssignmentsClient - current RoleAssignmentsListForScopeResponse + current RoleAssignmentsClientListForScopeResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, RoleAssignmentsListForScopeResponse) (*policy.Request, error) + advancer func(context.Context, RoleAssignmentsClientListForScopeResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *RoleAssignmentsListForScopePager) Err() error { +func (p *RoleAssignmentsClientListForScopePager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *RoleAssignmentsListForScopePager) NextPage(ctx context.Context) bool { +func (p *RoleAssignmentsClientListForScopePager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { @@ -209,13 +209,13 @@ func (p *RoleAssignmentsListForScopePager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listForScopeHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listForScopeHandleResponse(resp) @@ -227,28 +227,28 @@ func (p *RoleAssignmentsListForScopePager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current RoleAssignmentsListForScopeResponse page. -func (p *RoleAssignmentsListForScopePager) PageResponse() RoleAssignmentsListForScopeResponse { +// PageResponse returns the current RoleAssignmentsClientListForScopeResponse page. +func (p *RoleAssignmentsClientListForScopePager) PageResponse() RoleAssignmentsClientListForScopeResponse { return p.current } -// RoleDefinitionsListPager provides operations for iterating over paged responses. -type RoleDefinitionsListPager struct { +// RoleDefinitionsClientListPager provides operations for iterating over paged responses. +type RoleDefinitionsClientListPager struct { client *RoleDefinitionsClient - current RoleDefinitionsListResponse + current RoleDefinitionsClientListResponse err error requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, RoleDefinitionsListResponse) (*policy.Request, error) + advancer func(context.Context, RoleDefinitionsClientListResponse) (*policy.Request, error) } // Err returns the last error encountered while paging. -func (p *RoleDefinitionsListPager) Err() error { +func (p *RoleDefinitionsClientListPager) Err() error { return p.err } // NextPage returns true if the pager advanced to the next page. // Returns false if there are no more pages or an error occurred. -func (p *RoleDefinitionsListPager) NextPage(ctx context.Context) bool { +func (p *RoleDefinitionsClientListPager) NextPage(ctx context.Context) bool { var req *policy.Request var err error if !reflect.ValueOf(p.current).IsZero() { @@ -263,13 +263,13 @@ func (p *RoleDefinitionsListPager) NextPage(ctx context.Context) bool { p.err = err return false } - resp, err := p.client.con.Pipeline().Do(req) + resp, err := p.client.pl.Do(req) if err != nil { p.err = err return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listHandleResponse(resp) @@ -281,7 +281,7 @@ func (p *RoleDefinitionsListPager) NextPage(ctx context.Context) bool { return true } -// PageResponse returns the current RoleDefinitionsListResponse page. -func (p *RoleDefinitionsListPager) PageResponse() RoleDefinitionsListResponse { +// PageResponse returns the current RoleDefinitionsClientListResponse page. +func (p *RoleDefinitionsClientListPager) PageResponse() RoleDefinitionsClientListResponse { return p.current } diff --git a/sdk/keyvault/azsecrets/internal/pollers.go b/sdk/keyvault/azsecrets/internal/pollers.go index 2b5e07174fe8..c29eb753fca6 100644 --- a/sdk/keyvault/azsecrets/internal/pollers.go +++ b/sdk/keyvault/azsecrets/internal/pollers.go @@ -14,13 +14,13 @@ import ( "net/http" ) -// HSMSecurityDomainDownloadPoller provides polling facilities until the operation reaches a terminal state. -type HSMSecurityDomainDownloadPoller struct { +// HSMSecurityDomainClientDownloadPoller provides polling facilities until the operation reaches a terminal state. +type HSMSecurityDomainClientDownloadPoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *HSMSecurityDomainDownloadPoller) Done() bool { +func (p *HSMSecurityDomainClientDownloadPoller) Done() bool { return p.pt.Done() } @@ -34,18 +34,18 @@ func (p *HSMSecurityDomainDownloadPoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *HSMSecurityDomainDownloadPoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *HSMSecurityDomainClientDownloadPoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final HSMSecurityDomainDownloadResponse will be returned. -func (p *HSMSecurityDomainDownloadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainDownloadResponse, error) { - respType := HSMSecurityDomainDownloadResponse{} +// If the final GET succeeded then the final HSMSecurityDomainClientDownloadResponse will be returned. +func (p *HSMSecurityDomainClientDownloadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainClientDownloadResponse, error) { + respType := HSMSecurityDomainClientDownloadResponse{} resp, err := p.pt.FinalResponse(ctx, &respType.SecurityDomainObject) if err != nil { - return HSMSecurityDomainDownloadResponse{}, err + return HSMSecurityDomainClientDownloadResponse{}, err } respType.RawResponse = resp return respType, nil @@ -53,17 +53,17 @@ func (p *HSMSecurityDomainDownloadPoller) FinalResponse(ctx context.Context) (HS // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *HSMSecurityDomainDownloadPoller) ResumeToken() (string, error) { +func (p *HSMSecurityDomainClientDownloadPoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } -// HSMSecurityDomainUploadPoller provides polling facilities until the operation reaches a terminal state. -type HSMSecurityDomainUploadPoller struct { +// HSMSecurityDomainClientUploadPoller provides polling facilities until the operation reaches a terminal state. +type HSMSecurityDomainClientUploadPoller struct { pt *azcore.Poller } // Done returns true if the LRO has reached a terminal state. -func (p *HSMSecurityDomainUploadPoller) Done() bool { +func (p *HSMSecurityDomainClientUploadPoller) Done() bool { return p.pt.Done() } @@ -77,18 +77,18 @@ func (p *HSMSecurityDomainUploadPoller) Done() bool { // If Poll fails, the poller's state is unmodified and the error is returned. // Calling Poll on an LRO that has reached a terminal state will return the final // HTTP response or error. -func (p *HSMSecurityDomainUploadPoller) Poll(ctx context.Context) (*http.Response, error) { +func (p *HSMSecurityDomainClientUploadPoller) Poll(ctx context.Context) (*http.Response, error) { return p.pt.Poll(ctx) } // FinalResponse performs a final GET to the service and returns the final response // for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final HSMSecurityDomainUploadResponse will be returned. -func (p *HSMSecurityDomainUploadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainUploadResponse, error) { - respType := HSMSecurityDomainUploadResponse{} +// If the final GET succeeded then the final HSMSecurityDomainClientUploadResponse will be returned. +func (p *HSMSecurityDomainClientUploadPoller) FinalResponse(ctx context.Context) (HSMSecurityDomainClientUploadResponse, error) { + respType := HSMSecurityDomainClientUploadResponse{} resp, err := p.pt.FinalResponse(ctx, &respType.SecurityDomainOperationStatus) if err != nil { - return HSMSecurityDomainUploadResponse{}, err + return HSMSecurityDomainClientUploadResponse{}, err } respType.RawResponse = resp return respType, nil @@ -96,6 +96,6 @@ func (p *HSMSecurityDomainUploadPoller) FinalResponse(ctx context.Context) (HSMS // ResumeToken returns a value representing the poller that can be used to resume // the LRO at a later time. ResumeTokens are unique per service operation. -func (p *HSMSecurityDomainUploadPoller) ResumeToken() (string, error) { +func (p *HSMSecurityDomainClientUploadPoller) ResumeToken() (string, error) { return p.pt.ResumeToken() } diff --git a/sdk/keyvault/azsecrets/internal/response_types.go b/sdk/keyvault/azsecrets/internal/response_types.go index 065fbbfbfa12..edd5a025c2f9 100644 --- a/sdk/keyvault/azsecrets/internal/response_types.go +++ b/sdk/keyvault/azsecrets/internal/response_types.go @@ -15,22 +15,22 @@ import ( "time" ) -// HSMSecurityDomainDownloadPendingResponse contains the response from method HSMSecurityDomain.DownloadPending. -type HSMSecurityDomainDownloadPendingResponse struct { - HSMSecurityDomainDownloadPendingResult +// HSMSecurityDomainClientDownloadPendingResponse contains the response from method HSMSecurityDomainClient.DownloadPending. +type HSMSecurityDomainClientDownloadPendingResponse struct { + HSMSecurityDomainClientDownloadPendingResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainDownloadPendingResult contains the result from method HSMSecurityDomain.DownloadPending. -type HSMSecurityDomainDownloadPendingResult struct { +// HSMSecurityDomainClientDownloadPendingResult contains the result from method HSMSecurityDomainClient.DownloadPending. +type HSMSecurityDomainClientDownloadPendingResult struct { SecurityDomainOperationStatus } -// HSMSecurityDomainDownloadPollerResponse contains the response from method HSMSecurityDomain.Download. -type HSMSecurityDomainDownloadPollerResponse struct { +// HSMSecurityDomainClientDownloadPollerResponse contains the response from method HSMSecurityDomainClient.Download. +type HSMSecurityDomainClientDownloadPollerResponse struct { // Poller contains an initialized poller. - Poller *HSMSecurityDomainDownloadPoller + Poller *HSMSecurityDomainClientDownloadPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -38,8 +38,8 @@ type HSMSecurityDomainDownloadPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -func (l HSMSecurityDomainDownloadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainDownloadResponse, error) { - respType := HSMSecurityDomainDownloadResponse{} +func (l HSMSecurityDomainClientDownloadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainClientDownloadResponse, error) { + respType := HSMSecurityDomainClientDownloadResponse{} resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SecurityDomainObject) if err != nil { return respType, err @@ -48,13 +48,13 @@ func (l HSMSecurityDomainDownloadPollerResponse) PollUntilDone(ctx context.Conte return respType, nil } -// Resume rehydrates a HSMSecurityDomainDownloadPollerResponse from the provided client and resume token. -func (l *HSMSecurityDomainDownloadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("HSMSecurityDomainClient.Download", token, client.con.Pipeline(), client.downloadHandleError) +// Resume rehydrates a HSMSecurityDomainClientDownloadPollerResponse from the provided client and resume token. +func (l *HSMSecurityDomainClientDownloadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("HSMSecurityDomainClient.Download", token, client.pl) if err != nil { return err } - poller := &HSMSecurityDomainDownloadPoller{ + poller := &HSMSecurityDomainClientDownloadPoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -66,46 +66,46 @@ func (l *HSMSecurityDomainDownloadPollerResponse) Resume(ctx context.Context, cl return nil } -// HSMSecurityDomainDownloadResponse contains the response from method HSMSecurityDomain.Download. -type HSMSecurityDomainDownloadResponse struct { - HSMSecurityDomainDownloadResult +// HSMSecurityDomainClientDownloadResponse contains the response from method HSMSecurityDomainClient.Download. +type HSMSecurityDomainClientDownloadResponse struct { + HSMSecurityDomainClientDownloadResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainDownloadResult contains the result from method HSMSecurityDomain.Download. -type HSMSecurityDomainDownloadResult struct { +// HSMSecurityDomainClientDownloadResult contains the result from method HSMSecurityDomainClient.Download. +type HSMSecurityDomainClientDownloadResult struct { SecurityDomainObject } -// HSMSecurityDomainTransferKeyResponse contains the response from method HSMSecurityDomain.TransferKey. -type HSMSecurityDomainTransferKeyResponse struct { - HSMSecurityDomainTransferKeyResult +// HSMSecurityDomainClientTransferKeyResponse contains the response from method HSMSecurityDomainClient.TransferKey. +type HSMSecurityDomainClientTransferKeyResponse struct { + HSMSecurityDomainClientTransferKeyResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainTransferKeyResult contains the result from method HSMSecurityDomain.TransferKey. -type HSMSecurityDomainTransferKeyResult struct { +// HSMSecurityDomainClientTransferKeyResult contains the result from method HSMSecurityDomainClient.TransferKey. +type HSMSecurityDomainClientTransferKeyResult struct { TransferKey } -// HSMSecurityDomainUploadPendingResponse contains the response from method HSMSecurityDomain.UploadPending. -type HSMSecurityDomainUploadPendingResponse struct { - HSMSecurityDomainUploadPendingResult +// HSMSecurityDomainClientUploadPendingResponse contains the response from method HSMSecurityDomainClient.UploadPending. +type HSMSecurityDomainClientUploadPendingResponse struct { + HSMSecurityDomainClientUploadPendingResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainUploadPendingResult contains the result from method HSMSecurityDomain.UploadPending. -type HSMSecurityDomainUploadPendingResult struct { +// HSMSecurityDomainClientUploadPendingResult contains the result from method HSMSecurityDomainClient.UploadPending. +type HSMSecurityDomainClientUploadPendingResult struct { SecurityDomainOperationStatus } -// HSMSecurityDomainUploadPollerResponse contains the response from method HSMSecurityDomain.Upload. -type HSMSecurityDomainUploadPollerResponse struct { +// HSMSecurityDomainClientUploadPollerResponse contains the response from method HSMSecurityDomainClient.Upload. +type HSMSecurityDomainClientUploadPollerResponse struct { // Poller contains an initialized poller. - Poller *HSMSecurityDomainUploadPoller + Poller *HSMSecurityDomainClientUploadPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response @@ -113,8 +113,8 @@ type HSMSecurityDomainUploadPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. // freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -func (l HSMSecurityDomainUploadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainUploadResponse, error) { - respType := HSMSecurityDomainUploadResponse{} +func (l HSMSecurityDomainClientUploadPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (HSMSecurityDomainClientUploadResponse, error) { + respType := HSMSecurityDomainClientUploadResponse{} resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.SecurityDomainOperationStatus) if err != nil { return respType, err @@ -123,13 +123,13 @@ func (l HSMSecurityDomainUploadPollerResponse) PollUntilDone(ctx context.Context return respType, nil } -// Resume rehydrates a HSMSecurityDomainUploadPollerResponse from the provided client and resume token. -func (l *HSMSecurityDomainUploadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("HSMSecurityDomainClient.Upload", token, client.con.Pipeline(), client.uploadHandleError) +// Resume rehydrates a HSMSecurityDomainClientUploadPollerResponse from the provided client and resume token. +func (l *HSMSecurityDomainClientUploadPollerResponse) Resume(ctx context.Context, client *HSMSecurityDomainClient, token string) error { + pt, err := armruntime.NewPollerFromResumeToken("HSMSecurityDomainClient.Upload", token, client.pl) if err != nil { return err } - poller := &HSMSecurityDomainUploadPoller{ + poller := &HSMSecurityDomainClientUploadPoller{ pt: pt, } resp, err := poller.Poll(ctx) @@ -141,15 +141,15 @@ func (l *HSMSecurityDomainUploadPollerResponse) Resume(ctx context.Context, clie return nil } -// HSMSecurityDomainUploadResponse contains the response from method HSMSecurityDomain.Upload. -type HSMSecurityDomainUploadResponse struct { - HSMSecurityDomainUploadResult +// HSMSecurityDomainClientUploadResponse contains the response from method HSMSecurityDomainClient.Upload. +type HSMSecurityDomainClientUploadResponse struct { + HSMSecurityDomainClientUploadResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// HSMSecurityDomainUploadResult contains the result from method HSMSecurityDomain.Upload. -type HSMSecurityDomainUploadResult struct { +// HSMSecurityDomainClientUploadResult contains the result from method HSMSecurityDomainClient.Upload. +type HSMSecurityDomainClientUploadResult struct { SecurityDomainOperationStatus } @@ -291,98 +291,98 @@ type KeyVaultClientUpdateSecretResult struct { SecretBundle } -// RoleAssignmentsCreateResponse contains the response from method RoleAssignments.Create. -type RoleAssignmentsCreateResponse struct { - RoleAssignmentsCreateResult +// RoleAssignmentsClientCreateResponse contains the response from method RoleAssignmentsClient.Create. +type RoleAssignmentsClientCreateResponse struct { + RoleAssignmentsClientCreateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsCreateResult contains the result from method RoleAssignments.Create. -type RoleAssignmentsCreateResult struct { +// RoleAssignmentsClientCreateResult contains the result from method RoleAssignmentsClient.Create. +type RoleAssignmentsClientCreateResult struct { RoleAssignment } -// RoleAssignmentsDeleteResponse contains the response from method RoleAssignments.Delete. -type RoleAssignmentsDeleteResponse struct { - RoleAssignmentsDeleteResult +// RoleAssignmentsClientDeleteResponse contains the response from method RoleAssignmentsClient.Delete. +type RoleAssignmentsClientDeleteResponse struct { + RoleAssignmentsClientDeleteResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsDeleteResult contains the result from method RoleAssignments.Delete. -type RoleAssignmentsDeleteResult struct { +// RoleAssignmentsClientDeleteResult contains the result from method RoleAssignmentsClient.Delete. +type RoleAssignmentsClientDeleteResult struct { RoleAssignment } -// RoleAssignmentsGetResponse contains the response from method RoleAssignments.Get. -type RoleAssignmentsGetResponse struct { - RoleAssignmentsGetResult +// RoleAssignmentsClientGetResponse contains the response from method RoleAssignmentsClient.Get. +type RoleAssignmentsClientGetResponse struct { + RoleAssignmentsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsGetResult contains the result from method RoleAssignments.Get. -type RoleAssignmentsGetResult struct { +// RoleAssignmentsClientGetResult contains the result from method RoleAssignmentsClient.Get. +type RoleAssignmentsClientGetResult struct { RoleAssignment } -// RoleAssignmentsListForScopeResponse contains the response from method RoleAssignments.ListForScope. -type RoleAssignmentsListForScopeResponse struct { - RoleAssignmentsListForScopeResult +// RoleAssignmentsClientListForScopeResponse contains the response from method RoleAssignmentsClient.ListForScope. +type RoleAssignmentsClientListForScopeResponse struct { + RoleAssignmentsClientListForScopeResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleAssignmentsListForScopeResult contains the result from method RoleAssignments.ListForScope. -type RoleAssignmentsListForScopeResult struct { +// RoleAssignmentsClientListForScopeResult contains the result from method RoleAssignmentsClient.ListForScope. +type RoleAssignmentsClientListForScopeResult struct { RoleAssignmentListResult } -// RoleDefinitionsCreateOrUpdateResponse contains the response from method RoleDefinitions.CreateOrUpdate. -type RoleDefinitionsCreateOrUpdateResponse struct { - RoleDefinitionsCreateOrUpdateResult +// RoleDefinitionsClientCreateOrUpdateResponse contains the response from method RoleDefinitionsClient.CreateOrUpdate. +type RoleDefinitionsClientCreateOrUpdateResponse struct { + RoleDefinitionsClientCreateOrUpdateResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsCreateOrUpdateResult contains the result from method RoleDefinitions.CreateOrUpdate. -type RoleDefinitionsCreateOrUpdateResult struct { +// RoleDefinitionsClientCreateOrUpdateResult contains the result from method RoleDefinitionsClient.CreateOrUpdate. +type RoleDefinitionsClientCreateOrUpdateResult struct { RoleDefinition } -// RoleDefinitionsDeleteResponse contains the response from method RoleDefinitions.Delete. -type RoleDefinitionsDeleteResponse struct { - RoleDefinitionsDeleteResult +// RoleDefinitionsClientDeleteResponse contains the response from method RoleDefinitionsClient.Delete. +type RoleDefinitionsClientDeleteResponse struct { + RoleDefinitionsClientDeleteResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsDeleteResult contains the result from method RoleDefinitions.Delete. -type RoleDefinitionsDeleteResult struct { +// RoleDefinitionsClientDeleteResult contains the result from method RoleDefinitionsClient.Delete. +type RoleDefinitionsClientDeleteResult struct { RoleDefinition } -// RoleDefinitionsGetResponse contains the response from method RoleDefinitions.Get. -type RoleDefinitionsGetResponse struct { - RoleDefinitionsGetResult +// RoleDefinitionsClientGetResponse contains the response from method RoleDefinitionsClient.Get. +type RoleDefinitionsClientGetResponse struct { + RoleDefinitionsClientGetResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsGetResult contains the result from method RoleDefinitions.Get. -type RoleDefinitionsGetResult struct { +// RoleDefinitionsClientGetResult contains the result from method RoleDefinitionsClient.Get. +type RoleDefinitionsClientGetResult struct { RoleDefinition } -// RoleDefinitionsListResponse contains the response from method RoleDefinitions.List. -type RoleDefinitionsListResponse struct { - RoleDefinitionsListResult +// RoleDefinitionsClientListResponse contains the response from method RoleDefinitionsClient.List. +type RoleDefinitionsClientListResponse struct { + RoleDefinitionsClientListResult // RawResponse contains the underlying HTTP response. RawResponse *http.Response } -// RoleDefinitionsListResult contains the result from method RoleDefinitions.List. -type RoleDefinitionsListResult struct { +// RoleDefinitionsClientListResult contains the result from method RoleDefinitionsClient.List. +type RoleDefinitionsClientListResult struct { RoleDefinitionListResult } diff --git a/sdk/keyvault/azsecrets/internal/roleassignments_client.go b/sdk/keyvault/azsecrets/internal/roleassignments_client.go index 5f504d527b85..dc89c2e26d64 100644 --- a/sdk/keyvault/azsecrets/internal/roleassignments_client.go +++ b/sdk/keyvault/azsecrets/internal/roleassignments_client.go @@ -11,7 +11,7 @@ package internal import ( "context" "errors" - "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,39 +22,49 @@ import ( // RoleAssignmentsClient contains the methods for the RoleAssignments group. // Don't use this type directly, use NewRoleAssignmentsClient() instead. type RoleAssignmentsClient struct { - con *Connection + pl runtime.Pipeline } // NewRoleAssignmentsClient creates a new instance of RoleAssignmentsClient with the specified values. -func NewRoleAssignmentsClient(con *Connection) *RoleAssignmentsClient { - return &RoleAssignmentsClient{con: con} +// options - pass nil to accept the default values. +func NewRoleAssignmentsClient(options *azcore.ClientOptions) *RoleAssignmentsClient { + cp := azcore.ClientOptions{} + if options != nil { + cp = *options + } + client := &RoleAssignmentsClient{ + pl: runtime.NewPipeline(moduleName, moduleVersion, runtime.PipelineOptions{}, &cp), + } + return client } // Create - Creates a role assignment. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) Create(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsCreateOptions) (RoleAssignmentsCreateResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignment to create. +// roleAssignmentName - The name of the role assignment to create. It can be any valid GUID. +// parameters - Parameters for the role assignment. +// options - RoleAssignmentsClientCreateOptions contains the optional parameters for the RoleAssignmentsClient.Create method. +func (client *RoleAssignmentsClient) Create(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsClientCreateOptions) (RoleAssignmentsClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, vaultBaseURL, scope, roleAssignmentName, parameters, options) if err != nil { - return RoleAssignmentsCreateResponse{}, err + return RoleAssignmentsClientCreateResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleAssignmentsCreateResponse{}, err + return RoleAssignmentsClientCreateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return RoleAssignmentsCreateResponse{}, client.createHandleError(resp) + return RoleAssignmentsClientCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) } // createCreateRequest creates the Create request. -func (client *RoleAssignmentsClient) createCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsCreateOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) createCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, parameters RoleAssignmentCreateParameters, options *RoleAssignmentsClientCreateOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleAssignmentName == "" { return nil, errors.New("parameter roleAssignmentName cannot be empty") @@ -72,52 +82,40 @@ func (client *RoleAssignmentsClient) createCreateRequest(ctx context.Context, va } // createHandleResponse handles the Create response. -func (client *RoleAssignmentsClient) createHandleResponse(resp *http.Response) (RoleAssignmentsCreateResponse, error) { - result := RoleAssignmentsCreateResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) createHandleResponse(resp *http.Response) (RoleAssignmentsClientCreateResponse, error) { + result := RoleAssignmentsClientCreateResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil { - return RoleAssignmentsCreateResponse{}, err + return RoleAssignmentsClientCreateResponse{}, err } return result, nil } -// createHandleError handles the Create error response. -func (client *RoleAssignmentsClient) createHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - Deletes a role assignment. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsDeleteOptions) (RoleAssignmentsDeleteResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignment to delete. +// roleAssignmentName - The name of the role assignment to delete. +// options - RoleAssignmentsClientDeleteOptions contains the optional parameters for the RoleAssignmentsClient.Delete method. +func (client *RoleAssignmentsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientDeleteOptions) (RoleAssignmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, vaultBaseURL, scope, roleAssignmentName, options) if err != nil { - return RoleAssignmentsDeleteResponse{}, err + return RoleAssignmentsClientDeleteResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleAssignmentsDeleteResponse{}, err + return RoleAssignmentsClientDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleAssignmentsDeleteResponse{}, client.deleteHandleError(resp) + return RoleAssignmentsClientDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } // deleteCreateRequest creates the Delete request. -func (client *RoleAssignmentsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsDeleteOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientDeleteOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleAssignmentName == "" { return nil, errors.New("parameter roleAssignmentName cannot be empty") @@ -135,52 +133,40 @@ func (client *RoleAssignmentsClient) deleteCreateRequest(ctx context.Context, va } // deleteHandleResponse handles the Delete response. -func (client *RoleAssignmentsClient) deleteHandleResponse(resp *http.Response) (RoleAssignmentsDeleteResponse, error) { - result := RoleAssignmentsDeleteResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) deleteHandleResponse(resp *http.Response) (RoleAssignmentsClientDeleteResponse, error) { + result := RoleAssignmentsClientDeleteResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil { - return RoleAssignmentsDeleteResponse{}, err + return RoleAssignmentsClientDeleteResponse{}, err } return result, nil } -// deleteHandleError handles the Delete error response. -func (client *RoleAssignmentsClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Get - Get the specified role assignment. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsGetOptions) (RoleAssignmentsGetResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignment. +// roleAssignmentName - The name of the role assignment to get. +// options - RoleAssignmentsClientGetOptions contains the optional parameters for the RoleAssignmentsClient.Get method. +func (client *RoleAssignmentsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientGetOptions) (RoleAssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultBaseURL, scope, roleAssignmentName, options) if err != nil { - return RoleAssignmentsGetResponse{}, err + return RoleAssignmentsClientGetResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleAssignmentsGetResponse{}, err + return RoleAssignmentsClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleAssignmentsGetResponse{}, client.getHandleError(resp) + return RoleAssignmentsClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *RoleAssignmentsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsGetOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleAssignmentName string, options *RoleAssignmentsClientGetOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleAssignmentName == "" { return nil, errors.New("parameter roleAssignmentName cannot be empty") @@ -198,49 +184,37 @@ func (client *RoleAssignmentsClient) getCreateRequest(ctx context.Context, vault } // getHandleResponse handles the Get response. -func (client *RoleAssignmentsClient) getHandleResponse(resp *http.Response) (RoleAssignmentsGetResponse, error) { - result := RoleAssignmentsGetResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) getHandleResponse(resp *http.Response) (RoleAssignmentsClientGetResponse, error) { + result := RoleAssignmentsClientGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignment); err != nil { - return RoleAssignmentsGetResponse{}, err + return RoleAssignmentsClientGetResponse{}, err } return result, nil } -// getHandleError handles the Get error response. -func (client *RoleAssignmentsClient) getHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListForScope - Gets role assignments for a scope. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleAssignmentsClient) ListForScope(vaultBaseURL string, scope string, options *RoleAssignmentsListForScopeOptions) *RoleAssignmentsListForScopePager { - return &RoleAssignmentsListForScopePager{ +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role assignments. +// options - RoleAssignmentsClientListForScopeOptions contains the optional parameters for the RoleAssignmentsClient.ListForScope +// method. +func (client *RoleAssignmentsClient) ListForScope(vaultBaseURL string, scope string, options *RoleAssignmentsClientListForScopeOptions) *RoleAssignmentsClientListForScopePager { + return &RoleAssignmentsClientListForScopePager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listForScopeCreateRequest(ctx, vaultBaseURL, scope, options) }, - advancer: func(ctx context.Context, resp RoleAssignmentsListForScopeResponse) (*policy.Request, error) { + advancer: func(ctx context.Context, resp RoleAssignmentsClientListForScopeResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.RoleAssignmentListResult.NextLink) }, } } // listForScopeCreateRequest creates the ListForScope request. -func (client *RoleAssignmentsClient) listForScopeCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleAssignmentsListForScopeOptions) (*policy.Request, error) { +func (client *RoleAssignmentsClient) listForScopeCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleAssignmentsClientListForScopeOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleAssignments" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(host, urlPath)) if err != nil { @@ -257,23 +231,10 @@ func (client *RoleAssignmentsClient) listForScopeCreateRequest(ctx context.Conte } // listForScopeHandleResponse handles the ListForScope response. -func (client *RoleAssignmentsClient) listForScopeHandleResponse(resp *http.Response) (RoleAssignmentsListForScopeResponse, error) { - result := RoleAssignmentsListForScopeResponse{RawResponse: resp} +func (client *RoleAssignmentsClient) listForScopeHandleResponse(resp *http.Response) (RoleAssignmentsClientListForScopeResponse, error) { + result := RoleAssignmentsClientListForScopeResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleAssignmentListResult); err != nil { - return RoleAssignmentsListForScopeResponse{}, err + return RoleAssignmentsClientListForScopeResponse{}, err } return result, nil } - -// listForScopeHandleError handles the ListForScope error response. -func (client *RoleAssignmentsClient) listForScopeHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azsecrets/internal/roledefinitions_client.go b/sdk/keyvault/azsecrets/internal/roledefinitions_client.go index 0340e32a0625..3d62ea44f89b 100644 --- a/sdk/keyvault/azsecrets/internal/roledefinitions_client.go +++ b/sdk/keyvault/azsecrets/internal/roledefinitions_client.go @@ -11,7 +11,7 @@ package internal import ( "context" "errors" - "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -22,39 +22,50 @@ import ( // RoleDefinitionsClient contains the methods for the RoleDefinitions group. // Don't use this type directly, use NewRoleDefinitionsClient() instead. type RoleDefinitionsClient struct { - con *Connection + pl runtime.Pipeline } // NewRoleDefinitionsClient creates a new instance of RoleDefinitionsClient with the specified values. -func NewRoleDefinitionsClient(con *Connection) *RoleDefinitionsClient { - return &RoleDefinitionsClient{con: con} +// options - pass nil to accept the default values. +func NewRoleDefinitionsClient(options *azcore.ClientOptions) *RoleDefinitionsClient { + cp := azcore.ClientOptions{} + if options != nil { + cp = *options + } + client := &RoleDefinitionsClient{ + pl: runtime.NewPipeline(moduleName, moduleVersion, runtime.PipelineOptions{}, &cp), + } + return client } // CreateOrUpdate - Creates or updates a custom role definition. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) CreateOrUpdate(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsCreateOrUpdateOptions) (RoleDefinitionsCreateOrUpdateResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition to create or update. Managed HSM only supports '/'. +// roleDefinitionName - The name of the role definition to create or update. It can be any valid GUID. +// parameters - Parameters for the role definition. +// options - RoleDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the RoleDefinitionsClient.CreateOrUpdate +// method. +func (client *RoleDefinitionsClient) CreateOrUpdate(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsClientCreateOrUpdateOptions) (RoleDefinitionsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, vaultBaseURL, scope, roleDefinitionName, parameters, options) if err != nil { - return RoleDefinitionsCreateOrUpdateResponse{}, err + return RoleDefinitionsClientCreateOrUpdateResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleDefinitionsCreateOrUpdateResponse{}, err + return RoleDefinitionsClientCreateOrUpdateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return RoleDefinitionsCreateOrUpdateResponse{}, client.createOrUpdateHandleError(resp) + return RoleDefinitionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) } return client.createOrUpdateHandleResponse(resp) } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *RoleDefinitionsClient) createOrUpdateCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsCreateOrUpdateOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) createOrUpdateCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, parameters RoleDefinitionCreateParameters, options *RoleDefinitionsClientCreateOrUpdateOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleDefinitionName == "" { return nil, errors.New("parameter roleDefinitionName cannot be empty") @@ -72,52 +83,40 @@ func (client *RoleDefinitionsClient) createOrUpdateCreateRequest(ctx context.Con } // createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *RoleDefinitionsClient) createOrUpdateHandleResponse(resp *http.Response) (RoleDefinitionsCreateOrUpdateResponse, error) { - result := RoleDefinitionsCreateOrUpdateResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) createOrUpdateHandleResponse(resp *http.Response) (RoleDefinitionsClientCreateOrUpdateResponse, error) { + result := RoleDefinitionsClientCreateOrUpdateResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinition); err != nil { - return RoleDefinitionsCreateOrUpdateResponse{}, err + return RoleDefinitionsClientCreateOrUpdateResponse{}, err } return result, nil } -// createOrUpdateHandleError handles the CreateOrUpdate error response. -func (client *RoleDefinitionsClient) createOrUpdateHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - Deletes a custom role definition. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsDeleteOptions) (RoleDefinitionsDeleteResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition to delete. Managed HSM only supports '/'. +// roleDefinitionName - The name (GUID) of the role definition to delete. +// options - RoleDefinitionsClientDeleteOptions contains the optional parameters for the RoleDefinitionsClient.Delete method. +func (client *RoleDefinitionsClient) Delete(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientDeleteOptions) (RoleDefinitionsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, vaultBaseURL, scope, roleDefinitionName, options) if err != nil { - return RoleDefinitionsDeleteResponse{}, err + return RoleDefinitionsClientDeleteResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleDefinitionsDeleteResponse{}, err + return RoleDefinitionsClientDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleDefinitionsDeleteResponse{}, client.deleteHandleError(resp) + return RoleDefinitionsClientDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } // deleteCreateRequest creates the Delete request. -func (client *RoleDefinitionsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsDeleteOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) deleteCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientDeleteOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleDefinitionName == "" { return nil, errors.New("parameter roleDefinitionName cannot be empty") @@ -135,52 +134,40 @@ func (client *RoleDefinitionsClient) deleteCreateRequest(ctx context.Context, va } // deleteHandleResponse handles the Delete response. -func (client *RoleDefinitionsClient) deleteHandleResponse(resp *http.Response) (RoleDefinitionsDeleteResponse, error) { - result := RoleDefinitionsDeleteResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) deleteHandleResponse(resp *http.Response) (RoleDefinitionsClientDeleteResponse, error) { + result := RoleDefinitionsClientDeleteResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinition); err != nil { - return RoleDefinitionsDeleteResponse{}, err + return RoleDefinitionsClientDeleteResponse{}, err } return result, nil } -// deleteHandleError handles the Delete error response. -func (client *RoleDefinitionsClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Get - Get the specified role definition. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsGetOptions) (RoleDefinitionsGetResponse, error) { +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition to get. Managed HSM only supports '/'. +// roleDefinitionName - The name of the role definition to get. +// options - RoleDefinitionsClientGetOptions contains the optional parameters for the RoleDefinitionsClient.Get method. +func (client *RoleDefinitionsClient) Get(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientGetOptions) (RoleDefinitionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultBaseURL, scope, roleDefinitionName, options) if err != nil { - return RoleDefinitionsGetResponse{}, err + return RoleDefinitionsClientGetResponse{}, err } - resp, err := client.con.Pipeline().Do(req) + resp, err := client.pl.Do(req) if err != nil { - return RoleDefinitionsGetResponse{}, err + return RoleDefinitionsClientGetResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return RoleDefinitionsGetResponse{}, client.getHandleError(resp) + return RoleDefinitionsClientGetResponse{}, runtime.NewResponseError(resp) } return client.getHandleResponse(resp) } // getCreateRequest creates the Get request. -func (client *RoleDefinitionsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsGetOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) getCreateRequest(ctx context.Context, vaultBaseURL string, scope string, roleDefinitionName string, options *RoleDefinitionsClientGetOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionName}" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if roleDefinitionName == "" { return nil, errors.New("parameter roleDefinitionName cannot be empty") @@ -198,49 +185,36 @@ func (client *RoleDefinitionsClient) getCreateRequest(ctx context.Context, vault } // getHandleResponse handles the Get response. -func (client *RoleDefinitionsClient) getHandleResponse(resp *http.Response) (RoleDefinitionsGetResponse, error) { - result := RoleDefinitionsGetResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) getHandleResponse(resp *http.Response) (RoleDefinitionsClientGetResponse, error) { + result := RoleDefinitionsClientGetResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinition); err != nil { - return RoleDefinitionsGetResponse{}, err + return RoleDefinitionsClientGetResponse{}, err } return result, nil } -// getHandleError handles the Get error response. -func (client *RoleDefinitionsClient) getHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // List - Get all role definitions that are applicable at scope and above. -// If the operation fails it returns the *KeyVaultError error type. -func (client *RoleDefinitionsClient) List(vaultBaseURL string, scope string, options *RoleDefinitionsListOptions) *RoleDefinitionsListPager { - return &RoleDefinitionsListPager{ +// If the operation fails it returns an *azcore.ResponseError type. +// vaultBaseURL - The vault name, for example https://myvault.vault.azure.net. +// scope - The scope of the role definition. +// options - RoleDefinitionsClientListOptions contains the optional parameters for the RoleDefinitionsClient.List method. +func (client *RoleDefinitionsClient) List(vaultBaseURL string, scope string, options *RoleDefinitionsClientListOptions) *RoleDefinitionsClientListPager { + return &RoleDefinitionsClientListPager{ client: client, requester: func(ctx context.Context) (*policy.Request, error) { return client.listCreateRequest(ctx, vaultBaseURL, scope, options) }, - advancer: func(ctx context.Context, resp RoleDefinitionsListResponse) (*policy.Request, error) { + advancer: func(ctx context.Context, resp RoleDefinitionsClientListResponse) (*policy.Request, error) { return runtime.NewRequest(ctx, http.MethodGet, *resp.RoleDefinitionListResult.NextLink) }, } } // listCreateRequest creates the List request. -func (client *RoleDefinitionsClient) listCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleDefinitionsListOptions) (*policy.Request, error) { +func (client *RoleDefinitionsClient) listCreateRequest(ctx context.Context, vaultBaseURL string, scope string, options *RoleDefinitionsClientListOptions) (*policy.Request, error) { host := "{vaultBaseUrl}" host = strings.ReplaceAll(host, "{vaultBaseUrl}", vaultBaseURL) urlPath := "/{scope}/providers/Microsoft.Authorization/roleDefinitions" - if scope == "" { - return nil, errors.New("parameter scope cannot be empty") - } urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(host, urlPath)) if err != nil { @@ -257,23 +231,10 @@ func (client *RoleDefinitionsClient) listCreateRequest(ctx context.Context, vaul } // listHandleResponse handles the List response. -func (client *RoleDefinitionsClient) listHandleResponse(resp *http.Response) (RoleDefinitionsListResponse, error) { - result := RoleDefinitionsListResponse{RawResponse: resp} +func (client *RoleDefinitionsClient) listHandleResponse(resp *http.Response) (RoleDefinitionsClientListResponse, error) { + result := RoleDefinitionsClientListResponse{RawResponse: resp} if err := runtime.UnmarshalAsJSON(resp, &result.RoleDefinitionListResult); err != nil { - return RoleDefinitionsListResponse{}, err + return RoleDefinitionsClientListResponse{}, err } return result, nil } - -// listHandleError handles the List error response. -func (client *RoleDefinitionsClient) listHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := KeyVaultError{raw: string(body)} - if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/keyvault/azsecrets/models.go b/sdk/keyvault/azsecrets/models.go index 9d308f75d666..5a1cf6e23de2 100644 --- a/sdk/keyvault/azsecrets/models.go +++ b/sdk/keyvault/azsecrets/models.go @@ -49,7 +49,7 @@ type Secret struct { Managed *bool `json:"managed,omitempty" azure:"ro"` } -func secretFromGenerated(i internal.SecretBundle) Secret { +func secretFromGenerated(i internal.DeletedSecretBundle) Secret { return Secret{ Attributes: secretAttributesFromGenerated(i.Attributes), ContentType: i.ContentType, @@ -91,13 +91,11 @@ func (s Attributes) toGenerated() *internal.SecretAttributes { return &internal.SecretAttributes{ RecoverableDays: s.RecoverableDays, RecoveryLevel: s.RecoveryLevel.toGenerated(), - Attributes: internal.Attributes{ - Enabled: s.Enabled, - Expires: s.Expires, - NotBefore: s.NotBefore, - Created: s.Created, - Updated: s.Updated, - }, + Enabled: s.Enabled, + Expires: s.Expires, + NotBefore: s.NotBefore, + Created: s.Created, + Updated: s.Updated, } } @@ -172,7 +170,13 @@ func deletedSecretItemFromGenerated(i *internal.DeletedSecretItem) DeletedSecret RecoveryID: i.RecoveryID, DeletedDate: i.DeletedDate, ScheduledPurgeDate: i.ScheduledPurgeDate, - Item: secretItemFromGenerated(&i.SecretItem), + Item: Item{ + Attributes: secretAttributesFromGenerated(i.Attributes), + ContentType: i.ContentType, + ID: i.ID, + Tags: convertPtrMap(i.Tags), + Managed: i.Managed, + }, } } From 591427ee4f6070e93ef09aa76e8ca865e51c8540 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Wed, 12 Jan 2022 13:33:37 +0800 Subject: [PATCH 35/36] chore: pump codegen version in scripts (#16802) --- eng/scripts/Invoke-MgmtTestgen.ps1 | 4 ++-- eng/scripts/build.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/scripts/Invoke-MgmtTestgen.ps1 b/eng/scripts/Invoke-MgmtTestgen.ps1 index 0559ad688281..a07c7100c8cc 100644 --- a/eng/scripts/Invoke-MgmtTestgen.ps1 +++ b/eng/scripts/Invoke-MgmtTestgen.ps1 @@ -11,8 +11,8 @@ param( [switch]$tidy, [string]$config = "autorest.md", [string]$autorestVersion = "3.6.2", - [string]$goExtension = "@autorest/go@4.0.0-preview.31", - [string]$testExtension = "@autorest/gotest@1.1.2", + [string]$goExtension = "@autorest/go@4.0.0-preview.35", + [string]$testExtension = "@autorest/gotest@1.2.0", [string]$outputFolder ) diff --git a/eng/scripts/build.ps1 b/eng/scripts/build.ps1 index eb94629e32c6..78e7dcbb45a7 100644 --- a/eng/scripts/build.ps1 +++ b/eng/scripts/build.ps1 @@ -9,7 +9,7 @@ param( [switch]$format, [switch]$tidy, [string]$config = "autorest.md", - [string]$goExtension = "@autorest/go@4.0.0-preview.31", + [string]$goExtension = "@autorest/go@4.0.0-preview.35", [string]$outputFolder ) From 473c542d38c9b1a15ef765ed39950da1ac783210 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 12 Jan 2022 07:39:37 -0800 Subject: [PATCH 36/36] Update azblob with the latest azcore (#16784) * Update azblob with the latest azcore This tactially resolves the small number of breaking changes in azcore. * clean-up --- sdk/storage/azblob/CHANGELOG.md | 3 +- sdk/storage/azblob/go.mod | 4 +- sdk/storage/azblob/go.sum | 8 +- sdk/storage/azblob/zc_blob_lease_client.go | 1 + sdk/storage/azblob/zc_block_blob_client.go | 3 +- .../azblob/zc_container_lease_client.go | 1 + sdk/storage/azblob/zc_page_blob_client.go | 5 +- sdk/storage/azblob/zc_storage_error.go | 40 +- sdk/storage/azblob/zt_blob_client_test.go | 9 +- sdk/storage/azblob/zt_service_client_test.go | 2 +- sdk/storage/azblob/zt_test.go | 13 +- .../azblob/zz_generated_appendblob_client.go | 66 +--- .../azblob/zz_generated_blob_client.go | 370 ++---------------- .../azblob/zz_generated_blockblob_client.go | 81 +--- sdk/storage/azblob/zz_generated_connection.go | 4 +- sdk/storage/azblob/zz_generated_constants.go | 2 +- .../azblob/zz_generated_container_client.go | 226 +---------- .../azblob/zz_generated_directory_client.go | 81 +--- sdk/storage/azblob/zz_generated_models.go | 11 - .../azblob/zz_generated_pageblob_client.go | 141 +------ sdk/storage/azblob/zz_generated_pagers.go | 11 +- .../azblob/zz_generated_service_client.go | 125 +----- 22 files changed, 154 insertions(+), 1053 deletions(-) diff --git a/sdk/storage/azblob/CHANGELOG.md b/sdk/storage/azblob/CHANGELOG.md index 7069dfa0ded7..0350465e8e7d 100644 --- a/sdk/storage/azblob/CHANGELOG.md +++ b/sdk/storage/azblob/CHANGELOG.md @@ -1,10 +1,11 @@ # Release History -## 0.2.1 (Unreleased) +## 0.3.0 (Unreleased) ### Features Added ### Breaking Changes +* Updated to latest `azcore`. Public surface area is unchanged. ### Bugs Fixed diff --git a/sdk/storage/azblob/go.mod b/sdk/storage/azblob/go.mod index d09ac398018e..ecdd614d6545 100644 --- a/sdk/storage/azblob/go.mod +++ b/sdk/storage/azblob/go.mod @@ -3,8 +3,8 @@ module github.com/Azure/azure-sdk-for-go/sdk/storage/azblob go 1.16 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 - github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnaeon/go-vcr v1.2.0 // indirect github.com/stretchr/testify v1.7.0 diff --git a/sdk/storage/azblob/go.sum b/sdk/storage/azblob/go.sum index 73a1581eb220..a1431da8ba3b 100644 --- a/sdk/storage/azblob/go.sum +++ b/sdk/storage/azblob/go.sum @@ -1,7 +1,7 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0 h1:KQgdWmEOmaJKxaUUZwHAYh12t+b+ZJf8q3friycK1kA= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.20.0/go.mod h1:ZPW/Z0kLCTdDZaDbYTetxc9Cxl/2lNqxYHYNOF2bti0= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1 h1:BUYIbDf/mMZ8945v3QkG3OuqGVyS4Iek0AOLwdRAYoc= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/sdk/storage/azblob/zc_blob_lease_client.go b/sdk/storage/azblob/zc_blob_lease_client.go index 4b07d4aadc99..c9ac3ae45ceb 100644 --- a/sdk/storage/azblob/zc_blob_lease_client.go +++ b/sdk/storage/azblob/zc_blob_lease_client.go @@ -6,6 +6,7 @@ package azblob import ( "context" "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" ) diff --git a/sdk/storage/azblob/zc_block_blob_client.go b/sdk/storage/azblob/zc_block_blob_client.go index 8bcdb964ab0f..2160e51c6653 100644 --- a/sdk/storage/azblob/zc_block_blob_client.go +++ b/sdk/storage/azblob/zc_block_blob_client.go @@ -5,10 +5,11 @@ package azblob import ( "context" + "io" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "io" ) const ( diff --git a/sdk/storage/azblob/zc_container_lease_client.go b/sdk/storage/azblob/zc_container_lease_client.go index db66b004d17f..716d5e84c978 100644 --- a/sdk/storage/azblob/zc_container_lease_client.go +++ b/sdk/storage/azblob/zc_container_lease_client.go @@ -6,6 +6,7 @@ package azblob import ( "context" "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" ) diff --git a/sdk/storage/azblob/zc_page_blob_client.go b/sdk/storage/azblob/zc_page_blob_client.go index 4ff0ea9618ba..db79f887f58c 100644 --- a/sdk/storage/azblob/zc_page_blob_client.go +++ b/sdk/storage/azblob/zc_page_blob_client.go @@ -5,10 +5,11 @@ package azblob import ( "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "io" "net/url" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) const ( diff --git a/sdk/storage/azblob/zc_storage_error.go b/sdk/storage/azblob/zc_storage_error.go index 329f680ed3c0..db6e1160ba19 100644 --- a/sdk/storage/azblob/zc_storage_error.go +++ b/sdk/storage/azblob/zc_storage_error.go @@ -12,7 +12,9 @@ import ( "sort" "strings" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) // InternalError is an internal error type that all errors get wrapped in. @@ -50,7 +52,6 @@ func (e *InternalError) As(target interface{}) bool { // TL;DR: This implements xml.Unmarshaler, and when the original StorageError is substituted, this unmarshaler kicks in. // This handles the description and details. defunkifyStorageError handles the response, cause, and service code. type StorageError struct { - raw string response *http.Response description string @@ -59,8 +60,9 @@ type StorageError struct { } func handleError(err error) error { - if err, ok := err.(ResponseError); ok { - return &InternalError{defunkifyStorageError(err)} + var respErr *azcore.ResponseError + if errors.As(err, &respErr) { + return &InternalError{responseErrorToStorageError(respErr)} } if err != nil { @@ -70,23 +72,31 @@ func handleError(err error) error { return nil } -// defunkifyStorageError is a function that takes the "funky" ResponseError and reduces it to a storageError. -func defunkifyStorageError(responseError ResponseError) error { - if err, ok := responseError.Unwrap().(*StorageError); ok { - // errors.Unwrap(responseError.Unwrap()) - - err.response = responseError.RawResponse() +// converts an *azcore.ResponseError to a *StorageError, or if that fails, a *InternalError +func responseErrorToStorageError(responseError *azcore.ResponseError) error { + var storageError StorageError + body, err := runtime.Payload(responseError.RawResponse) + if err != nil { + goto Default + } + if len(body) > 0 { + if err := xml.Unmarshal(body, &storageError); err != nil { + goto Default + } + } - err.ErrorCode = StorageErrorCode(responseError.RawResponse().Header.Get("x-ms-error-code")) + storageError.response = responseError.RawResponse - if code, ok := err.details["Code"]; ok { - err.ErrorCode = StorageErrorCode(code) - delete(err.details, "Code") - } + storageError.ErrorCode = StorageErrorCode(responseError.RawResponse.Header.Get("x-ms-error-code")) - return err + if code, ok := storageError.details["Code"]; ok { + storageError.ErrorCode = StorageErrorCode(code) + delete(storageError.details, "Code") } + return &storageError + +Default: return &InternalError{ cause: responseError, } diff --git a/sdk/storage/azblob/zt_blob_client_test.go b/sdk/storage/azblob/zt_blob_client_test.go index 6f38783193d0..945a4209f905 100644 --- a/sdk/storage/azblob/zt_blob_client_test.go +++ b/sdk/storage/azblob/zt_blob_client_test.go @@ -7,15 +7,16 @@ import ( "bytes" "crypto/md5" "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal" - "github.com/stretchr/testify/assert" "io" "io/ioutil" "net/url" "strconv" "strings" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal" + "github.com/stretchr/testify/assert" ) //nolint @@ -2099,7 +2100,7 @@ func validateBlobDeleted(_assert *assert.Assertions, bbClient BlobClient) { _assert.NotNil(err) var storageError *StorageError - _assert.Equal(errors.As(err, &storageError), true) + _assert.Equal(true, errors.As(err, &storageError)) _assert.Equal(storageError.ErrorCode, StorageErrorCodeBlobNotFound) } diff --git a/sdk/storage/azblob/zt_service_client_test.go b/sdk/storage/azblob/zt_service_client_test.go index 7bbd51693e12..f11f208b9307 100644 --- a/sdk/storage/azblob/zt_service_client_test.go +++ b/sdk/storage/azblob/zt_service_client_test.go @@ -5,10 +5,10 @@ package azblob import ( "context" + "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/stretchr/testify/assert" - "time" ) func (s *azblobTestSuite) TestGetAccountInfo() { diff --git a/sdk/storage/azblob/zt_test.go b/sdk/storage/azblob/zt_test.go index 37d42311017e..23d19e63a05e 100644 --- a/sdk/storage/azblob/zt_test.go +++ b/sdk/storage/azblob/zt_test.go @@ -10,11 +10,6 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - testframework "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/suite" "io" "io/ioutil" "log" @@ -26,7 +21,12 @@ import ( "testing" "time" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + testframework "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/suite" ) type azblobTestSuite struct { @@ -533,7 +533,8 @@ func blockIDIntToBase64(blockID int) string { func validateStorageError(_assert *assert.Assertions, err error, code StorageErrorCode) { _assert.NotNil(err) var storageError *StorageError - _assert.Equal(errors.As(err, &storageError), true) + // TOOD: this should really be require.Equal so that if it fails we don't try the next line which will panic + _assert.Equal(true, errors.As(err, &storageError)) _assert.Equal(storageError.ErrorCode, code) } diff --git a/sdk/storage/azblob/zz_generated_appendblob_client.go b/sdk/storage/azblob/zz_generated_appendblob_client.go index 1022998bde77..6a2b7ace5984 100644 --- a/sdk/storage/azblob/zz_generated_appendblob_client.go +++ b/sdk/storage/azblob/zz_generated_appendblob_client.go @@ -11,13 +11,13 @@ package azblob import ( "context" "encoding/base64" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "io" "net/http" "strconv" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) type appendBlobClient struct { @@ -38,7 +38,7 @@ func (client *appendBlobClient) AppendBlock(ctx context.Context, contentLength i return AppendBlobAppendBlockResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return AppendBlobAppendBlockResponse{}, client.appendBlockHandleError(resp) + return AppendBlobAppendBlockResponse{}, runtime.NewResponseError(resp) } return client.appendBlockHandleResponse(resp) } @@ -176,19 +176,6 @@ func (client *appendBlobClient) appendBlockHandleResponse(resp *http.Response) ( return result, nil } -// appendBlockHandleError handles the AppendBlock error response. -func (client *appendBlobClient) appendBlockHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // AppendBlockFromURL - The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a // source url. The Append Block operation is permitted only if the blob was // created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. @@ -203,7 +190,7 @@ func (client *appendBlobClient) AppendBlockFromURL(ctx context.Context, sourceUR return AppendBlobAppendBlockFromURLResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return AppendBlobAppendBlockFromURLResponse{}, client.appendBlockFromURLHandleError(resp) + return AppendBlobAppendBlockFromURLResponse{}, runtime.NewResponseError(resp) } return client.appendBlockFromURLHandleResponse(resp) } @@ -357,19 +344,6 @@ func (client *appendBlobClient) appendBlockFromURLHandleResponse(resp *http.Resp return result, nil } -// appendBlockFromURLHandleError handles the AppendBlockFromURL error response. -func (client *appendBlobClient) appendBlockFromURLHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Create - The Create Append Blob operation creates a new append blob. // If the operation fails it returns the *StorageError error type. func (client *appendBlobClient) Create(ctx context.Context, contentLength int64, appendBlobCreateOptions *AppendBlobCreateOptions, blobHTTPHeaders *BlobHTTPHeaders, leaseAccessConditions *LeaseAccessConditions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, modifiedAccessConditions *ModifiedAccessConditions) (AppendBlobCreateResponse, error) { @@ -382,7 +356,7 @@ func (client *appendBlobClient) Create(ctx context.Context, contentLength int64, return AppendBlobCreateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return AppendBlobCreateResponse{}, client.createHandleError(resp) + return AppendBlobCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) } @@ -519,19 +493,6 @@ func (client *appendBlobClient) createHandleResponse(resp *http.Response) (Appen return result, nil } -// createHandleError handles the Create error response. -func (client *appendBlobClient) createHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Seal - The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12 version or later. // If the operation fails it returns the *StorageError error type. func (client *appendBlobClient) Seal(ctx context.Context, appendBlobSealOptions *AppendBlobSealOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions, appendPositionAccessConditions *AppendPositionAccessConditions) (AppendBlobSealResponse, error) { @@ -544,7 +505,7 @@ func (client *appendBlobClient) Seal(ctx context.Context, appendBlobSealOptions return AppendBlobSealResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return AppendBlobSealResponse{}, client.sealHandleError(resp) + return AppendBlobSealResponse{}, runtime.NewResponseError(resp) } return client.sealHandleResponse(resp) } @@ -625,16 +586,3 @@ func (client *appendBlobClient) sealHandleResponse(resp *http.Response) (AppendB } return result, nil } - -// sealHandleError handles the Seal error response. -func (client *appendBlobClient) sealHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/storage/azblob/zz_generated_blob_client.go b/sdk/storage/azblob/zz_generated_blob_client.go index f5e3aa4539c9..05a273cb25ae 100644 --- a/sdk/storage/azblob/zz_generated_blob_client.go +++ b/sdk/storage/azblob/zz_generated_blob_client.go @@ -11,13 +11,13 @@ package azblob import ( "context" "encoding/base64" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "strconv" "strings" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) type blobClient struct { @@ -38,7 +38,7 @@ func (client *blobClient) AbortCopyFromURL(ctx context.Context, copyID string, b return BlobAbortCopyFromURLResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return BlobAbortCopyFromURLResponse{}, client.abortCopyFromURLHandleError(resp) + return BlobAbortCopyFromURLResponse{}, runtime.NewResponseError(resp) } return client.abortCopyFromURLHandleResponse(resp) } @@ -90,19 +90,6 @@ func (client *blobClient) abortCopyFromURLHandleResponse(resp *http.Response) (B return result, nil } -// abortCopyFromURLHandleError handles the AbortCopyFromURL error response. -func (client *blobClient) abortCopyFromURLHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // AcquireLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns the *StorageError error type. func (client *blobClient) AcquireLease(ctx context.Context, blobAcquireLeaseOptions *BlobAcquireLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobAcquireLeaseResponse, error) { @@ -115,7 +102,7 @@ func (client *blobClient) AcquireLease(ctx context.Context, blobAcquireLeaseOpti return BlobAcquireLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return BlobAcquireLeaseResponse{}, client.acquireLeaseHandleError(resp) + return BlobAcquireLeaseResponse{}, runtime.NewResponseError(resp) } return client.acquireLeaseHandleResponse(resp) } @@ -197,19 +184,6 @@ func (client *blobClient) acquireLeaseHandleResponse(resp *http.Response) (BlobA return result, nil } -// acquireLeaseHandleError handles the AcquireLease error response. -func (client *blobClient) acquireLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BreakLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns the *StorageError error type. func (client *blobClient) BreakLease(ctx context.Context, blobBreakLeaseOptions *BlobBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobBreakLeaseResponse, error) { @@ -222,7 +196,7 @@ func (client *blobClient) BreakLease(ctx context.Context, blobBreakLeaseOptions return BlobBreakLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return BlobBreakLeaseResponse{}, client.breakLeaseHandleError(resp) + return BlobBreakLeaseResponse{}, runtime.NewResponseError(resp) } return client.breakLeaseHandleResponse(resp) } @@ -306,19 +280,6 @@ func (client *blobClient) breakLeaseHandleResponse(resp *http.Response) (BlobBre return result, nil } -// breakLeaseHandleError handles the BreakLease error response. -func (client *blobClient) breakLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ChangeLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns the *StorageError error type. func (client *blobClient) ChangeLease(ctx context.Context, leaseID string, proposedLeaseID string, blobChangeLeaseOptions *BlobChangeLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobChangeLeaseResponse, error) { @@ -331,7 +292,7 @@ func (client *blobClient) ChangeLease(ctx context.Context, leaseID string, propo return BlobChangeLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobChangeLeaseResponse{}, client.changeLeaseHandleError(resp) + return BlobChangeLeaseResponse{}, runtime.NewResponseError(resp) } return client.changeLeaseHandleResponse(resp) } @@ -409,19 +370,6 @@ func (client *blobClient) changeLeaseHandleResponse(resp *http.Response) (BlobCh return result, nil } -// changeLeaseHandleError handles the ChangeLease error response. -func (client *blobClient) changeLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // CopyFromURL - The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete. // If the operation fails it returns the *StorageError error type. func (client *blobClient) CopyFromURL(ctx context.Context, copySource string, blobCopyFromURLOptions *BlobCopyFromURLOptions, sourceModifiedAccessConditions *SourceModifiedAccessConditions, modifiedAccessConditions *ModifiedAccessConditions, leaseAccessConditions *LeaseAccessConditions) (BlobCopyFromURLResponse, error) { @@ -434,7 +382,7 @@ func (client *blobClient) CopyFromURL(ctx context.Context, copySource string, bl return BlobCopyFromURLResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return BlobCopyFromURLResponse{}, client.copyFromURLHandleError(resp) + return BlobCopyFromURLResponse{}, runtime.NewResponseError(resp) } return client.copyFromURLHandleResponse(resp) } @@ -559,19 +507,6 @@ func (client *blobClient) copyFromURLHandleResponse(resp *http.Response) (BlobCo return result, nil } -// copyFromURLHandleError handles the CopyFromURL error response. -func (client *blobClient) copyFromURLHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // CreateSnapshot - The Create Snapshot operation creates a read-only snapshot of a blob // If the operation fails it returns the *StorageError error type. func (client *blobClient) CreateSnapshot(ctx context.Context, blobCreateSnapshotOptions *BlobCreateSnapshotOptions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, modifiedAccessConditions *ModifiedAccessConditions, leaseAccessConditions *LeaseAccessConditions) (BlobCreateSnapshotResponse, error) { @@ -584,7 +519,7 @@ func (client *blobClient) CreateSnapshot(ctx context.Context, blobCreateSnapshot return BlobCreateSnapshotResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return BlobCreateSnapshotResponse{}, client.createSnapshotHandleError(resp) + return BlobCreateSnapshotResponse{}, runtime.NewResponseError(resp) } return client.createSnapshotHandleResponse(resp) } @@ -689,19 +624,6 @@ func (client *blobClient) createSnapshotHandleResponse(resp *http.Response) (Blo return result, nil } -// createSnapshotHandleError handles the CreateSnapshot error response. -func (client *blobClient) createSnapshotHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If // the storage account's soft delete feature is enabled, // then, when a blob is deleted, it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot @@ -724,7 +646,7 @@ func (client *blobClient) Delete(ctx context.Context, blobDeleteOptions *BlobDel return BlobDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return BlobDeleteResponse{}, client.deleteHandleError(resp) + return BlobDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } @@ -797,19 +719,6 @@ func (client *blobClient) deleteHandleResponse(resp *http.Response) (BlobDeleteR return result, nil } -// deleteHandleError handles the Delete error response. -func (client *blobClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Download - The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read // a snapshot. // If the operation fails it returns the *StorageError error type. @@ -823,7 +732,7 @@ func (client *blobClient) Download(ctx context.Context, blobDownloadOptions *Blo return BlobDownloadResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusPartialContent) { - return BlobDownloadResponse{}, client.downloadHandleError(resp) + return BlobDownloadResponse{}, runtime.NewResponseError(resp) } return client.downloadHandleResponse(resp) } @@ -845,7 +754,7 @@ func (client *blobClient) downloadCreateRequest(ctx context.Context, blobDownloa reqQP.Set("timeout", strconv.FormatInt(int64(*blobDownloadOptions.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.SkipBodyDownload() + runtime.SkipBodyDownload(req) if blobDownloadOptions != nil && blobDownloadOptions.Range != nil { req.Raw().Header.Set("x-ms-range", *blobDownloadOptions.Range) } @@ -1076,19 +985,6 @@ func (client *blobClient) downloadHandleResponse(resp *http.Response) (BlobDownl return result, nil } -// downloadHandleError handles the Download error response. -func (client *blobClient) downloadHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetAccessControl - Get the owner, group, permissions, or access control list for a blob. // If the operation fails it returns the *DataLakeStorageError error type. func (client *blobClient) GetAccessControl(ctx context.Context, blobGetAccessControlOptions *BlobGetAccessControlOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (BlobGetAccessControlResponse, error) { @@ -1101,7 +997,7 @@ func (client *blobClient) GetAccessControl(ctx context.Context, blobGetAccessCon return BlobGetAccessControlResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobGetAccessControlResponse{}, client.getAccessControlHandleError(resp) + return BlobGetAccessControlResponse{}, runtime.NewResponseError(resp) } return client.getAccessControlHandleResponse(resp) } @@ -1185,19 +1081,6 @@ func (client *blobClient) getAccessControlHandleResponse(resp *http.Response) (B return result, nil } -// getAccessControlHandleError handles the GetAccessControl error response. -func (client *blobClient) getAccessControlHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns the *StorageError error type. func (client *blobClient) GetAccountInfo(ctx context.Context, options *BlobGetAccountInfoOptions) (BlobGetAccountInfoResponse, error) { @@ -1210,7 +1093,7 @@ func (client *blobClient) GetAccountInfo(ctx context.Context, options *BlobGetAc return BlobGetAccountInfoResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobGetAccountInfoResponse{}, client.getAccountInfoHandleError(resp) + return BlobGetAccountInfoResponse{}, runtime.NewResponseError(resp) } return client.getAccountInfoHandleResponse(resp) } @@ -1258,19 +1141,6 @@ func (client *blobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo return result, nil } -// getAccountInfoHandleError handles the GetAccountInfo error response. -func (client *blobClient) getAccountInfoHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetProperties - The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does // not return the content of the blob. // If the operation fails it returns the *StorageError error type. @@ -1284,7 +1154,7 @@ func (client *blobClient) GetProperties(ctx context.Context, blobGetPropertiesOp return BlobGetPropertiesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobGetPropertiesResponse{}, client.getPropertiesHandleError(resp) + return BlobGetPropertiesResponse{}, runtime.NewResponseError(resp) } return client.getPropertiesHandleResponse(resp) } @@ -1557,19 +1427,6 @@ func (client *blobClient) getPropertiesHandleResponse(resp *http.Response) (Blob return result, nil } -// getPropertiesHandleError handles the GetProperties error response. -func (client *blobClient) getPropertiesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetTags - The Get Tags operation enables users to get the tags associated with a blob. // If the operation fails it returns the *StorageError error type. func (client *blobClient) GetTags(ctx context.Context, blobGetTagsOptions *BlobGetTagsOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobGetTagsResponse, error) { @@ -1582,7 +1439,7 @@ func (client *blobClient) GetTags(ctx context.Context, blobGetTagsOptions *BlobG return BlobGetTagsResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobGetTagsResponse{}, client.getTagsHandleError(resp) + return BlobGetTagsResponse{}, runtime.NewResponseError(resp) } return client.getTagsHandleResponse(resp) } @@ -1641,19 +1498,6 @@ func (client *blobClient) getTagsHandleResponse(resp *http.Response) (BlobGetTag return result, nil } -// getTagsHandleError handles the GetTags error response. -func (client *blobClient) getTagsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Query - The Query operation enables users to select/project on blob data by providing simple query expressions. // If the operation fails it returns the *StorageError error type. func (client *blobClient) Query(ctx context.Context, blobQueryOptions *BlobQueryOptions, leaseAccessConditions *LeaseAccessConditions, cpkInfo *CpkInfo, modifiedAccessConditions *ModifiedAccessConditions) (BlobQueryResponse, error) { @@ -1666,7 +1510,7 @@ func (client *blobClient) Query(ctx context.Context, blobQueryOptions *BlobQuery return BlobQueryResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusPartialContent) { - return BlobQueryResponse{}, client.queryHandleError(resp) + return BlobQueryResponse{}, runtime.NewResponseError(resp) } return client.queryHandleResponse(resp) } @@ -1686,7 +1530,7 @@ func (client *blobClient) queryCreateRequest(ctx context.Context, blobQueryOptio reqQP.Set("timeout", strconv.FormatInt(int64(*blobQueryOptions.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.SkipBodyDownload() + runtime.SkipBodyDownload(req) if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header.Set("x-ms-lease-id", *leaseAccessConditions.LeaseID) } @@ -1876,19 +1720,6 @@ func (client *blobClient) queryHandleResponse(resp *http.Response) (BlobQueryRes return result, nil } -// queryHandleError handles the Query error response. -func (client *blobClient) queryHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ReleaseLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns the *StorageError error type. func (client *blobClient) ReleaseLease(ctx context.Context, leaseID string, blobReleaseLeaseOptions *BlobReleaseLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobReleaseLeaseResponse, error) { @@ -1901,7 +1732,7 @@ func (client *blobClient) ReleaseLease(ctx context.Context, leaseID string, blob return BlobReleaseLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobReleaseLeaseResponse{}, client.releaseLeaseHandleError(resp) + return BlobReleaseLeaseResponse{}, runtime.NewResponseError(resp) } return client.releaseLeaseHandleResponse(resp) } @@ -1975,19 +1806,6 @@ func (client *blobClient) releaseLeaseHandleResponse(resp *http.Response) (BlobR return result, nil } -// releaseLeaseHandleError handles the ReleaseLease error response. -func (client *blobClient) releaseLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Rename - Rename a blob/file. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This // operation supports conditional HTTP requests. For more // information, see Specifying Conditional Headers for Blob Service Operations [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. @@ -2004,7 +1822,7 @@ func (client *blobClient) Rename(ctx context.Context, renameSource string, blobR return BlobRenameResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return BlobRenameResponse{}, client.renameHandleError(resp) + return BlobRenameResponse{}, runtime.NewResponseError(resp) } return client.renameHandleResponse(resp) } @@ -2125,19 +1943,6 @@ func (client *blobClient) renameHandleResponse(resp *http.Response) (BlobRenameR return result, nil } -// renameHandleError handles the Rename error response. -func (client *blobClient) renameHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // RenewLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns the *StorageError error type. func (client *blobClient) RenewLease(ctx context.Context, leaseID string, blobRenewLeaseOptions *BlobRenewLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobRenewLeaseResponse, error) { @@ -2150,7 +1955,7 @@ func (client *blobClient) RenewLease(ctx context.Context, leaseID string, blobRe return BlobRenewLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobRenewLeaseResponse{}, client.renewLeaseHandleError(resp) + return BlobRenewLeaseResponse{}, runtime.NewResponseError(resp) } return client.renewLeaseHandleResponse(resp) } @@ -2227,19 +2032,6 @@ func (client *blobClient) renewLeaseHandleResponse(resp *http.Response) (BlobRen return result, nil } -// renewLeaseHandleError handles the RenewLease error response. -func (client *blobClient) renewLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetAccessControl - Set the owner, group, permissions, or access control list for a blob. // If the operation fails it returns the *DataLakeStorageError error type. func (client *blobClient) SetAccessControl(ctx context.Context, blobSetAccessControlOptions *BlobSetAccessControlOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (BlobSetAccessControlResponse, error) { @@ -2252,7 +2044,7 @@ func (client *blobClient) SetAccessControl(ctx context.Context, blobSetAccessCon return BlobSetAccessControlResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobSetAccessControlResponse{}, client.setAccessControlHandleError(resp) + return BlobSetAccessControlResponse{}, runtime.NewResponseError(resp) } return client.setAccessControlHandleResponse(resp) } @@ -2333,19 +2125,6 @@ func (client *blobClient) setAccessControlHandleResponse(resp *http.Response) (B return result, nil } -// setAccessControlHandleError handles the SetAccessControl error response. -func (client *blobClient) setAccessControlHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetExpiry - Sets the time a blob will expire and be deleted. // If the operation fails it returns the *StorageError error type. func (client *blobClient) SetExpiry(ctx context.Context, expiryOptions BlobExpiryOptions, options *BlobSetExpiryOptions) (BlobSetExpiryResponse, error) { @@ -2358,7 +2137,7 @@ func (client *blobClient) SetExpiry(ctx context.Context, expiryOptions BlobExpir return BlobSetExpiryResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobSetExpiryResponse{}, client.setExpiryHandleError(resp) + return BlobSetExpiryResponse{}, runtime.NewResponseError(resp) } return client.setExpiryHandleResponse(resp) } @@ -2419,19 +2198,6 @@ func (client *blobClient) setExpiryHandleResponse(resp *http.Response) (BlobSetE return result, nil } -// setExpiryHandleError handles the SetExpiry error response. -func (client *blobClient) setExpiryHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetHTTPHeaders - The Set HTTP Headers operation sets system properties on the blob // If the operation fails it returns the *StorageError error type. func (client *blobClient) SetHTTPHeaders(ctx context.Context, blobSetHTTPHeadersOptions *BlobSetHTTPHeadersOptions, blobHTTPHeaders *BlobHTTPHeaders, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (BlobSetHTTPHeadersResponse, error) { @@ -2444,7 +2210,7 @@ func (client *blobClient) SetHTTPHeaders(ctx context.Context, blobSetHTTPHeaders return BlobSetHTTPHeadersResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobSetHTTPHeadersResponse{}, client.setHTTPHeadersHandleError(resp) + return BlobSetHTTPHeadersResponse{}, runtime.NewResponseError(resp) } return client.setHTTPHeadersHandleResponse(resp) } @@ -2544,19 +2310,6 @@ func (client *blobClient) setHTTPHeadersHandleResponse(resp *http.Response) (Blo return result, nil } -// setHTTPHeadersHandleError handles the SetHTTPHeaders error response. -func (client *blobClient) setHTTPHeadersHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetMetadata - The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs // If the operation fails it returns the *StorageError error type. func (client *blobClient) SetMetadata(ctx context.Context, blobSetMetadataOptions *BlobSetMetadataOptions, leaseAccessConditions *LeaseAccessConditions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, modifiedAccessConditions *ModifiedAccessConditions) (BlobSetMetadataResponse, error) { @@ -2569,7 +2322,7 @@ func (client *blobClient) SetMetadata(ctx context.Context, blobSetMetadataOption return BlobSetMetadataResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobSetMetadataResponse{}, client.setMetadataHandleError(resp) + return BlobSetMetadataResponse{}, runtime.NewResponseError(resp) } return client.setMetadataHandleResponse(resp) } @@ -2677,19 +2430,6 @@ func (client *blobClient) setMetadataHandleResponse(resp *http.Response) (BlobSe return result, nil } -// setMetadataHandleError handles the SetMetadata error response. -func (client *blobClient) setMetadataHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetTags - The Set Tags operation enables users to set tags on a blob. // If the operation fails it returns the *StorageError error type. func (client *blobClient) SetTags(ctx context.Context, blobSetTagsOptions *BlobSetTagsOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobSetTagsResponse, error) { @@ -2702,7 +2442,7 @@ func (client *blobClient) SetTags(ctx context.Context, blobSetTagsOptions *BlobS return BlobSetTagsResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return BlobSetTagsResponse{}, client.setTagsHandleError(resp) + return BlobSetTagsResponse{}, runtime.NewResponseError(resp) } return client.setTagsHandleResponse(resp) } @@ -2764,19 +2504,6 @@ func (client *blobClient) setTagsHandleResponse(resp *http.Response) (BlobSetTag return result, nil } -// setTagsHandleError handles the SetTags error response. -func (client *blobClient) setTagsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetTier - The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in // a blob storage account (locally redundant storage only). A // premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. @@ -2792,7 +2519,7 @@ func (client *blobClient) SetTier(ctx context.Context, tier AccessTier, blobSetT return BlobSetTierResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return BlobSetTierResponse{}, client.setTierHandleError(resp) + return BlobSetTierResponse{}, runtime.NewResponseError(resp) } return client.setTierHandleResponse(resp) } @@ -2848,19 +2575,6 @@ func (client *blobClient) setTierHandleResponse(resp *http.Response) (BlobSetTie return result, nil } -// setTierHandleError handles the SetTier error response. -func (client *blobClient) setTierHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // StartCopyFromURL - The Start Copy From URL operation copies a blob or an internet resource to a new blob. // If the operation fails it returns the *StorageError error type. func (client *blobClient) StartCopyFromURL(ctx context.Context, copySource string, blobStartCopyFromURLOptions *BlobStartCopyFromURLOptions, sourceModifiedAccessConditions *SourceModifiedAccessConditions, modifiedAccessConditions *ModifiedAccessConditions, leaseAccessConditions *LeaseAccessConditions) (BlobStartCopyFromURLResponse, error) { @@ -2873,7 +2587,7 @@ func (client *blobClient) StartCopyFromURL(ctx context.Context, copySource strin return BlobStartCopyFromURLResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return BlobStartCopyFromURLResponse{}, client.startCopyFromURLHandleError(resp) + return BlobStartCopyFromURLResponse{}, runtime.NewResponseError(resp) } return client.startCopyFromURLHandleResponse(resp) } @@ -2989,19 +2703,6 @@ func (client *blobClient) startCopyFromURLHandleResponse(resp *http.Response) (B return result, nil } -// startCopyFromURLHandleError handles the StartCopyFromURL error response. -func (client *blobClient) startCopyFromURLHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Undelete - Undelete a blob that was previously soft deleted // If the operation fails it returns the *StorageError error type. func (client *blobClient) Undelete(ctx context.Context, options *BlobUndeleteOptions) (BlobUndeleteResponse, error) { @@ -3014,7 +2715,7 @@ func (client *blobClient) Undelete(ctx context.Context, options *BlobUndeleteOpt return BlobUndeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlobUndeleteResponse{}, client.undeleteHandleError(resp) + return BlobUndeleteResponse{}, runtime.NewResponseError(resp) } return client.undeleteHandleResponse(resp) } @@ -3060,16 +2761,3 @@ func (client *blobClient) undeleteHandleResponse(resp *http.Response) (BlobUndel } return result, nil } - -// undeleteHandleError handles the Undelete error response. -func (client *blobClient) undeleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/storage/azblob/zz_generated_blockblob_client.go b/sdk/storage/azblob/zz_generated_blockblob_client.go index 07619ac3a12b..c1d93782a261 100644 --- a/sdk/storage/azblob/zz_generated_blockblob_client.go +++ b/sdk/storage/azblob/zz_generated_blockblob_client.go @@ -11,13 +11,13 @@ package azblob import ( "context" "encoding/base64" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "io" "net/http" "strconv" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) type blockBlobClient struct { @@ -42,7 +42,7 @@ func (client *blockBlobClient) CommitBlockList(ctx context.Context, blocks Block return BlockBlobCommitBlockListResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return BlockBlobCommitBlockListResponse{}, client.commitBlockListHandleError(resp) + return BlockBlobCommitBlockListResponse{}, runtime.NewResponseError(resp) } return client.commitBlockListHandleResponse(resp) } @@ -194,19 +194,6 @@ func (client *blockBlobClient) commitBlockListHandleResponse(resp *http.Response return result, nil } -// commitBlockListHandleError handles the CommitBlockList error response. -func (client *blockBlobClient) commitBlockListHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetBlockList - The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob // If the operation fails it returns the *StorageError error type. func (client *blockBlobClient) GetBlockList(ctx context.Context, listType BlockListType, blockBlobGetBlockListOptions *BlockBlobGetBlockListOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (BlockBlobGetBlockListResponse, error) { @@ -219,7 +206,7 @@ func (client *blockBlobClient) GetBlockList(ctx context.Context, listType BlockL return BlockBlobGetBlockListResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return BlockBlobGetBlockListResponse{}, client.getBlockListHandleError(resp) + return BlockBlobGetBlockListResponse{}, runtime.NewResponseError(resp) } return client.getBlockListHandleResponse(resp) } @@ -299,19 +286,6 @@ func (client *blockBlobClient) getBlockListHandleResponse(resp *http.Response) ( return result, nil } -// getBlockListHandleError handles the GetBlockList error response. -func (client *blockBlobClient) getBlockListHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // StageBlock - The Stage Block operation creates a new block to be committed as part of a blob // If the operation fails it returns the *StorageError error type. func (client *blockBlobClient) StageBlock(ctx context.Context, blockID string, contentLength int64, body io.ReadSeekCloser, blockBlobStageBlockOptions *BlockBlobStageBlockOptions, leaseAccessConditions *LeaseAccessConditions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo) (BlockBlobStageBlockResponse, error) { @@ -324,7 +298,7 @@ func (client *blockBlobClient) StageBlock(ctx context.Context, blockID string, c return BlockBlobStageBlockResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return BlockBlobStageBlockResponse{}, client.stageBlockHandleError(resp) + return BlockBlobStageBlockResponse{}, runtime.NewResponseError(resp) } return client.stageBlockHandleResponse(resp) } @@ -421,19 +395,6 @@ func (client *blockBlobClient) stageBlockHandleResponse(resp *http.Response) (Bl return result, nil } -// stageBlockHandleError handles the StageBlock error response. -func (client *blockBlobClient) stageBlockHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // StageBlockFromURL - The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL. // If the operation fails it returns the *StorageError error type. func (client *blockBlobClient) StageBlockFromURL(ctx context.Context, blockID string, contentLength int64, sourceURL string, blockBlobStageBlockFromURLOptions *BlockBlobStageBlockFromURLOptions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, leaseAccessConditions *LeaseAccessConditions, sourceModifiedAccessConditions *SourceModifiedAccessConditions) (BlockBlobStageBlockFromURLResponse, error) { @@ -446,7 +407,7 @@ func (client *blockBlobClient) StageBlockFromURL(ctx context.Context, blockID st return BlockBlobStageBlockFromURLResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return BlockBlobStageBlockFromURLResponse{}, client.stageBlockFromURLHandleError(resp) + return BlockBlobStageBlockFromURLResponse{}, runtime.NewResponseError(resp) } return client.stageBlockFromURLHandleResponse(resp) } @@ -559,19 +520,6 @@ func (client *blockBlobClient) stageBlockFromURLHandleResponse(resp *http.Respon return result, nil } -// stageBlockFromURLHandleError handles the StageBlockFromURL error response. -func (client *blockBlobClient) stageBlockFromURLHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Upload - The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata // on the blob. Partial updates are not supported with Put // Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use @@ -587,7 +535,7 @@ func (client *blockBlobClient) Upload(ctx context.Context, contentLength int64, return BlockBlobUploadResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return BlockBlobUploadResponse{}, client.uploadHandleError(resp) + return BlockBlobUploadResponse{}, runtime.NewResponseError(resp) } return client.uploadHandleResponse(resp) } @@ -729,16 +677,3 @@ func (client *blockBlobClient) uploadHandleResponse(resp *http.Response) (BlockB } return result, nil } - -// uploadHandleError handles the Upload error response. -func (client *blockBlobClient) uploadHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/storage/azblob/zz_generated_connection.go b/sdk/storage/azblob/zz_generated_connection.go index 2335bf2c9c74..aa11dd8d7c78 100644 --- a/sdk/storage/azblob/zz_generated_connection.go +++ b/sdk/storage/azblob/zz_generated_connection.go @@ -49,7 +49,9 @@ func newConnection(endpoint string, authPolicy policy.Policy, options *azcore.Cl if authPolicy != nil { perRetryPolicies = append(perRetryPolicies, authPolicy) } - return &connection{u: endpoint, p: runtime.NewPipeline(module, version, nil, perRetryPolicies, &cp)} + return &connection{u: endpoint, p: runtime.NewPipeline(module, version, runtime.PipelineOptions{ + PerRetry: perRetryPolicies, + }, &cp)} } // Endpoint returns the connection's endpoint. diff --git a/sdk/storage/azblob/zz_generated_constants.go b/sdk/storage/azblob/zz_generated_constants.go index fec9b1790480..e8bacdcc71c0 100644 --- a/sdk/storage/azblob/zz_generated_constants.go +++ b/sdk/storage/azblob/zz_generated_constants.go @@ -10,7 +10,7 @@ package azblob const ( module = "azblob" - version = "v0.2.1" + version = "v0.3.0" ) type AccessTier string diff --git a/sdk/storage/azblob/zz_generated_container_client.go b/sdk/storage/azblob/zz_generated_container_client.go index 3458ae3d417d..81295fe7d61e 100644 --- a/sdk/storage/azblob/zz_generated_container_client.go +++ b/sdk/storage/azblob/zz_generated_container_client.go @@ -12,12 +12,13 @@ import ( "context" "encoding/xml" "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "strconv" "strings" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) type containerClient struct { @@ -36,7 +37,7 @@ func (client *containerClient) AcquireLease(ctx context.Context, containerAcquir return ContainerAcquireLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return ContainerAcquireLeaseResponse{}, client.acquireLeaseHandleError(resp) + return ContainerAcquireLeaseResponse{}, runtime.NewResponseError(resp) } return client.acquireLeaseHandleResponse(resp) } @@ -110,19 +111,6 @@ func (client *containerClient) acquireLeaseHandleResponse(resp *http.Response) ( return result, nil } -// acquireLeaseHandleError handles the AcquireLease error response. -func (client *containerClient) acquireLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // BreakLease - [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite // If the operation fails it returns the *StorageError error type. func (client *containerClient) BreakLease(ctx context.Context, containerBreakLeaseOptions *ContainerBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerBreakLeaseResponse, error) { @@ -135,7 +123,7 @@ func (client *containerClient) BreakLease(ctx context.Context, containerBreakLea return ContainerBreakLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ContainerBreakLeaseResponse{}, client.breakLeaseHandleError(resp) + return ContainerBreakLeaseResponse{}, runtime.NewResponseError(resp) } return client.breakLeaseHandleResponse(resp) } @@ -211,19 +199,6 @@ func (client *containerClient) breakLeaseHandleResponse(resp *http.Response) (Co return result, nil } -// breakLeaseHandleError handles the BreakLease error response. -func (client *containerClient) breakLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ChangeLease - [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite // If the operation fails it returns the *StorageError error type. func (client *containerClient) ChangeLease(ctx context.Context, leaseID string, proposedLeaseID string, containerChangeLeaseOptions *ContainerChangeLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerChangeLeaseResponse, error) { @@ -236,7 +211,7 @@ func (client *containerClient) ChangeLease(ctx context.Context, leaseID string, return ContainerChangeLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerChangeLeaseResponse{}, client.changeLeaseHandleError(resp) + return ContainerChangeLeaseResponse{}, runtime.NewResponseError(resp) } return client.changeLeaseHandleResponse(resp) } @@ -306,19 +281,6 @@ func (client *containerClient) changeLeaseHandleResponse(resp *http.Response) (C return result, nil } -// changeLeaseHandleError handles the ChangeLease error response. -func (client *containerClient) changeLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Create - creates a new container under the specified account. If the container with the same name already exists, the operation fails // If the operation fails it returns the *StorageError error type. func (client *containerClient) Create(ctx context.Context, containerCreateOptions *ContainerCreateOptions, containerCpkScopeInfo *ContainerCpkScopeInfo) (ContainerCreateResponse, error) { @@ -331,7 +293,7 @@ func (client *containerClient) Create(ctx context.Context, containerCreateOption return ContainerCreateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return ContainerCreateResponse{}, client.createHandleError(resp) + return ContainerCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) } @@ -402,19 +364,6 @@ func (client *containerClient) createHandleResponse(resp *http.Response) (Contai return result, nil } -// createHandleError handles the Create error response. -func (client *containerClient) createHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection // If the operation fails it returns the *StorageError error type. func (client *containerClient) Delete(ctx context.Context, containerDeleteOptions *ContainerDeleteOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerDeleteResponse, error) { @@ -427,7 +376,7 @@ func (client *containerClient) Delete(ctx context.Context, containerDeleteOption return ContainerDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ContainerDeleteResponse{}, client.deleteHandleError(resp) + return ContainerDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } @@ -483,19 +432,6 @@ func (client *containerClient) deleteHandleResponse(resp *http.Response) (Contai return result, nil } -// deleteHandleError handles the Delete error response. -func (client *containerClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetAccessPolicy - gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly. // If the operation fails it returns the *StorageError error type. func (client *containerClient) GetAccessPolicy(ctx context.Context, containerGetAccessPolicyOptions *ContainerGetAccessPolicyOptions, leaseAccessConditions *LeaseAccessConditions) (ContainerGetAccessPolicyResponse, error) { @@ -508,7 +444,7 @@ func (client *containerClient) GetAccessPolicy(ctx context.Context, containerGet return ContainerGetAccessPolicyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerGetAccessPolicyResponse{}, client.getAccessPolicyHandleError(resp) + return ContainerGetAccessPolicyResponse{}, runtime.NewResponseError(resp) } return client.getAccessPolicyHandleResponse(resp) } @@ -575,19 +511,6 @@ func (client *containerClient) getAccessPolicyHandleResponse(resp *http.Response return result, nil } -// getAccessPolicyHandleError handles the GetAccessPolicy error response. -func (client *containerClient) getAccessPolicyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns the *StorageError error type. func (client *containerClient) GetAccountInfo(ctx context.Context, options *ContainerGetAccountInfoOptions) (ContainerGetAccountInfoResponse, error) { @@ -600,7 +523,7 @@ func (client *containerClient) GetAccountInfo(ctx context.Context, options *Cont return ContainerGetAccountInfoResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerGetAccountInfoResponse{}, client.getAccountInfoHandleError(resp) + return ContainerGetAccountInfoResponse{}, runtime.NewResponseError(resp) } return client.getAccountInfoHandleResponse(resp) } @@ -648,19 +571,6 @@ func (client *containerClient) getAccountInfoHandleResponse(resp *http.Response) return result, nil } -// getAccountInfoHandleError handles the GetAccountInfo error response. -func (client *containerClient) getAccountInfoHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetProperties - returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's // list of blobs // If the operation fails it returns the *StorageError error type. @@ -674,7 +584,7 @@ func (client *containerClient) GetProperties(ctx context.Context, containerGetPr return ContainerGetPropertiesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerGetPropertiesResponse{}, client.getPropertiesHandleError(resp) + return ContainerGetPropertiesResponse{}, runtime.NewResponseError(resp) } return client.getPropertiesHandleResponse(resp) } @@ -778,19 +688,6 @@ func (client *containerClient) getPropertiesHandleResponse(resp *http.Response) return result, nil } -// getPropertiesHandleError handles the GetProperties error response. -func (client *containerClient) getPropertiesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListBlobFlatSegment - [Update] The List Blobs operation returns a list of the blobs under the specified container // If the operation fails it returns the *StorageError error type. func (client *containerClient) ListBlobFlatSegment(options *ContainerListBlobFlatSegmentOptions) *ContainerListBlobFlatSegmentPager { @@ -866,19 +763,6 @@ func (client *containerClient) listBlobFlatSegmentHandleResponse(resp *http.Resp return result, nil } -// listBlobFlatSegmentHandleError handles the ListBlobFlatSegment error response. -func (client *containerClient) listBlobFlatSegmentHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListBlobHierarchySegment - [Update] The List Blobs operation returns a list of the blobs under the specified container // If the operation fails it returns the *StorageError error type. func (client *containerClient) ListBlobHierarchySegment(delimiter string, options *ContainerListBlobHierarchySegmentOptions) *ContainerListBlobHierarchySegmentPager { @@ -955,19 +839,6 @@ func (client *containerClient) listBlobHierarchySegmentHandleResponse(resp *http return result, nil } -// listBlobHierarchySegmentHandleError handles the ListBlobHierarchySegment error response. -func (client *containerClient) listBlobHierarchySegmentHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ReleaseLease - [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite // If the operation fails it returns the *StorageError error type. func (client *containerClient) ReleaseLease(ctx context.Context, leaseID string, containerReleaseLeaseOptions *ContainerReleaseLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerReleaseLeaseResponse, error) { @@ -980,7 +851,7 @@ func (client *containerClient) ReleaseLease(ctx context.Context, leaseID string, return ContainerReleaseLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerReleaseLeaseResponse{}, client.releaseLeaseHandleError(resp) + return ContainerReleaseLeaseResponse{}, runtime.NewResponseError(resp) } return client.releaseLeaseHandleResponse(resp) } @@ -1046,19 +917,6 @@ func (client *containerClient) releaseLeaseHandleResponse(resp *http.Response) ( return result, nil } -// releaseLeaseHandleError handles the ReleaseLease error response. -func (client *containerClient) releaseLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // RenewLease - [Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite // If the operation fails it returns the *StorageError error type. func (client *containerClient) RenewLease(ctx context.Context, leaseID string, containerRenewLeaseOptions *ContainerRenewLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerRenewLeaseResponse, error) { @@ -1071,7 +929,7 @@ func (client *containerClient) RenewLease(ctx context.Context, leaseID string, c return ContainerRenewLeaseResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerRenewLeaseResponse{}, client.renewLeaseHandleError(resp) + return ContainerRenewLeaseResponse{}, runtime.NewResponseError(resp) } return client.renewLeaseHandleResponse(resp) } @@ -1140,19 +998,6 @@ func (client *containerClient) renewLeaseHandleResponse(resp *http.Response) (Co return result, nil } -// renewLeaseHandleError handles the RenewLease error response. -func (client *containerClient) renewLeaseHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Restore - Restores a previously-deleted container. // If the operation fails it returns the *StorageError error type. func (client *containerClient) Restore(ctx context.Context, options *ContainerRestoreOptions) (ContainerRestoreResponse, error) { @@ -1165,7 +1010,7 @@ func (client *containerClient) Restore(ctx context.Context, options *ContainerRe return ContainerRestoreResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return ContainerRestoreResponse{}, client.restoreHandleError(resp) + return ContainerRestoreResponse{}, runtime.NewResponseError(resp) } return client.restoreHandleResponse(resp) } @@ -1219,19 +1064,6 @@ func (client *containerClient) restoreHandleResponse(resp *http.Response) (Conta return result, nil } -// restoreHandleError handles the Restore error response. -func (client *containerClient) restoreHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetAccessPolicy - sets the permissions for the specified container. The permissions indicate whether blobs in a container may be accessed publicly. // If the operation fails it returns the *StorageError error type. func (client *containerClient) SetAccessPolicy(ctx context.Context, containerSetAccessPolicyOptions *ContainerSetAccessPolicyOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerSetAccessPolicyResponse, error) { @@ -1244,7 +1076,7 @@ func (client *containerClient) SetAccessPolicy(ctx context.Context, containerSet return ContainerSetAccessPolicyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerSetAccessPolicyResponse{}, client.setAccessPolicyHandleError(resp) + return ContainerSetAccessPolicyResponse{}, runtime.NewResponseError(resp) } return client.setAccessPolicyHandleResponse(resp) } @@ -1321,19 +1153,6 @@ func (client *containerClient) setAccessPolicyHandleResponse(resp *http.Response return result, nil } -// setAccessPolicyHandleError handles the SetAccessPolicy error response. -func (client *containerClient) setAccessPolicyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetMetadata - operation sets one or more user-defined name-value pairs for the specified container. // If the operation fails it returns the *StorageError error type. func (client *containerClient) SetMetadata(ctx context.Context, containerSetMetadataOptions *ContainerSetMetadataOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerSetMetadataResponse, error) { @@ -1346,7 +1165,7 @@ func (client *containerClient) SetMetadata(ctx context.Context, containerSetMeta return ContainerSetMetadataResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContainerSetMetadataResponse{}, client.setMetadataHandleError(resp) + return ContainerSetMetadataResponse{}, runtime.NewResponseError(resp) } return client.setMetadataHandleResponse(resp) } @@ -1414,16 +1233,3 @@ func (client *containerClient) setMetadataHandleResponse(resp *http.Response) (C } return result, nil } - -// setMetadataHandleError handles the SetMetadata error response. -func (client *containerClient) setMetadataHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/storage/azblob/zz_generated_directory_client.go b/sdk/storage/azblob/zz_generated_directory_client.go index a8f435552542..c3ce389d81ba 100644 --- a/sdk/storage/azblob/zz_generated_directory_client.go +++ b/sdk/storage/azblob/zz_generated_directory_client.go @@ -10,12 +10,12 @@ package azblob import ( "context" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "strconv" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) type directoryClient struct { @@ -39,7 +39,7 @@ func (client *directoryClient) Create(ctx context.Context, directoryCreateOption return DirectoryCreateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return DirectoryCreateResponse{}, client.createHandleError(resp) + return DirectoryCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) } @@ -142,19 +142,6 @@ func (client *directoryClient) createHandleResponse(resp *http.Response) (Direct return result, nil } -// createHandleError handles the Create error response. -func (client *directoryClient) createHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Delete - Deletes the directory // If the operation fails it returns the *DataLakeStorageError error type. func (client *directoryClient) Delete(ctx context.Context, recursiveDirectoryDelete bool, directoryDeleteOptions *DirectoryDeleteOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (DirectoryDeleteResponse, error) { @@ -167,7 +154,7 @@ func (client *directoryClient) Delete(ctx context.Context, recursiveDirectoryDel return DirectoryDeleteResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return DirectoryDeleteResponse{}, client.deleteHandleError(resp) + return DirectoryDeleteResponse{}, runtime.NewResponseError(resp) } return client.deleteHandleResponse(resp) } @@ -235,19 +222,6 @@ func (client *directoryClient) deleteHandleResponse(resp *http.Response) (Direct return result, nil } -// deleteHandleError handles the Delete error response. -func (client *directoryClient) deleteHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetAccessControl - Get the owner, group, permissions, or access control list for a directory. // If the operation fails it returns the *DataLakeStorageError error type. func (client *directoryClient) GetAccessControl(ctx context.Context, directoryGetAccessControlOptions *DirectoryGetAccessControlOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (DirectoryGetAccessControlResponse, error) { @@ -260,7 +234,7 @@ func (client *directoryClient) GetAccessControl(ctx context.Context, directoryGe return DirectoryGetAccessControlResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return DirectoryGetAccessControlResponse{}, client.getAccessControlHandleError(resp) + return DirectoryGetAccessControlResponse{}, runtime.NewResponseError(resp) } return client.getAccessControlHandleResponse(resp) } @@ -344,19 +318,6 @@ func (client *directoryClient) getAccessControlHandleResponse(resp *http.Respons return result, nil } -// getAccessControlHandleError handles the GetAccessControl error response. -func (client *directoryClient) getAccessControlHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Rename - Rename a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This // operation supports conditional HTTP requests. For more // information, see Specifying Conditional Headers for Blob Service Operations [https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations]. @@ -373,7 +334,7 @@ func (client *directoryClient) Rename(ctx context.Context, renameSource string, return DirectoryRenameResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return DirectoryRenameResponse{}, client.renameHandleError(resp) + return DirectoryRenameResponse{}, runtime.NewResponseError(resp) } return client.renameHandleResponse(resp) } @@ -500,19 +461,6 @@ func (client *directoryClient) renameHandleResponse(resp *http.Response) (Direct return result, nil } -// renameHandleError handles the Rename error response. -func (client *directoryClient) renameHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetAccessControl - Set the owner, group, permissions, or access control list for a directory. // If the operation fails it returns the *DataLakeStorageError error type. func (client *directoryClient) SetAccessControl(ctx context.Context, directorySetAccessControlOptions *DirectorySetAccessControlOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (DirectorySetAccessControlResponse, error) { @@ -525,7 +473,7 @@ func (client *directoryClient) SetAccessControl(ctx context.Context, directorySe return DirectorySetAccessControlResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return DirectorySetAccessControlResponse{}, client.setAccessControlHandleError(resp) + return DirectorySetAccessControlResponse{}, runtime.NewResponseError(resp) } return client.setAccessControlHandleResponse(resp) } @@ -605,16 +553,3 @@ func (client *directoryClient) setAccessControlHandleResponse(resp *http.Respons } return result, nil } - -// setAccessControlHandleError handles the SetAccessControl error response. -func (client *directoryClient) setAccessControlHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := DataLakeStorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/storage/azblob/zz_generated_models.go b/sdk/storage/azblob/zz_generated_models.go index b42a18762daa..2366bbb35214 100644 --- a/sdk/storage/azblob/zz_generated_models.go +++ b/sdk/storage/azblob/zz_generated_models.go @@ -1204,12 +1204,6 @@ type DataLakeStorageError struct { DataLakeStorageErrorDetails *DataLakeStorageErrorAutoGenerated `xml:"error"` } -// Error implements the error interface for type DataLakeStorageError. -// The contents of the error text are not contractual and subject to change. -func (e DataLakeStorageError) Error() string { - return e.raw -} - // DataLakeStorageErrorAutoGenerated - The service error response object. type DataLakeStorageErrorAutoGenerated struct { // The service error code. @@ -1910,11 +1904,6 @@ type StaticWebsite struct { // Message *string `xml:"Message"` //} // -//// Error implements the error interface for type StorageError. -//// The contents of the error text are not contractual and subject to change. -//func (e StorageError) Error() string { -// return e.raw -//} // StorageServiceProperties - Storage Service Properties. type StorageServiceProperties struct { diff --git a/sdk/storage/azblob/zz_generated_pageblob_client.go b/sdk/storage/azblob/zz_generated_pageblob_client.go index 70546afaaa56..651403bcb982 100644 --- a/sdk/storage/azblob/zz_generated_pageblob_client.go +++ b/sdk/storage/azblob/zz_generated_pageblob_client.go @@ -11,13 +11,13 @@ package azblob import ( "context" "encoding/base64" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "io" "net/http" "strconv" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) type pageBlobClient struct { @@ -36,7 +36,7 @@ func (client *pageBlobClient) ClearPages(ctx context.Context, contentLength int6 return PageBlobClearPagesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return PageBlobClearPagesResponse{}, client.clearPagesHandleError(resp) + return PageBlobClearPagesResponse{}, runtime.NewResponseError(resp) } return client.clearPagesHandleResponse(resp) } @@ -158,19 +158,6 @@ func (client *pageBlobClient) clearPagesHandleResponse(resp *http.Response) (Pag return result, nil } -// clearPagesHandleError handles the ClearPages error response. -func (client *pageBlobClient) clearPagesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // CopyIncremental - The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot is copied such that // only the differential changes between the previously copied // snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. @@ -187,7 +174,7 @@ func (client *pageBlobClient) CopyIncremental(ctx context.Context, copySource st return PageBlobCopyIncrementalResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return PageBlobCopyIncrementalResponse{}, client.copyIncrementalHandleError(resp) + return PageBlobCopyIncrementalResponse{}, runtime.NewResponseError(resp) } return client.copyIncrementalHandleResponse(resp) } @@ -266,19 +253,6 @@ func (client *pageBlobClient) copyIncrementalHandleResponse(resp *http.Response) return result, nil } -// copyIncrementalHandleError handles the CopyIncremental error response. -func (client *pageBlobClient) copyIncrementalHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Create - The Create operation creates a new page blob. // If the operation fails it returns the *StorageError error type. func (client *pageBlobClient) Create(ctx context.Context, contentLength int64, blobContentLength int64, pageBlobCreateOptions *PageBlobCreateOptions, blobHTTPHeaders *BlobHTTPHeaders, leaseAccessConditions *LeaseAccessConditions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, modifiedAccessConditions *ModifiedAccessConditions) (PageBlobCreateResponse, error) { @@ -291,7 +265,7 @@ func (client *pageBlobClient) Create(ctx context.Context, contentLength int64, b return PageBlobCreateResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return PageBlobCreateResponse{}, client.createHandleError(resp) + return PageBlobCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) } @@ -435,19 +409,6 @@ func (client *pageBlobClient) createHandleResponse(resp *http.Response) (PageBlo return result, nil } -// createHandleError handles the Create error response. -func (client *pageBlobClient) createHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetPageRanges - The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a page blob // If the operation fails it returns the *StorageError error type. func (client *pageBlobClient) GetPageRanges(ctx context.Context, pageBlobGetPageRangesOptions *PageBlobGetPageRangesOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (PageBlobGetPageRangesResponse, error) { @@ -460,7 +421,7 @@ func (client *pageBlobClient) GetPageRanges(ctx context.Context, pageBlobGetPage return PageBlobGetPageRangesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return PageBlobGetPageRangesResponse{}, client.getPageRangesHandleError(resp) + return PageBlobGetPageRangesResponse{}, runtime.NewResponseError(resp) } return client.getPageRangesHandleResponse(resp) } @@ -551,19 +512,6 @@ func (client *pageBlobClient) getPageRangesHandleResponse(resp *http.Response) ( return result, nil } -// getPageRangesHandleError handles the GetPageRanges error response. -func (client *pageBlobClient) getPageRangesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetPageRangesDiff - The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and // previous snapshot. // If the operation fails it returns the *StorageError error type. @@ -577,7 +525,7 @@ func (client *pageBlobClient) GetPageRangesDiff(ctx context.Context, pageBlobGet return PageBlobGetPageRangesDiffResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return PageBlobGetPageRangesDiffResponse{}, client.getPageRangesDiffHandleError(resp) + return PageBlobGetPageRangesDiffResponse{}, runtime.NewResponseError(resp) } return client.getPageRangesDiffHandleResponse(resp) } @@ -674,19 +622,6 @@ func (client *pageBlobClient) getPageRangesDiffHandleResponse(resp *http.Respons return result, nil } -// getPageRangesDiffHandleError handles the GetPageRangesDiff error response. -func (client *pageBlobClient) getPageRangesDiffHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // Resize - Resize the Blob // If the operation fails it returns the *StorageError error type. func (client *pageBlobClient) Resize(ctx context.Context, blobContentLength int64, pageBlobResizeOptions *PageBlobResizeOptions, leaseAccessConditions *LeaseAccessConditions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, modifiedAccessConditions *ModifiedAccessConditions) (PageBlobResizeResponse, error) { @@ -699,7 +634,7 @@ func (client *pageBlobClient) Resize(ctx context.Context, blobContentLength int6 return PageBlobResizeResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return PageBlobResizeResponse{}, client.resizeHandleError(resp) + return PageBlobResizeResponse{}, runtime.NewResponseError(resp) } return client.resizeHandleResponse(resp) } @@ -794,19 +729,6 @@ func (client *pageBlobClient) resizeHandleResponse(resp *http.Response) (PageBlo return result, nil } -// resizeHandleError handles the Resize error response. -func (client *pageBlobClient) resizeHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // UpdateSequenceNumber - Update the sequence number of the blob // If the operation fails it returns the *StorageError error type. func (client *pageBlobClient) UpdateSequenceNumber(ctx context.Context, sequenceNumberAction SequenceNumberActionType, pageBlobUpdateSequenceNumberOptions *PageBlobUpdateSequenceNumberOptions, leaseAccessConditions *LeaseAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (PageBlobUpdateSequenceNumberResponse, error) { @@ -819,7 +741,7 @@ func (client *pageBlobClient) UpdateSequenceNumber(ctx context.Context, sequence return PageBlobUpdateSequenceNumberResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return PageBlobUpdateSequenceNumberResponse{}, client.updateSequenceNumberHandleError(resp) + return PageBlobUpdateSequenceNumberResponse{}, runtime.NewResponseError(resp) } return client.updateSequenceNumberHandleResponse(resp) } @@ -905,19 +827,6 @@ func (client *pageBlobClient) updateSequenceNumberHandleResponse(resp *http.Resp return result, nil } -// updateSequenceNumberHandleError handles the UpdateSequenceNumber error response. -func (client *pageBlobClient) updateSequenceNumberHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // UploadPages - The Upload Pages operation writes a range of pages to a page blob // If the operation fails it returns the *StorageError error type. func (client *pageBlobClient) UploadPages(ctx context.Context, contentLength int64, body io.ReadSeekCloser, pageBlobUploadPagesOptions *PageBlobUploadPagesOptions, leaseAccessConditions *LeaseAccessConditions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, sequenceNumberAccessConditions *SequenceNumberAccessConditions, modifiedAccessConditions *ModifiedAccessConditions) (PageBlobUploadPagesResponse, error) { @@ -930,7 +839,7 @@ func (client *pageBlobClient) UploadPages(ctx context.Context, contentLength int return PageBlobUploadPagesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return PageBlobUploadPagesResponse{}, client.uploadPagesHandleError(resp) + return PageBlobUploadPagesResponse{}, runtime.NewResponseError(resp) } return client.uploadPagesHandleResponse(resp) } @@ -1071,19 +980,6 @@ func (client *pageBlobClient) uploadPagesHandleResponse(resp *http.Response) (Pa return result, nil } -// uploadPagesHandleError handles the UploadPages error response. -func (client *pageBlobClient) uploadPagesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // UploadPagesFromURL - The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL // If the operation fails it returns the *StorageError error type. func (client *pageBlobClient) UploadPagesFromURL(ctx context.Context, sourceURL string, sourceRange string, contentLength int64, rangeParam string, pageBlobUploadPagesFromURLOptions *PageBlobUploadPagesFromURLOptions, cpkInfo *CpkInfo, cpkScopeInfo *CpkScopeInfo, leaseAccessConditions *LeaseAccessConditions, sequenceNumberAccessConditions *SequenceNumberAccessConditions, modifiedAccessConditions *ModifiedAccessConditions, sourceModifiedAccessConditions *SourceModifiedAccessConditions) (PageBlobUploadPagesFromURLResponse, error) { @@ -1096,7 +992,7 @@ func (client *pageBlobClient) UploadPagesFromURL(ctx context.Context, sourceURL return PageBlobUploadPagesFromURLResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusCreated) { - return PageBlobUploadPagesFromURLResponse{}, client.uploadPagesFromURLHandleError(resp) + return PageBlobUploadPagesFromURLResponse{}, runtime.NewResponseError(resp) } return client.uploadPagesFromURLHandleResponse(resp) } @@ -1245,16 +1141,3 @@ func (client *pageBlobClient) uploadPagesFromURLHandleResponse(resp *http.Respon } return result, nil } - -// uploadPagesFromURLHandleError handles the UploadPagesFromURL error response. -func (client *pageBlobClient) uploadPagesFromURLHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} diff --git a/sdk/storage/azblob/zz_generated_pagers.go b/sdk/storage/azblob/zz_generated_pagers.go index fab312cb80c5..d3ad53c2107e 100644 --- a/sdk/storage/azblob/zz_generated_pagers.go +++ b/sdk/storage/azblob/zz_generated_pagers.go @@ -10,10 +10,11 @@ package azblob import ( "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "reflect" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) // ContainerListBlobFlatSegmentPager provides operations for iterating over paged responses. @@ -53,7 +54,7 @@ func (p *ContainerListBlobFlatSegmentPager) NextPage(ctx context.Context) bool { return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listBlobFlatSegmentHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listBlobFlatSegmentHandleResponse(resp) @@ -107,7 +108,7 @@ func (p *ContainerListBlobHierarchySegmentPager) NextPage(ctx context.Context) b return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listBlobHierarchySegmentHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listBlobHierarchySegmentHandleResponse(resp) @@ -161,7 +162,7 @@ func (p *ServiceListContainersSegmentPager) NextPage(ctx context.Context) bool { return false } if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = p.client.listContainersSegmentHandleError(resp) + p.err = runtime.NewResponseError(resp) return false } result, err := p.client.listContainersSegmentHandleResponse(resp) diff --git a/sdk/storage/azblob/zz_generated_service_client.go b/sdk/storage/azblob/zz_generated_service_client.go index 738956899100..d4fa7768a10a 100644 --- a/sdk/storage/azblob/zz_generated_service_client.go +++ b/sdk/storage/azblob/zz_generated_service_client.go @@ -11,13 +11,14 @@ package azblob import ( "context" "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "io" "net/http" "strconv" "strings" "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) type serviceClient struct { @@ -38,7 +39,7 @@ func (client *serviceClient) FilterBlobs(ctx context.Context, options *ServiceFi return ServiceFilterBlobsResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceFilterBlobsResponse{}, client.filterBlobsHandleError(resp) + return ServiceFilterBlobsResponse{}, runtime.NewResponseError(resp) } return client.filterBlobsHandleResponse(resp) } @@ -97,19 +98,6 @@ func (client *serviceClient) filterBlobsHandleResponse(resp *http.Response) (Ser return result, nil } -// filterBlobsHandleError handles the FilterBlobs error response. -func (client *serviceClient) filterBlobsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns the *StorageError error type. func (client *serviceClient) GetAccountInfo(ctx context.Context, options *ServiceGetAccountInfoOptions) (ServiceGetAccountInfoResponse, error) { @@ -122,7 +110,7 @@ func (client *serviceClient) GetAccountInfo(ctx context.Context, options *Servic return ServiceGetAccountInfoResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceGetAccountInfoResponse{}, client.getAccountInfoHandleError(resp) + return ServiceGetAccountInfoResponse{}, runtime.NewResponseError(resp) } return client.getAccountInfoHandleResponse(resp) } @@ -177,19 +165,6 @@ func (client *serviceClient) getAccountInfoHandleResponse(resp *http.Response) ( return result, nil } -// getAccountInfoHandleError handles the GetAccountInfo error response. -func (client *serviceClient) getAccountInfoHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetProperties - gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) // rules. // If the operation fails it returns the *StorageError error type. @@ -203,7 +178,7 @@ func (client *serviceClient) GetProperties(ctx context.Context, options *Service return ServiceGetPropertiesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceGetPropertiesResponse{}, client.getPropertiesHandleError(resp) + return ServiceGetPropertiesResponse{}, runtime.NewResponseError(resp) } return client.getPropertiesHandleResponse(resp) } @@ -247,19 +222,6 @@ func (client *serviceClient) getPropertiesHandleResponse(resp *http.Response) (S return result, nil } -// getPropertiesHandleError handles the GetProperties error response. -func (client *serviceClient) getPropertiesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetStatistics - Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access // geo-redundant replication is enabled for the storage account. // If the operation fails it returns the *StorageError error type. @@ -273,7 +235,7 @@ func (client *serviceClient) GetStatistics(ctx context.Context, options *Service return ServiceGetStatisticsResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceGetStatisticsResponse{}, client.getStatisticsHandleError(resp) + return ServiceGetStatisticsResponse{}, runtime.NewResponseError(resp) } return client.getStatisticsHandleResponse(resp) } @@ -324,19 +286,6 @@ func (client *serviceClient) getStatisticsHandleResponse(resp *http.Response) (S return result, nil } -// getStatisticsHandleError handles the GetStatistics error response. -func (client *serviceClient) getStatisticsHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // GetUserDelegationKey - Retrieves a user delegation key for the Blob service. This is only a valid operation when using bearer token authentication. // If the operation fails it returns the *StorageError error type. func (client *serviceClient) GetUserDelegationKey(ctx context.Context, keyInfo KeyInfo, options *ServiceGetUserDelegationKeyOptions) (ServiceGetUserDelegationKeyResponse, error) { @@ -349,7 +298,7 @@ func (client *serviceClient) GetUserDelegationKey(ctx context.Context, keyInfo K return ServiceGetUserDelegationKeyResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceGetUserDelegationKeyResponse{}, client.getUserDelegationKeyHandleError(resp) + return ServiceGetUserDelegationKeyResponse{}, runtime.NewResponseError(resp) } return client.getUserDelegationKeyHandleResponse(resp) } @@ -400,19 +349,6 @@ func (client *serviceClient) getUserDelegationKeyHandleResponse(resp *http.Respo return result, nil } -// getUserDelegationKeyHandleError handles the GetUserDelegationKey error response. -func (client *serviceClient) getUserDelegationKeyHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // ListContainersSegment - The List Containers Segment operation returns a list of the containers under the specified account // If the operation fails it returns the *StorageError error type. func (client *serviceClient) ListContainersSegment(options *ServiceListContainersSegmentOptions) *ServiceListContainersSegmentPager { @@ -477,19 +413,6 @@ func (client *serviceClient) listContainersSegmentHandleResponse(resp *http.Resp return result, nil } -// listContainersSegmentHandleError handles the ListContainersSegment error response. -func (client *serviceClient) listContainersSegmentHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SetProperties - Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource // Sharing) rules // If the operation fails it returns the *StorageError error type. @@ -503,7 +426,7 @@ func (client *serviceClient) SetProperties(ctx context.Context, storageServicePr return ServiceSetPropertiesResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ServiceSetPropertiesResponse{}, client.setPropertiesHandleError(resp) + return ServiceSetPropertiesResponse{}, runtime.NewResponseError(resp) } return client.setPropertiesHandleResponse(resp) } @@ -544,19 +467,6 @@ func (client *serviceClient) setPropertiesHandleResponse(resp *http.Response) (S return result, nil } -// setPropertiesHandleError handles the SetProperties error response. -func (client *serviceClient) setPropertiesHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -} - // SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request. // If the operation fails it returns the *StorageError error type. func (client *serviceClient) SubmitBatch(ctx context.Context, contentLength int64, multipartContentType string, body io.ReadSeekCloser, options *ServiceSubmitBatchOptions) (ServiceSubmitBatchResponse, error) { @@ -569,7 +479,7 @@ func (client *serviceClient) SubmitBatch(ctx context.Context, contentLength int6 return ServiceSubmitBatchResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceSubmitBatchResponse{}, client.submitBatchHandleError(resp) + return ServiceSubmitBatchResponse{}, runtime.NewResponseError(resp) } return client.submitBatchHandleResponse(resp) } @@ -586,7 +496,7 @@ func (client *serviceClient) submitBatchCreateRequest(ctx context.Context, conte reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } req.Raw().URL.RawQuery = reqQP.Encode() - req.SkipBodyDownload() + runtime.SkipBodyDownload(req) req.Raw().Header.Set("Content-Length", strconv.FormatInt(contentLength, 10)) req.Raw().Header.Set("Content-Type", multipartContentType) req.Raw().Header.Set("x-ms-version", "2019-12-12") @@ -611,16 +521,3 @@ func (client *serviceClient) submitBatchHandleResponse(resp *http.Response) (Ser } return result, nil } - -// submitBatchHandleError handles the SubmitBatch error response. -func (client *serviceClient) submitBatchHandleError(resp *http.Response) error { - body, err := runtime.Payload(resp) - if err != nil { - return runtime.NewResponseError(err, resp) - } - errType := StorageError{raw: string(body)} - if err := runtime.UnmarshalAsXML(resp, &errType); err != nil { - return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp) - } - return runtime.NewResponseError(&errType, resp) -}