diff --git a/src/Support/Support.Autorest/README.md b/src/Support/Support.Autorest/README.md index 9f7cc45dce8c..4635f8edfd3e 100644 --- a/src/Support/Support.Autorest/README.md +++ b/src/Support/Support.Autorest/README.md @@ -82,7 +82,6 @@ directive: - FileSize - NumberOfChunks - where: - verb: New subject: FileWorkspacesNoSubscription parameter-name: FileWorkspaceName set: diff --git a/src/Support/Support.Autorest/docs/Get-AzSupportFileWorkspacesNoSubscription.md b/src/Support/Support.Autorest/docs/Get-AzSupportFileWorkspacesNoSubscription.md index 8694b5cc60ca..3bcbb2e49472 100644 --- a/src/Support/Support.Autorest/docs/Get-AzSupportFileWorkspacesNoSubscription.md +++ b/src/Support/Support.Autorest/docs/Get-AzSupportFileWorkspacesNoSubscription.md @@ -75,7 +75,7 @@ File Workspace Name ```yaml Type: System.String Parameter Sets: Get -Aliases: +Aliases: Name Required: True Position: Named diff --git a/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspace.Recording.json b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspace.Recording.json new file mode 100644 index 000000000000..17c6f20ff4e5 --- /dev/null +++ b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspace.Recording.json @@ -0,0 +1,43 @@ +{ + "Get-AzSupportFileWorkspace+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/4df09db9-7a7e-450b-8f88-00fb97c277bd/providers/Microsoft.Support/fileWorkspaces/test-ps-d4adfb8c-f15c-48de-a0b0-8da419bfe51d?api-version=2022-09-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/subscriptions/4df09db9-7a7e-450b-8f88-00fb97c277bd/providers/Microsoft.Support/fileWorkspaces/test-ps-d4adfb8c-f15c-48de-a0b0-8da419bfe51d?api-version=2022-09-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "3" ], + "x-ms-client-request-id": [ "041c6579-0787-44ad-aaa1-ae473436f07b" ], + "CommandName": [ "Get-AzSupportFileWorkspace" ], + "FullCommandName": [ "Get-AzSupportFileWorkspace_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v11.2.0", "PSVersion/v7.3.11", "Az.Support/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Server": [ "Kestrel" ], + "x-ms-ratelimit-remaining-subscription-reads": [ "11999" ], + "x-ms-request-id": [ "b752c627-0706-4e1a-bb95-db1b17775e08" ], + "x-ms-correlation-request-id": [ "b752c627-0706-4e1a-bb95-db1b17775e08" ], + "x-ms-routing-request-id": [ "EASTUS:20240130T153256Z:b752c627-0706-4e1a-bb95-db1b17775e08" ], + "Date": [ "Tue, 30 Jan 2024 15:32:56 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "334" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/subscriptions/4df09db9-7a7e-450b-8f88-00fb97c277bd/providers/Microsoft.Support/fileWorkspaces/test-ps-d4adfb8c-f15c-48de-a0b0-8da419bfe51d\",\"name\":\"test-ps-d4adfb8c-f15c-48de-a0b0-8da419bfe51d\",\"type\":\"Microsoft.Support/fileWorkspaces\",\"properties\":{\"expirationTime\":\"2024-01-31T15:32:53Z\",\"createdOn\":\"2024-01-30T15:32:53Z\"}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspace.Tests.ps1 b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspace.Tests.ps1 index a9cd0b7576e7..8e3530d1d774 100644 --- a/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspace.Tests.ps1 +++ b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspace.Tests.ps1 @@ -15,8 +15,9 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzSupportFileWorkspace')) } Describe 'Get-AzSupportFileWorkspace' { - It 'Get' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'Get' { + $fileWorkspace = Get-AzSupportFileWorkspace -Name $env.FileWorkspaceNameSubscription + $fileWorkspace.Name | Should -Be $env.FileWorkspaceNameSubscription } It 'GetViaIdentity' -skip { diff --git a/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspacesNoSubscription.Recording.json b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspacesNoSubscription.Recording.json new file mode 100644 index 000000000000..fcd9fb18d2f5 --- /dev/null +++ b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspacesNoSubscription.Recording.json @@ -0,0 +1,43 @@ +{ + "Get-AzSupportFileWorkspacesNoSubscription+[NoContext]+Get+$GET+https://management.azure.com/providers/Microsoft.Support/fileWorkspaces/test-ps-43ad6585-c0ac-4a13-8d0e-bb633b8b1db3?api-version=2022-09-01-preview+1": { + "Request": { + "Method": "GET", + "RequestUri": "https://management.azure.com/providers/Microsoft.Support/fileWorkspaces/test-ps-43ad6585-c0ac-4a13-8d0e-bb633b8b1db3?api-version=2022-09-01-preview", + "Content": null, + "isContentBase64": false, + "Headers": { + "x-ms-unique-id": [ "4" ], + "x-ms-client-request-id": [ "7e321a52-1564-4b97-a1c2-a57079ec53cc" ], + "CommandName": [ "Get-AzSupportFileWorkspacesNoSubscription" ], + "FullCommandName": [ "Get-AzSupportFileWorkspacesNoSubscription_Get" ], + "ParameterSetName": [ "__AllParameterSets" ], + "User-Agent": [ "AzurePowershell/v11.2.0", "PSVersion/v7.3.11", "Az.Support/0.1.0" ], + "Authorization": [ "[Filtered]" ] + }, + "ContentHeaders": { + } + }, + "Response": { + "StatusCode": 200, + "Headers": { + "Cache-Control": [ "no-cache" ], + "Pragma": [ "no-cache" ], + "X-Content-Type-Options": [ "nosniff" ], + "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Server": [ "Kestrel" ], + "x-ms-ratelimit-remaining-tenant-reads": [ "11999" ], + "x-ms-request-id": [ "27f3281f-f92e-487d-bc46-0a21387d2502" ], + "x-ms-correlation-request-id": [ "27f3281f-f92e-487d-bc46-0a21387d2502" ], + "x-ms-routing-request-id": [ "EASTUS:20240130T153259Z:27f3281f-f92e-487d-bc46-0a21387d2502" ], + "Date": [ "Tue, 30 Jan 2024 15:32:58 GMT" ] + }, + "ContentHeaders": { + "Content-Length": [ "283" ], + "Content-Type": [ "application/json; charset=utf-8" ], + "Expires": [ "-1" ] + }, + "Content": "{\"id\":\"/providers/Microsoft.Support/fileWorkspaces/test-ps-43ad6585-c0ac-4a13-8d0e-bb633b8b1db3\",\"name\":\"test-ps-43ad6585-c0ac-4a13-8d0e-bb633b8b1db3\",\"type\":\"Microsoft.Support/fileWorkspaces\",\"properties\":{\"expirationTime\":\"2024-01-31T15:32:54Z\",\"createdOn\":\"2024-01-30T15:32:54Z\"}}", + "isContentBase64": false + } + } +} \ No newline at end of file diff --git a/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspacesNoSubscription.Tests.ps1 b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspacesNoSubscription.Tests.ps1 index fedc1229ffcf..71a90c18b159 100644 --- a/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspacesNoSubscription.Tests.ps1 +++ b/src/Support/Support.Autorest/test/Get-AzSupportFileWorkspacesNoSubscription.Tests.ps1 @@ -15,8 +15,9 @@ if(($null -eq $TestName) -or ($TestName -contains 'Get-AzSupportFileWorkspacesNo } Describe 'Get-AzSupportFileWorkspacesNoSubscription' { - It 'Get' -skip { - { throw [System.NotImplementedException] } | Should -Not -Throw + It 'Get' { + $fileWorkspace = Get-AzSupportFileWorkspacesNoSubscription -Name $env.FileWorkspaceNameNoSubscription + $fileWorkspace.Name | Should -Be $env.FileWorkspaceNameNoSubscription } It 'GetViaIdentity' -skip { diff --git a/src/Support/Support.Autorest/test/env.json b/src/Support/Support.Autorest/test/env.json index 05fb02f93e9f..040901da8987 100644 --- a/src/Support/Support.Autorest/test/env.json +++ b/src/Support/Support.Autorest/test/env.json @@ -1,6 +1,8 @@ { + "BillingProblemClassificationId": "d0f16bf7-e011-3f3b-1c26-3147f84e0896", "BillingServiceId": "517f2da6-78fd-0498-4e22-ad26996b1dfc", - "SubscriptionId": "4df09db9-7a7e-450b-8f88-00fb97c277bd", "Tenant": "d71d46f6-114f-4d2a-81c9-8fc86ba8801c", - "BillingProblemClassificationId": "d0f16bf7-e011-3f3b-1c26-3147f84e0896" + "FileWorkspaceNameNoSubscription": "test-ps-43ad6585-c0ac-4a13-8d0e-bb633b8b1db3", + "SubscriptionId": "4df09db9-7a7e-450b-8f88-00fb97c277bd", + "FileWorkspaceNameSubscription": "test-ps-d4adfb8c-f15c-48de-a0b0-8da419bfe51d" } diff --git a/src/Support/Support.Autorest/test/utils.ps1 b/src/Support/Support.Autorest/test/utils.ps1 index 31ee758dea12..946a5150669b 100644 --- a/src/Support/Support.Autorest/test/utils.ps1 +++ b/src/Support/Support.Autorest/test/utils.ps1 @@ -46,6 +46,13 @@ function setupEnv() { $env.BillingServiceId = "517f2da6-78fd-0498-4e22-ad26996b1dfc" $env.BillingProblemClassificationId = "d0f16bf7-e011-3f3b-1c26-3147f84e0896" # For any resources you created for test, you should add it to $env here. + + $env.FileWorkspaceNameSubscription = "test-ps-$(New-Guid)" + $env.FileWorkspaceNameNoSubscription = "test-ps-$(New-Guid)" + + New-AzSupportFileWorkspace -Name $env.FileWorkspaceNameSubscription + New-AzSupportFileWorkspacesNoSubscription -Name $env.FileWorkspaceNameNoSubscription + $envFile = 'env.json' if ($TestMode -eq 'live') { $envFile = 'localEnv.json'